Skip to content

Commit

Permalink
Splitted react facades into -core and -dom modules, fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Aug 24, 2021
1 parent 95bb196 commit 136c318
Show file tree
Hide file tree
Showing 16 changed files with 220 additions and 167 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ script:
fi
cache:
directories:
- ~/.npm
- ~/.nvm
- "$HOME/.ivy2/cache"
- "$HOME/.sbt"
before_cache:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ ReactDOM.render(<.div(^.id := "hello-world")("Hello, World!"), mountNode)
2. Depend on the libraries.
```
libraryDependencies ++= Seq(
"org.scommons.shogowada" %%% "scalajs-reactjs" % "0.15.0", // For react facade
"org.scommons.shogowada" %%% "scalajs-reactjs-core" % "0.15.0", // For react facade
"org.scommons.shogowada" %%% "scalajs-reactjs-dom" % "0.15.0", // For react-dom facade
"org.scommons.shogowada" %%% "scalajs-reactjs-router-dom" % "0.15.0", // Optional. For react-router-dom facade
"org.scommons.shogowada" %%% "scalajs-reactjs-router-redux" % "0.15.0", // Optional. For react-router-redux facade
"org.scommons.shogowada" %%% "scalajs-reactjs-redux" % "0.15.0", // Optional. For react-redux facade
Expand Down
56 changes: 36 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ lazy val root = (project in file("."))
)
.aggregate(
core,
dom,
history,
router,
routerDom,
Expand All @@ -91,21 +92,36 @@ lazy val root = (project in file("."))
lazy val core = project.in(file("core"))
.settings(commonSettings: _*)
.settings(
name := "scalajs-reactjs",
name := "scalajs-reactjs-core",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.8",
"org.scommons.shogowada" %%% "statictags" % StaticTagsVersion
),
npmDependencies in Compile ++= Seq(
"create-react-class" -> CreateReactClassVersion,
"react" -> ReactVersion,
"react" -> ReactVersion
),
(webpack in(Compile, fastOptJS)) := Seq(),
(webpack in(Compile, fullOptJS)) := Seq(),
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)

lazy val dom = project.in(file("dom"))
.settings(commonSettings: _*)
.settings(
name := "scalajs-reactjs-dom",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.8"
),
npmDependencies in Compile ++= Seq(
"react-dom" -> ReactVersion
),
(webpack in(Compile, fastOptJS)) := Seq(),
(webpack in(Compile, fullOptJS)) := Seq(),
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)

lazy val history = project.in(file("history"))
.settings(commonSettings: _*)
Expand All @@ -132,7 +148,7 @@ lazy val router = project.in(file("router"))
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, history)
.dependsOn(dom, history)

lazy val routerDom = project.in(file("router-dom"))
.settings(commonSettings: _*)
Expand All @@ -146,7 +162,7 @@ lazy val routerDom = project.in(file("router-dom"))
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, router)
.dependsOn(dom, router)

lazy val redux = project.in(file("redux"))
.settings(commonSettings: _*)
Expand All @@ -161,7 +177,7 @@ lazy val redux = project.in(file("redux"))
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val reduxDevTools = project.in(file("redux-devtools"))
.settings(commonSettings: _*)
Expand All @@ -175,7 +191,7 @@ lazy val reduxDevTools = project.in(file("redux-devtools"))
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, redux)
.dependsOn(dom, redux)

lazy val routerRedux = project.in(file("router-redux"))
.settings(commonSettings: _*)
Expand All @@ -189,7 +205,7 @@ lazy val routerRedux = project.in(file("router-redux"))
publishArtifact := true
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, history, router, redux)
.dependsOn(dom, history, router, redux)

val exampleCommonSettings = commonSettings ++ Seq(
name := "scalajs-reactjs-example",
Expand All @@ -203,95 +219,95 @@ lazy val exampleCustomVirtualDOM = project.in(file("example") / "custom-virtual-
name += "-custom-virtual-dom"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleHelloWorld = project.in(file("example") / "helloworld")
.settings(exampleCommonSettings: _*)
.settings(
name += "-helloworld"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleHelloWorldFunction = project.in(file("example") / "helloworld-function")
.settings(exampleCommonSettings: _*)
.settings(
name += "-helloworld-function"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleInteractiveHelloWorld = project.in(file("example") / "interactive-helloworld")
.settings(exampleCommonSettings: _*)
.settings(
name += "-interactive-helloworld"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleLifecycle = project.in(file("example") / "lifecycle")
.settings(exampleCommonSettings: _*)
.settings(
name += "-lifecycle"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleReduxDevTools = project.in(file("example") / "redux-devtools")
.settings(exampleCommonSettings: _*)
.settings(
name += "-redux-devtools"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, redux, reduxDevTools)
.dependsOn(dom, redux, reduxDevTools)

lazy val exampleReduxMiddleware = project.in(file("example") / "redux-middleware")
.settings(exampleCommonSettings: _*)
.settings(
name += "-redux-middleware"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, redux, reduxDevTools)
.dependsOn(dom, redux, reduxDevTools)

lazy val exampleRouter = project.in(file("example") / "router")
.settings(exampleCommonSettings: _*)
.settings(
name += "-router"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, routerDom)
.dependsOn(dom, routerDom)

lazy val exampleRouterRedux = project.in(file("example") / "router-redux")
.settings(exampleCommonSettings: _*)
.settings(
name += "-router-redux"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, redux, routerDom, routerRedux, reduxDevTools)
.dependsOn(dom, redux, routerDom, routerRedux, reduxDevTools)

lazy val exampleStyle = project.in(file("example") / "style")
.settings(exampleCommonSettings: _*)
.settings(
name += "-style"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleTodoApp = project.in(file("example") / "todo-app")
.settings(exampleCommonSettings: _*)
.settings(
name += "-todo-app"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core)
.dependsOn(dom)

lazy val exampleTodoAppRedux = project.in(file("example") / "todo-app-redux")
.settings(exampleCommonSettings: _*)
.settings(
name += "-todo-app-redux"
)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(core, redux)
.dependsOn(dom, redux)

lazy val exampleTest = project.in(file("example") / "test")
.configs(IntegrationTest)
Expand Down
4 changes: 2 additions & 2 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# scalajs-reactjs
# scalajs-reactjs-core

A facade for react and react-dom
A facade for `react`.
Loading

0 comments on commit 136c318

Please sign in to comment.