scala icon indicating copy to clipboard operation
scala copied to clipboard

valueOf in scala.js

Open cquiroz opened this issue 8 years ago • 3 comments

I'd like to use scala.Predef.valueOf in scala.js but it is not present on their scala.Predef since it follows the LB compiler

Would it be possible to have another implementation of valueOf as a library perhaps?

/cc @sjrd

cquiroz avatar Aug 09 '17 22:08 cquiroz

In general, any addition to the standard library in TLS would refuse to work with Scala.js out of the box. That's simply because scalajs-library.jar is built from the sources of LBS. IMO, if TLS starts having additional methods/classes in the standard library, and wants to support Scala.js, someone needs to build and publish a tls-scalajs-library.jar or whatever it's called, built with the Scala.js compiler from the sources of TLS' standard library.

sjrd avatar Aug 10 '17 08:08 sjrd

@sjrd would you be willing to collaborate on something along those lines?

milessabin avatar Oct 23 '17 13:10 milessabin

I can give some guidance if someone wants to setup the necessary build. Probably the easiest way to do so is to copy the parts of the Scala.js build involved in making up the scalalib subproject, and make it use the Typelevel sources. Then it should probably merge the content of the official scalajs-library.jar with the .sjsir files produced by that alternative scalalib, to make tls-scalajs-library.jar. Alternatively, also replicate the parts of the subprojects javalib, javalanglib, libraryaux and library to build it all from scratch.

sjrd avatar Oct 23 '17 14:10 sjrd