File tree 9 files changed +34
-12
lines changed
9 files changed +34
-12
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,5 @@ before_script:
23
23
24
24
script :
25
25
- sbt ++$TRAVIS_SCALA_VERSION test
26
- - sbt ++$TRAVIS_SCALA_VERSION + publishLocal
26
+ - sbt ++$TRAVIS_SCALA_VERSION publishLocal
27
27
- cd example && sbt ++$TRAVIS_SCALA_VERSION compile fullOptJS
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) program
4
4
5
5
## Usage
6
6
7
- Add the following to your SBT build:
7
+ Add the following dependency to your SBT build:
8
8
9
9
``` scala
10
- libraryDependencies += " io.udash" %%% " udash-jquery" % " 1.1 .0"
10
+ libraryDependencies += " io.udash" %%% " udash-jquery" % " 2.0 .0"
11
11
```
12
12
13
13
then import the jQuery package:
@@ -16,6 +16,21 @@ then import the jQuery package:
16
16
import io .udash .wrappers .jquery ._
17
17
```
18
18
19
+ Since version ` 2.0.0 ` the wrapper does not force JS dependency on jQuery. You have to
20
+ add it manually by:
21
+ * explicit link in your ` index.html ` .
22
+ ``` html
23
+ <script src =" https://code.jquery.com/jquery-3.3.1.min.js"
24
+ integrity =" sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
25
+ crossorigin =" anonymous" ></script >
26
+ ```
27
+ * or a [ Scala.js dependency] ( http://www.scala-js.org/doc/project/dependencies.html ) .
28
+ ``` scala
29
+ jsDependencies +=
30
+ " org.webjars" % " jquery" % " 3.3.1" / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
31
+ ```
32
+
33
+
19
34
## Examples
20
35
21
36
``` scala
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import org.scalajs.jsenv.selenium.SeleniumJSEnv
5
5
name := " udash-jquery"
6
6
7
7
inThisBuild(Seq (
8
- version := " 1.2 .0" ,
8
+ version := " 2.0 .0" ,
9
9
organization := " io.udash" ,
10
10
scalaVersion := " 2.12.6" ,
11
11
crossScalaVersions := Seq (" 2.11.12" , " 2.12.6" ),
@@ -58,13 +58,13 @@ val commonJSSettings = Seq(
58
58
)
59
59
60
60
libraryDependencies ++= Seq (
61
- " org.scala-js" %%% " scalajs-dom" % " 0.9.5 " ,
61
+ " org.scala-js" %%% " scalajs-dom" % " 0.9.6 " ,
62
62
" org.scalatest" %%% " scalatest" % " 3.0.5" % Test ,
63
63
" com.lihaoyi" %%% " scalatags" % " 0.6.7" % Test
64
64
)
65
65
66
66
jsDependencies +=
67
- " org.webjars" % " jquery" % " 3.3.1" / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
67
+ " org.webjars" % " jquery" % " 3.3.1" % Test / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
68
68
69
69
lazy val root = project.in(file(" ." ))
70
70
.enablePlugins(ScalaJSPlugin )
Original file line number Diff line number Diff line change 1
1
name := " jquery-demo"
2
2
3
3
inThisBuild(Seq (
4
- version := " 1.2 .0" ,
4
+ version := " 2.0 .0" ,
5
5
organization := " io.udash" ,
6
6
scalaVersion := " 2.12.6" ,
7
+ crossScalaVersions := Seq (" 2.11.12" , " 2.12.6" ),
7
8
scalacOptions ++= Seq (
8
9
" -feature" ,
9
10
" -deprecation" ,
@@ -31,6 +32,7 @@ val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
31
32
val `jquery-demo` = project.in(file(" ." )).enablePlugins(ScalaJSPlugin )
32
33
.settings(
33
34
libraryDependencies ++= Dependencies .deps.value,
35
+ jsDependencies ++= Dependencies .jsDeps.value,
34
36
35
37
/* move these files out of target/. */
36
38
Compile / fullOptJS / crossTarget := generatedDir,
Original file line number Diff line number Diff line change 1
1
import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
2
+ import org .portablescala .sbtplatformdeps .PlatformDepsPlugin .autoImport ._
2
3
import sbt ._
3
4
4
5
object Dependencies {
5
6
val udashCoreVersion = " 0.6.1"
6
- val udashJQueryVersion = " 1.2 .0"
7
+ val udashJQueryVersion = " 2.0 .0"
7
8
8
9
val deps = Def .setting(Seq [ModuleID ](
9
10
" io.udash" %%% " udash-core-frontend" % udashCoreVersion,
10
11
" io.udash" %%% " udash-jquery" % udashJQueryVersion
11
12
))
13
+
14
+ val jsDeps = Def .setting(Seq [org.scalajs.sbtplugin.JSModuleID ](
15
+ " org.webjars" % " jquery" % " 3.3.1" / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
16
+ ))
12
17
}
Original file line number Diff line number Diff line change 1
- sbt.version = 1.1.4
1
+ sbt.version = 1.2.0
Original file line number Diff line number Diff line change 1
1
logLevel := Level .Warn
2
2
3
- addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.22 " )
3
+ addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.24 " )
Original file line number Diff line number Diff line change 1
- sbt.version = 1.1.4
1
+ sbt.version = 1.2.0
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ logLevel := Level.Warn
2
2
3
3
libraryDependencies += " org.scala-js" %% " scalajs-env-selenium" % " 0.2.0"
4
4
5
- addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.22 " )
5
+ addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.24 " )
You can’t perform that action at this time.
0 commit comments