@reactre/preact weekly downloads statistics
By reactre (2 listings) · npm · Webpack plugins
Preact's API and semantics on reactre's compiled templates: smaller and faster than Preact, with a JSX compiler.
@reactre/preact has 26 recorded weekly downloads on npm, a decrease of 96.2% over the past 30 days, ranking #2941 of 3,247 tracked listings.
About @reactre/preact
@reactre/preact
Preact's API and behaviour, with a JSX compiler that turns your HTML element trees into templates. @reactre/preact/core is preact plus preact/hooks, and @reactre/preact/compat is preact/compat: the renderer is Preact 11.1.0's, ported, so an app sees what it sees on Preact. That covers DOM properties and attributes, native events, debounced rendering, error boundaries, keyed children and hydration.
bun add @reactre/preact
Modules
| Module | Stands in for | What it is |
|---|---|---|
@reactre/preact/core | preact, preact/hooks | The renderer, components, context, refs and hooks |
@reactre/preact/compat | preact/compat, react | Preact's React layer: React's prop names, memo, forwardRef, Suspense, lazy |
@reactre/preact/jsx-runtime | preact/jsx-runtime | The automatic JSX runtime |
@reactre/preact/compiler | (none) | A Bun plugin that compiles JSX element trees into templates |
@reactre/preact/plugin | (none) | The same compiler for Vite, Rollup, Rolldown, esbuild, webpack and Rspack |
@reactre/preact/dom | (none) | The DOM-only build: templates and events, no components |
Alias the modules you use at build time. With Bun:
// build.ts
import { reactrePreactCompiler } from "@reactre/preact/compiler";
await Bun.build({
entrypoints: ["src/main.tsx"],
outdir: "dist",
minify: true,
plugins: [
// "react" for an app written against React (aliased to compat), "preact" for a Preact app.
reactrePreactCompiler({ source: "react" }),
{
name: "alias",
setup(build) {
build.onResolve({ filter: /^react\/jsx-(dev-)?runtime$/ }, () => ({
path: Bun.resolveSync("@reactre/preact/jsx-runtime", import.meta.dir),
}));
build.onResolve({ filter: /^react(-dom)?(\/client)?$/ }, () => ({
path: Bun.resolveSync("@reactre/preact/compat", import.meta.dir),
}));
},
},
],
});
With Vite, Rollup, Rolldown, esbuild, webpack or Rspack, @reactre/preact/plugin is the same compiler with the same options, and it resolves preact, preact/hooks, preact/compat, react, react-dom and their JSX runtimes itself, so no alias is needed:
// vite.config.ts
import { reactrePreact } from "@reactre/preact/plugin";
export default {
plugins: [reactrePreact.vite({ source: "react", off: ["@classes"] })],
};
reactrePreact.rollup, .rolldown, .esbuild, .webpack and .rspack are the others.
The compiler
The compiler is optional: without it, JSX renders through jsx() calls as on Preact.
With it, each tree of HTML elements becomes a template, built once and cloned per use. On each render only its dynamic parts are written:
- Props: a literal prop is set once on the template; any other prop is a hole, written with Preact's rules when its value changes.
- Children: static children are part of the template; other children are diffed by Preact's children diff.
A tree stays a jsx() call where its behaviour depends on more than attributes:
- form fields;
- custom elements;
ref,keyinside the tree, spread props;dangerouslySetInnerHTML;- an element with both
classandclassName.
A template renders what Preact renders for the same JSX, and has the same vnode shape for code that reads it: props, type and key, cloneElement, Children and toChildArray. When a template meets anything but its own kind (another element of its tag, server DOM to hydrate), both sides become plain vnodes over the same DOM, and Preact's element diff takes over.
No JSX, no build step
html writes the same elements as a tagged template, in plain JavaScript that runs straight in the browser, and never touches createElement:
import { html, render, useState } from "@reactre/preact/core";
function Counter({ start }) {
const [n, setN] = useState(start);
return html`<button class="counter" onClick=${() => setN(n + 1)}>Clicked ${n} times</button>`;
}
render(html`<main><h1>Hello</h1><${Counter} start=${0} /></main>`, document.body);
Each template is parsed once per call site, into the templates the compiler would make of the same JSX, so it renders what that JSX renders on Preact. Components go in a tag as a value, closed with />, </${Counter}> or <//>; ...${props} spreads props; text follows JSX's whitespace rules. HTML entities in text and quoted attributes are decoded, as JSX decodes them. @reactre/preact/compat exports html too, with React's prop names (className, onDoubleClick).
Strip out what you don't use
The hooks and features are separate modules, so an app bundles only those it imports. To be sure of that, switch APIs off with the compiler's off option:
reactrePreactCompiler({ source: "react", off: ["@classes", "useEffect", "useLayoutEffect"] });
```…
Description from the npm listing.
- reactre
- preact
- react
- compat
- jsx
- templates
- vite-plugin
- rollup-plugin
- rolldown-plugin
- esbuild-plugin
- webpack-plugin
- rspack-plugin
- unplugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (142)Similar npm Webpack plugins plugins
All 20 @reactre/preact alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@reactre/preact. First seen Nov 10, 2026; last successful collection Dec 6, 2026. See the methodology.