Registry / web-framework / jquereact

jquereact

JSON →
library0.0.1jsnpmunverified

jQueReact is a pre-release jQuery-to-React transpiler that converts imperative jQuery code into declarative React/JSX components at build time. Version 0.0.1 is an early placeholder. It uses a Rust-based parser compiled to WebAssembly for fast AST processing, targeting Node.js and browser environments. Unlike alternatives like jquerty or manual migration, jQueReact aims for fully automatic transformation without runtime jQuery dependencies. Key differentiators include WASM performance, build-time transformation, and support for common jQuery methods (css, on, attr, append). Note that this is a very early release with limited feature completeness; complex patterns like animations and AJAX require manual refactoring.

npm install jquereact
INSTALL
IMPORT
SIG · JQUEREACT
J
jquereact
web-frameworkjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transpile_jquery_to_react
✓ import { transpile_jquery_to_react } from 'jquereact'
✗ const transpile = require('jquereact').transpile_jquery_to_react
ESM-only; CJS require is not supported as the package bundles a WASM loader.
init
✓ import init from 'jquereact'
✗ const init = require('jquereact').default
Default import is the WASM initializer; required before transpilation.
default (init)
✓ import init from 'jquereact'
✗ import { init } from 'jquereact'
init is a default export, not named.

Initializes WASM, transpiles a simple jQuery chain to a React component, and logs the result.

import init, { transpile_jquery_to_react } from 'jquereact'; async function run() { await init(); const jqCode = `$("div.container").css("color", "red").text("Hello!")`; const reactCode = transpile_jquery_to_react(jqCode); console.log(reactCode); } run(); // Expected output: function TransformedComponent() { return (<div className="container" style={{ color: "red" }}>Hello!</div>); }
Debug
Known issues
breakingjQueReact is pre-release v0.0.1 and the API is unstable. Expect many changes.
fix
Pin to exact version and test upgrades thoroughly.
affects: 0.0.1
gotchaThe package uses WebAssembly and requires async initialization before any transpilation. Calling transpile_jquery_to_react without init() will throw.
fix
Always call init() and await it before using transpile.
affects: >=0.0.1
deprecatedThis package is a placeholder and not actively maintained. It is not recommended for production use.
fix
Consider alternatives like jscodeshift for jQuery migration.
affects: >=0.0.1
breakingjQueReact only transforms a limited subset of jQuery methods. Complex patterns like animations, AJAX, or event namespaces will produce incorrect or empty output.
fix
Manually refactor such code before or after transpilation.
affects: >=0.0.1
gotchaThe transpiler does not handle jQuery plugins or custom extensions. Any code using third-party jQuery plugins will not be transformed.
fix
Replace plugins with React equivalents before transpilation.
affects: >=0.0.1
Errors
Common errors & fixes
Error: WebAssembly module not initialized. Call init() first.
Forgot to call init() before transpile_jquery_to_react.
fix
Add 'await init();' before using transpile function.
TypeError: transpile_jquery_to_react is not a function
Using wrong import (e.g., named import for init, or CJS require).
fix
Use default import for init: 'import init from "jquereact"' and named import for transpile: 'import { transpile_jquery_to_react } from "jquereact"'.
Uncaught (in promise) RuntimeError: memory access out of bounds
WebAssembly module compiled incorrectly or incompatible environment.
fix
Rebuild WASM with 'wasm-pack build --target bundler' and ensure Node.js >= 16 or modern browser.
jquereact: Transpiled output is empty string
Input jQuery code uses patterns not supported by the transpiler (e.g., animations, AJAX).
fix
Simplify the jQuery code to basic DOM manipulation (css, text, on, etc.) or manually refactor.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jquereact — npm install jquereact · libregistry