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 experimental @tailwindcss/oxide-wasm32-wasi #17558

Merged
merged 13 commits into from
Apr 11, 2025
Merged

Add experimental @tailwindcss/oxide-wasm32-wasi #17558

merged 13 commits into from
Apr 11, 2025

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Apr 4, 2025

Closes #13133

This PR adds an a new Oxide target for wasm32-wasip1-threads: @tailwindcss/oxide-wasm32-wasi. The goal of this is to enable more environments to run Oxide, including (but not limited to) StackBlitz.

We're making use of napi-rs's upcoming v3 features to simplify the setup here, meaning napi-rs will configure the WASM target and create an npm package that works across Node and browser environments.

MacOS AArch64 issues

While setting up an integration test for the new WASM target, I ran into an issue where FS reads where not terminating on macOS. After some research I found this to be a limitation of the Node.js container interface right now, see: nodejs/node#47193

Windows issues

We also found that the Node.js wasi container does not properly support Windows: nodejs/uvwasi#11

For now we, it's probably best for MacOS AArch64 users and Windows users to use the native modules instead.

Test plan

The @tailwindcss/oxide-wasm32-wasi npm package can be built locally via pnpm build and then run with the Oxide API. A usage example can be taken from the newly added integration test.

Furthermore this was tested to work as a polyfill on StackBlitz: https://stackblitz.com/edit/vitejs-vite-uks3gt5p

[ci-all]

@RobinMalfait

This comment was marked as resolved.

@philipp-spiess philipp-spiess changed the title WIP Add @tailwindcss/oxide-wasm Apr 4, 2025
@philipp-spiess philipp-spiess changed the title Add @tailwindcss/oxide-wasm Add @tailwindcss/oxide-wasm32-wasi Apr 4, 2025
@philipp-spiess philipp-spiess force-pushed the feat/wasm branch 2 times, most recently from bf66895 to 478ce9e Compare April 9, 2025 13:49
@philipp-spiess philipp-spiess force-pushed the feat/wasm branch 15 times, most recently from 32447e6 to 387aef3 Compare April 10, 2025 14:32
@philipp-spiess philipp-spiess force-pushed the feat/wasm branch 3 times, most recently from 601e3fa to 3160eb4 Compare April 10, 2025 15:12
@philipp-spiess philipp-spiess changed the title Add @tailwindcss/oxide-wasm32-wasi Add experimental @tailwindcss/oxide-wasm32-wasi Apr 11, 2025
@philipp-spiess philipp-spiess marked this pull request as ready for review April 11, 2025 13:45
@philipp-spiess philipp-spiess requested a review from a team as a code owner April 11, 2025 13:45
Copy link
Contributor

@thecrypticace thecrypticace left a comment

Choose a reason for hiding this comment

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

this looks good to me. Would be good to have @RobinMalfait look at the CI workflow changes

@@ -67,12 +67,20 @@ jobs:
uses: actions/cache@v4
with:
path: |
./target/
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove these since 1) they are not part of the hash and 2) are already cached in the cache-cargo action before this one.

Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

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

Nothing obvious that stands out. All the newly added files all exist on disk so I think it's a publish and see situation.

@philipp-spiess philipp-spiess merged commit 83ce4c0 into main Apr 11, 2025
20 of 21 checks passed
@philipp-spiess philipp-spiess deleted the feat/wasm branch April 11, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4 alpha does not work on Stackblitz
3 participants