Reputation: 64207
I am developing a pure Scala application (no Java libraries used) and would like to be able to port it to Scala.JS. What should I keep in mind while writing the Scala code to make sure it will be as easy to convert to Scala.JS as possible?
Upvotes: 0
Views: 168
Reputation: 14842
scala-js.org contains a complete list of semantic differences. If
Your library should cross compile just fine.
Note that the last bullet unfortunately applies transitively to the Scala standard library itself (or any cross compiled Scala library). So the only really safe choice is to cross compile and test your library.
Upvotes: 1
Reputation: 14825
One important point that I can think of is
No reflection
Don't use any methods or functions which depend on refection directly or indirectly
Because reflection does not translate well to js world
Upvotes: 0