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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Add @tailwindcss/oxide-wasm32-wasi #17558

wants to merge 6 commits into from

Conversation

philipp-spiess
Copy link
Member

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

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 napi interface right now, see: nodejs/node#47193

For now we, it's probably best for MacOS AArch64 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 5 times, most recently from 5a9f396 to fdb179b Compare April 9, 2025 15:44
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.

2 participants