{"id":24960,"library":"babel-plugin-riza","title":"babel-plugin-riza","description":"A Babel plugin for transpiling JSX syntax in Riza applications. Version 2.1.2 is the current stable release. It provides JSX compilation specifically tailored for the Riza framework, with support for server components and client components. Key differentiators include optimized output for Riza's virtual DOM and built-in support for automatic runtime detection.","status":"active","version":"2.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/rsthn/riza","tags":["javascript"],"install":[{"cmd":"npm install babel-plugin-riza","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-riza","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-riza","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Requires Babel core to function as a plugin","package":"@babel/core","optional":false},{"reason":"Required to parse JSX syntax","package":"@babel/plugin-syntax-jsx","optional":false}],"imports":[{"note":"CommonJS is the default; ESM import requires a bundler that supports ESM. In Babel config, use string 'babel-plugin-riza'.","wrong":"import rizaPlugin from 'babel-plugin-riza'","symbol":"default","correct":"const rizaPlugin = require('babel-plugin-riza')"},{"note":"The plugin exports a function directly; named export 'rizaPlugin' does not exist.","wrong":"const { rizaPlugin } = require('babel-plugin-riza')","symbol":"rizaPlugin","correct":"const rizaPlugin = require('babel-plugin-riza').default || require('babel-plugin-riza')"},{"note":"PluginOptions is a TypeScript type, not a runtime export. Use import type.","wrong":"const { PluginOptions } = require('babel-plugin-riza')","symbol":"type PluginOptions","correct":"import type { PluginOptions } from 'babel-plugin-riza'"}],"quickstart":{"code":"// .babelrc\n{\n  \"plugins\": [\n    [\n      \"babel-plugin-riza\",\n      {\n        \"target\": \"server\",\n        \"throwIfNamespace\": false\n      }\n    ]\n  ]\n}\n\n// or programmatically\nconst babel = require('@babel/core');\nbabel.transformSync(code, {\n  plugins: [\n    ['babel-plugin-riza', { target: 'client' }]\n  ]\n});","lang":"javascript","description":"Shows how to configure the plugin in .babelrc and use it programmatically with Babel."},"warnings":[{"fix":"Use 'target' instead of 'runtime' in plugin options.","message":"Plugin options have changed between versions 1.x and 2.x. The 'runtime' option was renamed to 'target'.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Remove runtime option or set to 'automatic'. Use React 17+ style JSX transform.","message":"Version 2.x no longer supports the 'classic' runtime. Only 'automatic' runtime is supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set namespace validation via Babel's @babel/plugin-transform-react-jsx instead.","message":"The option 'throwIfNamespace' is deprecated and will be removed in version 3.x.","severity":"deprecated","affected_versions":">=2.1.0"},{"fix":"Ensure 'babel-plugin-riza' is the first in the plugins array.","message":"Plugin must be listed before other JSX plugins to work correctly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to Babel 7 or later.","cause":"Plugin is incompatible with Babel 6 or lower.","error":"Error: Requires Babel 7 or higher"},{"fix":"Run npm install babel-plugin-riza@latest","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'babel-plugin-riza'"},{"fix":"Use require('babel-plugin-riza') or module.exports = require('babel-plugin-riza') in config.","cause":"Incorrect import style; plugin is CommonJS with default export.","error":"TypeError: rizaPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}