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)
sbt.version = 1.2.8
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
import sbtcrossproject.CrossPlugin.autoImport.crossProject val sharedSettings = Seq( name := "arithmetic-interpreter", version := "0.1.0-SNAPSHOT", libraryDependencies += "com.lihaoyi" %%% "fastparse" % "2.1.3" ) lazy val arithmeticInterpreter = crossProject(JSPlatform, JVMPlatform) .in(file(".")) .settings(sharedSettings)
When I do a
publishLocal and try to run it I'm running into a
ClassNotFoundException, so somehow it's not getting the scalalib and packaging together with my jar, any idea why?
Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/mutable/ArrayOps$ofRef at Main$.main(Main.scala:6) at Main.main(Main.scala) Caused by: java.lang.ClassNotFoundException: scala.collection.mutable.ArrayOps$ofRef at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more
Tried to call using
java -cp <scalalib> -jar <myjar> and
java -jar <myjar>
trait NotificationOptions extends js.Objectwhere you set the members that you can set being
Tthe type you need. For example
val title: js.UndefOr[String] = js.undefined.
def setDefaults(options: NotificationOptions): Unit = js.native. And you can feed the argument by instantiated new instances of
applyin the companion object is not a bad idea in general)
Alot of js doc is subtly wrong about what they accept/don't accept.
@inlineannotation. In Scala, value classes have certain rules for which usages will trigger the need to instantiate such classes (e.g. trying to use the value where an instance of a parent trait is expected). Are there similar rules described anywhere for Scala.js
@inlineclasses? Are those rules fairly stable over time? We're considering an optimization in our library that relies on
@inline class-es not being instantiated in a certain usage pattern. But that usage will be up to other developers so I'm wondering how fragile this optimization would be.
I'm new to scalajs, and I'd like to understand how JS modules are supported. In my project I have following error:
LinkingException: There were module imports without fallback to global variables, but module support is disabled. To enable module support, set `scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))`.
what is the typical workflow here? configuring scala-js to output one single js file, including all JS modules? or use browser friendly modules, like requirejs? (and I'm asking for the development stage, the production build is another story)