Comments (12)
No resolver is supposed to be needed. Well, to be precise, the required resolver is added by scalaJSSettings
. Perhaps you forgot to use %%%
instead of %%
?
from scala-js-dom.
I had never see that syntax before.
Acutally I tried it with 3 "%" but this operator is not recognized (tested with 0.13.1, 0.13.2 and 0.13.5). I get the error:
value %%% is not a member of String
[error] "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6",
[error] ^
[error] one error found
from scala-js-dom.
I had never see that syntax before.
You wouldn't have. It is Scala.js-specific, and was introduced with Scala.js 0.5.0, so it's brand new. You need the Scala.js sbt plugin for it to be available. Can you confirm that you have the following line in your project/build.sbt
(or project/plugins.sbt
or however you choose to call it):
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.0")
?
More generally, you might want to follow the steps in the tutorial to get you started with Scala.js 0.5. (Any 0.13.x version of sbt should work.)
If you still have an issue, can you elaborate a bit on your config? In particular the contents of your build.sbt
and project/build.sbt
would greatly help to identify the issue.
from scala-js-dom.
It is actually clearer ! It was not so straighforward in a multiproject application. Anyway, now it works fine. Thanks for helping. If you are interested in, have a look to my scaladget library which intends to use scala.js to provide higher level lib for building html pages in pure scala (https://github.com/mathieuleclaire/scaladget).
from scala-js-dom.
I have a comment about the new 0.5 version:
The library I just started (scaladget) relies on scala.js. When I use it in an other project (in the examples project of scaladget for instance), I need to use "%%%" to add my lib as dependency
libraryDependencies += "fr.iscpif" %%% "scaladget" % "0.1.0-SNAPSHOT"
It implies that I need to keep a dependency on the scala.js library in my example project. It would be nicer and clearer to have only a dependency on my lib for the final user of the scaladget lib. Is there a trick to bypass the scala.js dependency (as it was the case in the 0.4 version) ?
from scala-js-dom.
I don't understand. If your project is a Scala.js project, then by necessity any project depending on it is also a Scala.js project. What trick are you talking about in 0.4?
from scala-js-dom.
My lib is a Scala.js project, but a project depending on my lib should only depends on my lib and not on scala.js. Here is the build of an example project using my lib:
import sbt._
import Keys._
import fr.iscpif.jsmanager.JSManagerPlugin._
import scala.scalajs.sbtplugin.ScalaJSPlugin._
object ExampleBuild extends Build {
val Organization = "fr.iscpif"
val Name = "Scaladget Example"
val Version = "0.1.0-SNAPSHOT"
val ScalaVersion = "2.10.4"
lazy val scaladgetExample = Project("examples",
file("examples"),
settings = Defaults.defaultSettings ++ jsManagerSettings ++ Seq(
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies += "fr.iscpif" %%% "scaladget" % "0.1.0-SNAPSHOT",
jsCall := "Form().run();"
//outputPath := "/tmp"
)
)
}
The only solution I see is to exhibit a %%% function in my plugin, which calls the %%% scala.js function.
I realize that this thread is more a scala-js issue than a scala-js-dom one ! Sorry for that.
from scala-js-dom.
Ah, your project is a compiler plugin itself! That wasn't clear at all from your formulation of "my library". Then, yes, assuming jsManagerSettings
contain scalaJSSettings
, it's a valid setup. And then, yes, the solution for you is to provide %%%
from your plugin. This is easily done by mixing in impl.DependencyBuilders
:
object MyPlugin extends Plugin with scala.scalajs.sbtplugin.impl.DependencyBuilders {
...
}
although that makes your source dependent on the particular implementation of impl
, which is not recommended.
from scala-js-dom.
Actually there are both a plugin (called jsManager) and a project (called scaladget). The examples project depends on both.
from scala-js-dom.
Well, mixing with DependencyBuilders does not fix it. The %%% is viewed as a String and the implicit converter toScalaJSGroupID is not invoked
from scala-js-dom.
I was actually mixing impl.DependencyBuilders instead of scala.scalajs.sbtplugin.impl.DependencyBuilders. It's now works fine. Thanks !
from scala-js-dom.
Closing this isnce you seem to have figured it out =)
from scala-js-dom.
Related Issues (20)
- `Location#origin` should return a `String` HOT 1
- Fetch `RequestInit` needs duplex attribute HOT 1
- Add `PageTransitionEvent` HOT 1
- Typo in "WriteableStream" trait name? HOT 1
- Recommended approach when `Response.type` is undefined? HOT 1
- `Element#id` returns undefined HOT 2
- Update available MIMEtypes HOT 5
- Use `XMLDocument` type when parsing XML string in `DOMParser` HOT 3
- Remove attributes class members from Node
- is changing `Array` -> `FrozenArray` binary compatible? HOT 4
- It looks we are missing some methods from the FormData class HOT 2
- Confusing type of ImageData.data HOT 3
- Create bindings for webgpu
- WebAudio classes
- LockOptions doesn't use val for fields, making overriding not possible HOT 2
- Constructor parameters for URLSearchParams are not quite right
- Clarify `enum` and `object literals` usage in `scalajs-dom`
- Return Type of HTMLCanvasElement getContext is not clear. HOT 1
- Support Int.Locale
- MediaQueryList.addListener has wrong type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-js-dom.