-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JS snippets for nodejs target #1525
Comments
IIRC, because node only has experimental support for modules that you have to enable with a special flag at startup, we don't support modules + js snippets on node unless you set the To properly support js snippets on node, we want to rewrite the exports to common js. |
@fitzgen nice, thank you for the response! so it's already on your roadmap? |
I would say we know what needs to be done, but have not prioritized it or come up with any target release dates or anything like that. If you want to talk about it next WG meeting, feel free to add to the schedule! |
What would help move this issue forward, at least for the |
The original RFC has a bit more information, but there's not much more other than "this needs implementing" for the node/no-modules targets. The "this" in terms of what needs to happen is specified in the RFC. |
I made https://github.com/yewstack/yew-wasm-pack-minimal and used |
Is there an update on snippets for nodejs? Does this require "only" implementation and if so, is there a plan for how to do so? Specifically, it seems like there hasn't been a decision on which JS parser to use. I could imagine implementing this, but it depends on how much time it would take. We currently want to use websocket support from
I assume, however, that a more universal solution would not be as straightforward. |
Initially nodejs target was not supported when js snippets were implemented. Is it the time to add support for nodejs?
There is already code like this in
js-sys
tests:#[wasm_bindgen(module = "tests/wasm/Iterator.js")]
https://github.com/rustwasm/wasm-bindgen/blob/master/crates/js-sys/tests/wasm/Iterator.rs#L5
And it somehow works. But when I tried to compile my own module, it compiled and failed in runtime because the
.js
file was not copied to thepkg
folder. How did you make the tests work?The text was updated successfully, but these errors were encountered: