Registry / web-framework / oc-template-react-compiler

oc-template-react-compiler

JSON →
library11.0.0jsnpmunverified

Compiler for the React template in the OpenComponents (oc) ecosystem. Version 11.0.0 provides a Webpack-based build pipeline to transform React components into deployable OC packages. Primarily used internally by the oc-registry build process. It compiles JSX, handles asset bundling, and produces server-side renderable bundles. Releases follow the OpenComponents monorepo cadence. Differs from other React build tools by being tightly coupled to the OC registry workflow.

npm install oc-template-react-compiler
INSTALL
IMPORT
SIG · OC-TEMPLATE-REACT-
O
oc-template-react-compiler
web-frameworkjavascriptv11.0.0
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.

Compiler
import { Compiler } from 'oc-template-react-compiler'
Default export is the Compiler class
compile
import { compile } from 'oc-template-react-compiler'
import compile from 'oc-template-react-compiler'
compile is a named export, not default

Creates a compiler instance for a React component and runs the build.

import { Compiler } from 'oc-template-react-compiler'; const compiler = new Compiler({ component: { name: 'MyComponent', version: '1.0.0' }, path: './src', oc: {registries: {}} }); compiler.compile().then(result => console.log(result));
Debug
Known issues
breakingVersion 10.0.0 dropped support for React 16
fix
Upgrade to React 17 or 18, or pin to version 9.x if needed.
affects: >=10.0.0 <11.0.0
deprecatedThe `options` parameter in compiler constructor is deprecated
fix
Pass configuration directly as shown in quickstart.
affects: >=9.0.0
gotchaRequires webpack 5; webpack 4 will throw an error
fix
Ensure webpack 5 is installed as a devDependency.
affects: >=11.0.0
Errors
Common errors & fixes
Error: Cannot find module 'oc-template-react'
Missing peer dependency oc-template-react
fix
npm install oc-template-react
TypeError: compiler.compile is not a function
Importing wrong symbol (e.g., default import of Compiler class without instantiation)
fix
Use: import { Compiler } from 'oc-template-react-compiler'; const compiler = new Compiler(...);
Module parse failed: Unexpected token (1:0)
Webpack configuration missing JSX loader
fix
Ensure babel-loader with @babel/preset-react is in webpack config.
Upgrade
Version history
11.0.0latest on npm
Audit
Dependencies
oc-template-reactoptionalpeer dependency for template compatibility
webpackrequiredbundling React components
Agent activity
2 hits · last 30 days
node
2
Resources
oc-template-react-compiler — npm install oc-template-react-compiler · libregistry