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

chore: publish WASM web package #224

Merged
merged 5 commits into from
Mar 5, 2025
Merged

Conversation

nunogois
Copy link
Member

@nunogois nunogois commented Mar 5, 2025

https://linear.app/unleash/issue/2-3335/create-a-publish-workflow-for-our-wasm-package

Adds the publish WASM workflow and cleans up a few things.

I wonder if we can get away with reusing our npm-release workflow. Is there a better way to test this than to just merge it and trying to publish a release?

@nunogois nunogois requested a review from sighphyre March 5, 2025 12:01
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah cool, LGTM

@@ -39,7 +39,7 @@ jobs:
- name: Build WASM
run: |
cd yggdrasilwasm
wasm-pack build --target nodejs
wasm-pack build --target web
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what this works for? That looks pure browser based but node is definitely a thing we need

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll find out in practice.

From https://rustwasm.github.io/docs/wasm-pack/commands/build.html

Outputs JS that can be natively imported as an ES module in a browser, but the WebAssembly must be manually instantiated and loaded.

You can read about the different targets here: https://rustwasm.github.io/docs/wasm-bindgen/reference/deployment.html

I believe it should work for both browsers and Node-like runtimes, as long as we don't do browser-specific things in our WASM, which I'm pretty sure we won't.

It already works in our Bun e2e tests, which don't run on a browser environment.

@nunogois nunogois merged commit 4cb3e9a into main Mar 5, 2025
3 checks passed
@nunogois nunogois deleted the chore-publish-wasm-web-package branch March 5, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants