statichyper happy ?
back

Rust, Again, and a Plugin

Three weeks ago I wrote that the Rust branch was going back on the shelf.

It did not stay there.

The Compiler Is Rust Now

Plumeria 19.5 replaced the compiler with a native module, and 19.7 made it stable. @plumeria/compiler is written in Rust with napi-rs, parses with oxc, and minifies with lightningcss built into the same binary. Scan, transform, compile and optimize all happen in one process, with no JavaScript between the steps.

Before, the work was split across @swc/core, @rust-gear/glob, zss-engine, postcss and lightningcss, each handing its output to the next through JavaScript. Now there is one crate.

The difference from the attempt I wrote about is not the language. It is that this time I ported the architecture, not just the functions:

  • The scan keeps what each file defined between calls and only re-reads files whose modification time changed, plus the files that depend on them.
  • The transform does its work on the native side and returns a string. No AST crosses the boundary.

Those were the two things the first port got wrong. Fixing them was the whole job.

One behavior suite runs every case against both the Rust compiler and the TypeScript implementation, which stays in @plumeria/utils as the reference. A change that alters a class name, a line of CSS or an error message on one side fails the same case on the other.

And the numbers, 19.4 (the last TypeScript release) against 19.7 on the same machine, with a 601-file fixture:

19.4 (TypeScript) 19.7 (Rust) change
cold scan 56.7ms 20.1ms −64.5%
touch the hub 22.2ms 11.1ms −50.3%
transform all components 498.9ms 339.7ms −31.9%
transform a component 2.98ms 1.92ms −35.5%

In a full next build of a small project the difference is within noise. I said it would be, and it is. The gain shows up as projects grow and during development, where every edit re-runs a scan and a transform.

It ships prebuilt for twelve targets, including wasm32-wasi, so it also runs in StackBlitz and other browser-based environments. Nobody needs a Rust toolchain to install it.

Plumeria Is a Claude Plugin

The other news is smaller in code and larger to me.

Plumeria now has a Claude plugin, reviewed and approved by Anthropic and listed in Anthropic's plugin directory. It works on claude.ai, in Cowork, and in Claude Code.

Its skill is generated from the AI.md documentation, so the rules Claude follows are the same rules the docs describe. When a task touches Plumeria styles, Claude loads it on its own. No more pasting a prompt.

Without a claude.ai account, it installs in Claude Code straight from the repository:

/plugin install plumeria --marketplace zss-in-js/plumeria

What I Am Writing Down

Last time I wrote that a rewrite only pays if you port the architecture. This time I did, and it paid, a little. That is the right size of win for a part of the build that was already a few hundred milliseconds.

The plugin is the part I did not plan for. A library is only as good as the code people write with it, and more and more of that code is written with an AI next to them. Making sure that AI knows the rules is part of the library now.