Skip to content

Conversation

@jlukic
Copy link

@jlukic jlukic commented Jun 12, 2025

This modifies Oxide to use helpers for parallel processing that allow Oxide to compile to unknown-unknown.

This lets Oxide work in the browser without dealing with the rabbit hole of permissions around using SharedArrayBuffer which include custom HTTP header requirements like Cross-Origin-Embedder-Policy and Cross-Origin-Opener-Policy

This is used in tailwindcss-iso and you can see the wasm in use in Semantic Playground here

#11610

@jlukic jlukic requested a review from a team as a code owner June 12, 2025 00:29
@thecrypticace thecrypticace self-assigned this Jun 12, 2025
@thecrypticace
Copy link
Contributor

I'm planning on taking a look at this soon btw. One thing I definitely want to figure out is a way to unify the Node + WASM APIs (so like no separate WasmChangedContent or WasmScanner types and what not) so there's less duplication if I can.

@thecrypticace
Copy link
Contributor

Reminder for me to investigate soon: NAPI-RS v3 is out now. There's a chance things can be simplified with that re: WASM

@jlukic
Copy link
Author

jlukic commented Jul 17, 2025

Really good point it seems like that would make everything a lot simpler

https://napi.rs/blog/announce-v3

WebAssembly is the biggest update this time. In V3, you can compile your project into WebAssembly with almost no code changes. If the compilation target is wasm32-wasip1-threads or higher, you can directly run code that uses Rust features like std::thread and tokio in the browser without any additional modifications.

@attilah
Copy link

attilah commented Nov 7, 2025

@thecrypticace @jlukic it would be nice to have beside NAPI-RS a C FFI interface (if it's not there yet) for .NET C# (and other) consumption as well.

@RobinMalfait
Copy link
Member

@attilah what would be your use case in the .NET C# world?

Tailwind CSS is a TypeScript project it is not entirely written in Rust.
The only place we use Rust (and NAPI-RS) is to traverse the file system and extract classes from your source files. This part is a separate package (@tailwindcss/oxide) and used by @tailwindcss/vite, @tailwindcss/postcss and @tailwindcss/cli.

@attilah
Copy link

attilah commented Nov 8, 2025

@RobinMalfait I am aware, the use case is make tailwind compiler available for Blazor WASM, Blazor Server and "regular" .NET server side as well. After that you can build anything on it, developer tooling, WYSIWYG editor similarly what @jlukic posted as an example, but with Blazor.

I actually created the C FFI interface Yesterday and will try to create a PR for it during the weekend.

@attilah
Copy link

attilah commented Nov 8, 2025

@thecrypticace I tried to have a stab at unifying the types between node and wasm as you requested, please check it here it is based on top of this PR, so @jlukic please chime in.

The reason for this is that if I create a C FFI binding you'd probably expect the same to share types as much as possible.

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.

4 participants