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

Add Mill+Scala.js+WASM example (500USD Bounty) #3837

Closed
lihaoyi opened this issue Oct 24, 2024 · 9 comments
Closed

Add Mill+Scala.js+WASM example (500USD Bounty) #3837

lihaoyi opened this issue Oct 24, 2024 · 9 comments
Labels
Milestone

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Oct 24, 2024


From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


Scala.js now supports WebAssembly output (https://www.scala-js.org/news/2024/09/28/announcing-scalajs-1.17.0/). We should have an example doc-test in example/scalalib/web/ exercising the hello-world Scala.js webassembly dev workflow using Mill and include it in scalalib/web-examples.adoc as documentation.

@lihaoyi lihaoyi added the bounty label Oct 24, 2024
@Quafadas
Copy link
Contributor

To be honest, I'll likely have a look at this for my own curiosity in the coming days if no-one were to pick it up beforehand.

I think the key question, is whether the scope of the example includes a "live reload" solution?

@lihaoyi
Copy link
Member Author

lihaoyi commented Oct 24, 2024

I think the key question, is whether the scope of the example includes a "live reload" solution?

No, I just want a hello-world setup. Nothing fancy, just showing off that we can create a WASM output file and run it through some WASM interpreter or runtime

@Quafadas
Copy link
Contributor

Quafadas commented Oct 24, 2024

run it through some WASM interpreter or runtime

An up to date browser should suffice?

If so, then this looks superficially rather easy. Famous last words :-). I'll try and have a first peek tomorrow.

@lihaoyi
Copy link
Member Author

lihaoyi commented Oct 24, 2024

We don't have a browser in the example test suite, so you'll need to find some CLI wasm runtime to replace it

@Quafadas
Copy link
Contributor

We don't have a browser in the example test suite, so you'll need to find some CLI wasm runtime to replace it

Hmmm, right, I hear you. The other option could be to wheel in playwright? Doesn't need an answer now. I'll explore it.

@yadavshubham01
Copy link

hey @lihaoyi look quite interesting working on it

@lihaoyi
Copy link
Member Author

lihaoyi commented Oct 24, 2024

Go for it, bounties remain open until they are closed with a merged PR

@Quafadas
Copy link
Contributor

@yadavshubham01

i guess for the avoidance of conflict - it’s all yours for a few days :-).

@yadavshubham01
Copy link

hey @lihaoyi checkout this pr #3839

@Quafadas Quafadas mentioned this issue Nov 2, 2024
4 tasks
lihaoyi pushed a commit that referenced this issue Nov 3, 2024
Seeks to address #3837 

I have some outstanding questions;

1. As I'm altering the scalaJSModule public API, a double check here
would be welcomed. In particular, I've just called the module property
`emitWasm`. sjrd pretty clearly called the linker API
`withExperimentalUseWebAssembly`. However, if at some point it became
non-experimental, I assume that's a compatibility problem. Advice
welcomed - I've gone with the simplest name possible - `emitWasm`.
2. CI will fail, because node is < 22. The runnable test does work
locally for me. Does mill require, assume or otherwise advertise
compatibility with any particular node version? If not, I'll simply push
the node version forward in the GHA definitions. OItherwise, I'd welcome
advice - I'm not clear what the best way to manage the CI would be.

Those are the two points where I'd welcome advice. I think this is the
path to victory;

- [x] public API check? 
- [x] node version
- [x] documentation
- [x] CI green
@lihaoyi lihaoyi closed this as completed Nov 3, 2024
@lefou lefou added this to the 0.12.2 milestone Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants