sjrd on 0.6.x
Remove dead code: specific coll… Adapt the signature of `js.Arra… Merge pull request #3554 from s… (compare)
sjrd on master
Fix analyzer cycle detection to… Add toString methods to analyze… Do not provide linked ClassInfo… and 1 more (compare)
sjrd on master
Remove Logger.success It is un… Make level helpers final Clean-up ScalaConsoleLogger cod… and 1 more (compare)
take(3)and add it to the artifact that the sbt plugin is including in the build
It might be a bit challenging to define your build if you're starting from scratch :)
After that, it's a matter of running
fastLinkJS for development and
fullLinkJS for a production build.
There's an option of using the scalajs-bundler which maintains a webpack configuration and runs it under the hood in order to produce bundles ready to be shipped into the browser.
I personally prefer to deal with webpack manually (or experiment with other tools), so I'm usually doing something like this: https://github.com/yurique/frontroute-example or this: https://github.com/tulz-app/laminext/tree/main/website (shameless plug :) ).
Having all this in place, I have one terminal tab with sbt
~fastLinkJS and another one with
yarn dev running. And
yarn build for production build (after sbt
Wonder if it would be worthwhile to replace
js.UndefOr with Scala 3 union + extension methods:
extension [A] (a: A | Unit) def isEmpty: Boolean = a == () def isDefined: Boolean = !a.isEmpty def map[B](f: A => B): B | Unit = if a.isEmpty then () else f(a.forceGet) // etc @main def main(): Unit = val a: Int | Unit = 21 println(a.isDefined) println(a.isEmpty) println(a.map(_ + 1))
Doesn't seem possible w/ Null union unfortunately.
scalaJSLinkerConfig.withBatchMode(true). What does this do/change
github.com/objektwerks/scalajs.pool. Some time ago, js-opt.js and shared-opt.js files were generated from a fullOptJS. That has changed with 1.5 and the module linking feature.