This is a monorepo for an unofficial napi-rs
compiler and
an SWC plugin for
StyleX. Using SWC allows us to completely
ditch Babel and make StyleX faster.
Key Benefits:
This is specifically useful for Next.js projets as it allows us to use SWC Next.js Compiler.
This project is organized into several packages:
Core:
rs-compiler
-
Rust-based napi-rs
compiler for transforming StyleX code.Integration:
nextjs-plugin
-
A wrapper for Next.JS configuration
that integrates the StyleX napi-rs compiler into the Webpack processing pipeline.
webpack-plugin
-
A Webpack pluign
that integrates the StyleX
napi-rs compiler.
rollup-plugin
-
A Rollup plugin
that integrates the StyleX napi-rs
compiler.
unplugin
-
Plugin collection for various build tools that integrates the StyleX napi-rs
compiler.
Supported build tools and libraries:
Utilities:
stylex-shared
-
Shared Rust codebase for the StyleX RS compiler and SWC plugin.
path-resolver
-
Path handling and resolving utilities for the StyleX NAPI-RS / SWC plugin.
test-parser
-
Parser for StyleX repo Jest tests that
helps to understand last changes and keeps the project up to date
Internal Configurations:
eslint-config
-
Internal ESLint configuration
typescript-config
-
Internal
Typescript
configuration
[!WARNING] The packages below are deprecated as of version
0.3.0
and may be removed in the future. Please use the newer alternatives listed above.
Core:
swc-plugin
-
Unofficial SWC implementation of the native
StyleX plugin. The new alternative is
rs-compiler
Integration:
nextjs-swc-plugin
-
Wrapper for
Next.JS config
that inject the StyleX SWC plugin to webpack processing. The new alternative
is
nextjs-plugin