Bring your React app. Keep shipping while you move.
Point react at @pyreon/react-compat and your hooks, deps arrays and all, run on Pyreon's engine. Then convert one component at a time, with a codemod for the mechanical parts, until the compat layer has nothing left to do.
npm install @pyreon/react-compat From React to Pyreon, without a rewrite.
Install the compat layer
The React layer plus the Pyreon runtime it sits on. The Vite plugin needs Vite 8. On the published packages
vite devrenders a blank page (the compat JSX runtime ships nojsxDEV);vite buildworks, and the fix is on main for the next release.npm install @pyreon/react-compat @pyreon/core @pyreon/reactivity @pyreon/runtime-dom npm install -D @pyreon/vite-pluginChange two config files
Swap
@vitejs/plugin-reactfor the Pyreon plugin in compat mode. It resolvesreact,react-dom,react-dom/clientand the JSX runtime to the compat package, so your import lines stay as they are, and it renamesclassNameandhtmlForon the way through.vite.config.ts + tsconfig.json// vite.config.ts import { defineConfig } from 'vite' import pyreon from '@pyreon/vite-plugin' export default defineConfig({ plugins: [pyreon({ compat: 'react' })], }) // tsconfig.json { "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "@pyreon/react-compat" } }Keep shipping
Function components behave like React:
useStatereturns the value, the body re-runs, deps arrays are honoured. Before you deploy, check the four known gaps: class components are stubs, transitions run synchronously, a child's state resets when its parent re-renders (lift that state up), and libraries that reach into React internals will not run.Convert one component at a time
Run the codemod on a file, finish what it reports, and wrap the converted component in
nativeCompat()so it runs in Pyreon's setup frame. The compat build skips Pyreon's compiler pass, so write reactive text as an arrow ({() => …}) until step 5.Likes.tsximport { nativeCompat } from '@pyreon/core' import { signal } from '@pyreon/reactivity' // A converted component inside a compat app: it runs once. export const Likes = nativeCompat(function Likes() { const likes = signal(0) return ( <button onClick={() => likes.update((n) => n + 1)}> {() => `${likes()} likes`} </button> ) })Switch the compiler on
When no React-style component is left, drop
compatfrom the plugin and setjsxImportSourceto@pyreon/core. The compiler now makes{likes()}reactive without the arrow, and the app is plain Pyreon. Moving to Zero's file router is a separate step you can take later.vite.config.ts// vite.config.ts import { defineConfig } from 'vite' import pyreon from '@pyreon/vite-plugin' export default defineConfig({ plugins: [pyreon()], })
Tools for the mechanical part.
migrate_react
@pyreon/mcpYour AI assistant hands it a React file and gets back useState turned into signal, useMemo into computed, useEffect into effect, useCallback unwrapped to a plain function, className and htmlFor renamed, onChange on inputs turned into onInput, the imports swapped, plus the list of changes it made and the findings it could not fix.
Add the server to .mcp.json: { "mcpServers": { "pyreon": { "command": "bunx", "args": ["@pyreon/mcp"] } } }
A first pass that does not run as is: setter calls such as setCount(…) stay dangling, value reads are not turned into calls, a useRef becomes a signal so its .current uses break, and a memo() wrapper can stay in place although the change list says it was removed. .map() lists are flagged for <For> but not rewritten; class components and React-specific libraries are not converted. TypeScript flags the dangling setters; review the diff.
pyreon check --fix
@pyreon/cliThe same detectors in the terminal. It scans your git-changed files (or the paths you pass), prints each finding with its fix, writes the codemod's first-pass rewrites with --fix, and exits non-zero on any finding, so it works as a pre-commit gate.
pyreon check src/components/Search.tsx --fix
Applies the same codemod as migrate_react, with the same gaps, and skips a file whose only React habit is a .map() list, an onChange or dangerouslySetInnerHTML.
--compat scaffold
@pyreon/create-zeroStarting a new app next to the old one? The scaffold wires the compat layer into a Zero app for React, Vue, Solid or Preact.
npm create @pyreon/zero@latest my-app -- --compat react
The scaffold offers react, vue, solid and preact; Svelte compat is set up by hand through the Vite plugin.
No compat layer, still a guide.
Angular →
Angular's signals (v16+) are almost the same API: signal, computed, effect, .set, .update. The guide maps class components, templates and dependency injection to function components, JSX and context. There is no Angular compat layer; this is a rewrite with a familiar reactive core.
React Native and Expo →
A concept map from View, Text, Pressable, TextInput and FlatList to Pyreon's primitives, Expo Router to @pyreon/router, and the expo-* modules to Pyreon hooks, plus what does not carry over. No compat layer: screens are rebuilt with @pyreon/primitives. The native targets are experimental.
Ship on Pyreon this week. Finish the move when it pays.
npm install @pyreon/react-compat