{"id":26059,"library":"paperclip-compiler-base-jsx","title":"Paperclip Compiler Base JSX","description":"A JSX-specific base compiler for Paperclip, version 18.3.8. Paperclip is a design-to-code tool that compiles HTML templates into various frameworks. This package provides the core JSX compilation logic, intended for use within the Paperclip ecosystem. It is likely used internally by other Paperclip compilers and may not be directly consumed. Release cadence is tied to the Paperclip monorepo. Key differentiator: focuses on JSX output, handling HTML-to-JSX transformations.","status":"active","version":"18.3.8","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install paperclip-compiler-base-jsx","lang":"bash","label":"npm"},{"cmd":"yarn add paperclip-compiler-base-jsx","lang":"bash","label":"yarn"},{"cmd":"pnpm add paperclip-compiler-base-jsx","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no default export, named export only.","wrong":"const compileJSX = require('paperclip-compiler-base-jsx');","symbol":"compileJSX","correct":"import { compileJSX } from 'paperclip-compiler-base-jsx';"},{"note":"Not a default export; use named import.","wrong":"import createJSXCompiler from 'paperclip-compiler-base-jsx';","symbol":"createJSXCompiler","correct":"import { createJSXCompiler } from 'paperclip-compiler-base-jsx';"},{"note":"TypeScript type; case-sensitive.","wrong":"import { JsxCompilerOptions } from 'paperclip-compiler-base-jsx';","symbol":"JSXCompilerOptions","correct":"import { JSXCompilerOptions } from 'paperclip-compiler-base-jsx';"}],"quickstart":{"code":"import { compileJSX } from 'paperclip-compiler-base-jsx';\n\nconst html = '<div class=\"container\"><span>Hello</span></div>';\nconst result = compileJSX(html, { \n  module: 'esm',\n  jsxPragma: 'React.createElement'\n});\nconsole.log(result.code);\n// Expected output: \"React.createElement('div', { className: 'container' }, React.createElement('span', null, 'Hello'))\"","lang":"typescript","description":"Shows basic usage of compileJSX to transform HTML to JSX code."},"warnings":[{"fix":"Upgrade Node.js to 14+ or use paperclip-compiler-base-jsx@17.","message":"Version 18.x drops support for Node.js < 14.","severity":"breaking","affected_versions":">=18.0.0"},{"fix":"Change import from default to named: import { compileJSX } from 'paperclip-compiler-base-jsx'.","message":"Named export 'compileJSX' replaces former default export compileJSX() in v18.","severity":"breaking","affected_versions":">=18.0.0"},{"fix":"Replace 'pragma' with 'jsxPragma' in options object.","message":"Options property 'pragma' is deprecated in v18, use 'jsxPragma' instead.","severity":"deprecated","affected_versions":">=18.0.0"},{"fix":"Ensure HTML is valid XML/XHTML before passing to compileJSX.","message":"Compiler expects strict HTML compliance; self-closing tags must be closed (e.g., `<br />`).","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install paperclip-compiler-base-jsx@18.3.8`.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'paperclip-compiler-base-jsx'"},{"fix":"Use import { compileJSX } from 'paperclip-compiler-base-jsx'.","cause":"Incorrect import (default vs named) in version 18+.","error":"compileJSX is not a function"},{"fix":"Ensure input HTML is valid and call compileJSX with correct options.","cause":"Failed compilation due to malformed HTML.","error":"TypeError: Cannot destructure property 'code' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}