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

babel-preset-exodra

v0.1.1

Published

Babel preset for Exodra: JSX + TypeScript + directives, ready for Jest/babel-jest

Readme

babel-preset-exodra

Babel preset that compiles Exodra JSX in one line — JSX syntax (with namespaced bind: / cache: directives), the @exodra/babel-plugin-jsx transform, and @babel/preset-typescript for .ts/.tsx.

Installation

npm install --save-dev babel-preset-exodra

Usage

// babel.config.js
module.exports = {
  presets: ['exodra'],
};

Options

// babel.config.js
module.exports = {
  presets: [
    ['exodra', {
      importSource: '@exodra/core', // where auto-imported h/text come from
      hoistStatic: true,            // compile-time clone-cache for static subtrees
      typescript: true,             // include preset-typescript (turn off if TS is handled elsewhere)
    }],
  ],
};

Testing with Jest

This preset is what makes Exodra component tests runnable under Jest. Jest can compile Exodra JSX — through babel-jest (Jest's default Babel transform), which picks up babel.config.js automatically. ts-jest and @swc/jest do not run Babel plugins and so cannot compile Exodra JSX.

// babel.config.js
module.exports = { presets: ['exodra'] };

That is all Jest needs — component tests then compile the same way Vite compiles them.

If Jest reports an unexpected token on <, or "namespace tags are not supported" on bind:value, you are almost certainly on ts-jest / @swc/jest. Switch the transform to babel-jest and add the preset above.

Other bundlers & runners

Exodra JSX is compiled by a Babel plugin, so any tool that can run Babel can compile it — via this preset. Tools that do not run Babel plugins (esbuild, SWC, Bun's native transpiler) need a dedicated plugin that hands the file to Babel; those wrap this same preset, so every path compiles identically.

| Tool | How | Package | | --- | --- | --- | | Vite / Vitest | plugin | @exodra/vite-plugin | | Jest | babel-jest + this preset | babel-preset-exodra | | esbuild / tsup | plugin | esbuild-plugin-exodra | | Rollup | plugin | rollup-plugin-exodra | | Bun | plugin | bun-plugin-exodra | | webpack | babel-loader + this preset | (no package — see below) | | Parcel | .babelrc + this preset | (no package — see below) | | SWC / Next.js / swc-loader | native Wasm plugin (full parity) | swc-plugin-exodra |

webpack

// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.[jt]sx$/,
        use: {
          loader: 'babel-loader',
          options: { presets: ['exodra'] },
        },
      },
    ],
  },
  resolve: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
};

Parcel

Parcel reads Babel config automatically:

// .babelrc
{ "presets": ["exodra"] }

SWC / Next.js (default), @swc/jest

SWC does not run Babel plugins, so this preset cannot drive it. Use the native Wasm plugin swc-plugin-exodra instead — a full-parity port (buckets, children, bind:/cache: directives, fragments, static hoisting, shadow-safe imports, strict errors).

Programmatic runner

Every bundler plugin above calls one shared function, exported here, so there is a single copy of the pipeline and its invocation:

import { transformExodraJsx } from 'babel-preset-exodra';

const result = await transformExodraJsx(sourceCode, '/abs/path/File.tsx');
// -> { code, map } | null   (typescript defaults on for .tsx, off otherwise)