Skip to content

Repository files navigation

Lingui Rust Tooling

Rust tooling for Lingui i18n - an SWC plugin for the macro transform and a native Node.js addon for message extraction.

CI - Rust codecov GitHub contributors GitHub

Overview

This monorepo hosts the Rust-based tooling for Lingui. It ships two npm packages built from the same Rust crates:

  • @lingui/swc-plugin - an SWC plugin (WebAssembly) that transforms @lingui/core/macro and @lingui/react/macro calls into optimized i18n runtime code at build time. A faster, Rust-powered alternative to the Babel macro that runs inside SWC, Next.js, and Vite build pipelines.
  • @lingui/native-tools - a native Node.js addon (NAPI-RS) with a Rust message extractor for lingui extract and a standalone macro transformer for custom build pipelines.

Packages

npm npm CI

SWC macro transform plugin for Lingui. Transforms @lingui/macro and @lingui/react/macro calls into optimized i18n runtime code. Compiles to WebAssembly (wasm32-wasip1).

Documentation

npm npm CI

Native Node.js addon (NAPI-RS) with a Rust message extractor and a standalone macro transformer. Provides createSwcExtractor() for lingui extract and transform() for custom build pipelines that only need the Lingui macro step. Prebuilt binaries are published for macOS, Linux (glibc and musl), Windows, and Android.

Note @lingui/native-tools is pre-1.0. The API may change between minor versions until the 1.0 release.

Documentation

Contributing

Contributions are welcome! See CONTRIBUTING.md for instructions on setting up Rust, building the WASM plugin, running tests, and submitting pull requests.

License

The project is licensed under the MIT license.

Releases

Used by

Contributors

Languages