Hacker News new | ask | show | jobs
by spir 2396 days ago
I recently learned that Scala.js doesn't yet support generating TypeScript *.d.ts type definitions. I intend to open a Gitcoin bounty to get this work done.

Have you had any success using Scala.js-generated JavaScript in TypeScript projects?

I'm quite interested in a full stack of create-react-app + TypeScript + graphQL + front end libraries written in Scala + back end services written in Scala.

2 comments

In general I'd advise against using Scala.js for libraries. The Scala.js runtime is pretty heavy, and Scala's and TypeScript's type systems are different enough that it tends to be difficult to design an API that feels native in both.

Have you considered ScalaJS-React[0] or Outwatch[1] instead?

[0]: https://github.com/japgolly/scalajs-react

[1]: https://outwatch.github.io/?lang=scala

Why GraphQL? Why not simply RPC?

E.g. for JS there is https://github.com/reframejs/wildcard-api. Is there something like that in Scala?