File tree Expand file tree Collapse file tree 8 files changed +29
-12
lines changed Expand file tree Collapse file tree 8 files changed +29
-12
lines changed 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
44
55## Usage
66
7- Add the following to your SBT build:
7+ Add the following dependency to your SBT build:
88
99``` scala
10- libraryDependencies += " io.udash" %%% " udash-jquery" % " 1.1 .0"
10+ libraryDependencies += " io.udash" %%% " udash-jquery" % " 2.0 .0"
1111```
1212
1313then import the jQuery package:
@@ -16,6 +16,21 @@ then import the jQuery package:
1616import io .udash .wrappers .jquery ._
1717```
1818
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+ * [ 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+
1934## Examples
2035
2136``` scala
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import org.scalajs.jsenv.selenium.SeleniumJSEnv
55name := " udash-jquery"
66
77inThisBuild(Seq (
8- version := " 1.2 .0" ,
8+ version := " 2.0 .0" ,
99 organization := " io.udash" ,
1010 scalaVersion := " 2.12.6" ,
1111 crossScalaVersions := Seq (" 2.11.12" , " 2.12.6" ),
@@ -58,14 +58,11 @@ val commonJSSettings = Seq(
5858)
5959
6060libraryDependencies ++= Seq (
61- " org.scala-js" %%% " scalajs-dom" % " 0.9.5 " ,
61+ " org.scala-js" %%% " scalajs-dom" % " 0.9.6 " ,
6262 " org.scalatest" %%% " scalatest" % " 3.0.5" % Test ,
6363 " com.lihaoyi" %%% " scalatags" % " 0.6.7" % Test
6464)
6565
66- jsDependencies +=
67- " org.webjars" % " jquery" % " 3.3.1" / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
68-
6966lazy val root = project.in(file(" ." ))
7067 .enablePlugins(ScalaJSPlugin )
7168 .settings(commonJSSettings)
Original file line number Diff line number Diff line change 11name := " jquery-demo"
22
33inThisBuild(Seq (
4- version := " 1.2 .0" ,
4+ version := " 2.0 .0" ,
55 organization := " io.udash" ,
66 scalaVersion := " 2.12.6" ,
77 scalacOptions ++= Seq (
@@ -31,6 +31,7 @@ val copyAssets = taskKey[Unit]("Copies all assets to the target directory.")
3131val `jquery-demo` = project.in(file(" ." )).enablePlugins(ScalaJSPlugin )
3232 .settings(
3333 libraryDependencies ++= Dependencies .deps.value,
34+ jsDependencies ++= Dependencies .jsDeps.value,
3435
3536 /* move these files out of target/. */
3637 Compile / fullOptJS / crossTarget := generatedDir,
Original file line number Diff line number Diff line change @@ -9,4 +9,8 @@ object Dependencies {
99 " io.udash" %%% " udash-core-frontend" % udashCoreVersion,
1010 " io.udash" %%% " udash-jquery" % udashJQueryVersion
1111 ))
12+
13+ val jsDeps = Def .setting(Seq [JSModuleID ](
14+ " org.webjars" % " jquery" % " 3.3.1" / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
15+ )
1216}
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 11logLevel := Level .Warn
22
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
22
33libraryDependencies += " org.scala-js" %% " scalajs-env-selenium" % " 0.2.0"
44
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