Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Scala.js / Scala Native on the server #1743

Open
kubukoz opened this issue May 31, 2023 · 6 comments
Open

Supporting Scala.js / Scala Native on the server #1743

kubukoz opened this issue May 31, 2023 · 6 comments
Labels
build Build and CI tasks server Issue related to caliban server

Comments

@kubukoz
Copy link
Contributor

kubukoz commented May 31, 2023

Hi! I'm working on the Smithy4s interop for Caliban on the server, in which you could derive a Schema for a Smithy service.

This works fine on the JVM, but Smithy4s supports the two other platforms as well (Native only on Scala 3, though), and I would love to get at least some of that working with Caliban. This would clearly require Caliban to cross-compile as well.

I see that there's Scala.js in the build already, but it seems to be limited to the laminext and client modules.

As far as blockers/difficulties go, I'm only aware of:

  • Timestamp types which don't have a portable implementation
  • ???

If there's anything else you know of, such as any required dependencies that aren't being cross-published, let me know please! I'm happy to get the ball rolling on adding the build axes and getting the shared part of the server to cross-publish. Specifically I'm interested in caliban-cats.

@ghostdogpr
Copy link
Owner

ghostdogpr commented May 31, 2023

We had Scala.js cross-compiling for the server a long time ago but dropped it because it was annoying dependency-wise and there was nobody using it.

What would be the use case? None of the http libraries behind the adapters support Scala.js nor Scala Native AFAIK.

@kubukoz
Copy link
Contributor Author

kubukoz commented May 31, 2023

Http4s works on both of these platforms :)

@ghostdogpr
Copy link
Owner

Oh I see, I was looking at the weird versions here https://mvnrepository.com/artifact/org.http4s/http4s-dsl

@ghostdogpr
Copy link
Owner

The issues I see for the core module only:

  • magnolia: we're still using the old version, the new one by softwaremill supports Scala.js and Native, hopefully it doesn't break anything
  • play-json only supports Native and Scala.js on Scala 3 in a RC version
  • zio-query and zio-json don't support Scala Native

@ghostdogpr ghostdogpr added build Build and CI tasks server Issue related to caliban server labels Jun 1, 2023
@ghostdogpr
Copy link
Owner

Since my previous message, we switched to the latest magnolia and there's a version of play-json for Scala.js. That means we should be able to support Scala.js easily now

@ghostdogpr
Copy link
Owner

For Scala native, i see zio-Json supports it now so the only blocker might be zio-query which is probably easy to port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build and CI tasks server Issue related to caliban server
Projects
None yet
Development

No branches or pull requests

2 participants