-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
🧰 Available Options to Integrate TailwindCSS into a Go SDK
1. Wrap Tailwind CLI (Rust Binary) in Go
- How it works: Use
os/execin Go to run the officialtailwindcssbinary. - Pros:
- Easiest and quickest to implement.
- Always in sync with official Tailwind updates.
- No need to modify Tailwind’s source code.
- Cons:
- Requires bundling or downloading the binary.
- Relies on an external process, not fully embedded.
- Less portable in sandboxed or restricted environments.
2. FFI (Rust → Go) via cgo
- How it works: Expose Rust functions using
#[no_mangle] extern "C"and call them from Go usingcgo. - Pros:
- Runs completely in-process.
- Native performance.
- Can tightly couple with Go SDK logic.
- Cons:
- Requires extracting or rewriting parts of Tailwind in Rust (as the official implementation is CLI-oriented).
- More complex to set up and maintain (especially cross-platform builds).
- Rust <-> Go memory handling and safety can be tricky.
3. Re-implement Tailwind in Pure Go
- How it works: Fully translate Tailwind’s utility and JIT logic into Go.
- Pros:
- 100% native, no external binaries or toolchains.
- Maximum control and customization.
- Extremely portable (even in embedded or serverless contexts).
- Cons:
- Massive undertaking.
- Difficult to match full Tailwind feature parity.
- Easy to get out of sync with upstream Tailwind releases.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed