npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cassida/swc-plugin

v0.12.0

Published

Cassida SWC plugin (WASM). Detects cas() chains in JSX spreads and emits an Op[] IR for the @cassida/next-plugin loader to compile against @cassida/compiler. Phase 1 scaffold — no-op transform. Private until the transform is filled in.

Readme

@cassida/swc-plugin

SWC plugin (WASM) for Cassida. Detects cas() chains in JSX spreads, walks them into an Op[] IR, and emits the IR as a comment annotation that @cassida/next-plugin picks up and compiles against @cassida/compiler in a Node post-pass.

Status: Phase 1 scaffold. The current build ships a no-op transform. Subsequent releases will fill in the chain walker, modifier scopes, .set() / .unsafe() escape hatches, and JSX rewrite. See .claude/plans/swc-port-phase-1.md (local to maintainers) for the full design.

Why a SWC plugin

@cassida/parser (Babel-based) and @cassida/vite-plugin together give Vite users the full zero-runtime experience. Next.js's transform pipeline is SWC; injecting a Babel pass adds significant build cost. This package mirrors the Babel parser's behaviour in Rust so Next.js (Webpack + Turbopack) users get the same output without paying a Babel tax.

Architecture

The plugin emits an IR-as-comment, not a finished class name. A companion Node loader in @cassida/next-plugin reads the comment, calls compileOps() from @cassida/compiler, and substitutes the resulting cas-XXXXXXXX class. This keeps the compiler and hash function single-sourced in JS — Babel-parsed and SWC-parsed files always produce identical class names for the same chain.

Install

pnpm add -D @cassida/swc-plugin @cassida/next-plugin

Then in next.config.js:

import { withCassida } from '@cassida/next-plugin';

export default withCassida({ /* normal next config */ }, {
  /* cassida options */
});

You do not register @cassida/swc-plugin directly — withCassida() wires it into experimental.swcPlugins for you.

If you need the WASM path from JS (custom build setup, SWC CLI usage, esbuild, etc.):

// ESM
import { wasmPath } from '@cassida/swc-plugin/loader';

// CJS
const { wasmPath } = require('@cassida/swc-plugin/loader');

The package's main field also points at the WASM directly for SWC's built-in require.resolve() lookup of swcPlugins: [['@cassida/swc-plugin', ...]] shorthand.

Development

Requires Rust 1.91+ (rust-toolchain.toml at the repo root pins this) and the wasm32-wasip1 target.

pnpm build       # cargo build --release --target wasm32-wasip1
pnpm test        # cargo test (native target)
pnpm lint        # cargo clippy
pnpm fmt         # cargo fmt --check

License

MIT