Registry / devops / oc-template-solid-compiler

oc-template-solid-compiler

JSON →
library4.0.0jsnpmunverified

Compiler for OpenComponents templates using SolidJS. Version 4.0.0 compiles components of type 'oc-template-solid'. Part of the OpenComponents ecosystem, it enables server-side rendering and client-side hydration of SolidJS components within the OC micro-frontend framework. Bundles SolidJS components for OC registries, supporting TypeScript types. Release cadence follows the vite-templates monorepo.

npm install oc-template-solid-compiler
INSTALL
IMPORT
SIG · OC-TEMPLATE-SOLID-
O
oc-template-solid-compiler
devopsjavascriptv4.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.

compile
import { compile } from 'oc-template-solid-compiler'
import compile from 'oc-template-solid-compiler'
Default export is not available; use named import.
getInfo
import { getInfo } from 'oc-template-solid-compiler'
const getInfo = require('oc-template-solid-compiler').getInfo
CJS require works but named export is preferred for tree-shaking.
render
import { render } from 'oc-template-solid-compiler'
import { render } from 'solid-js/web'
This package exports its own render function for OC templates, not from solid-js/web.

Compiles a SolidJS component source string into an OC-compatible component using the compile function.

import { compile } from 'oc-template-solid-compiler'; const source = ` import { createSignal } from 'solid-js'; export default function Counter() { const [count, setCount] = createSignal(0); return <button onClick={() => setCount(c => c + 1)}>{count()}</button>; } `; const result = compile(source, { template: { type: 'oc-template-solid', version: '4.0.0' } }); console.log(result.compiledComponent);
Debug
Known issues
breakingVersion 4.0.0 changes the compile function signature; options object now requires 'template.type' and 'template.version' explicitly.
fix
Update compile call to include template object.
affects: <=3.x
deprecatedThe 'render' function is deprecated in favor of using 'compile' output directly via the OC registry.
fix
Use compiled component from compile function.
affects: >=4.0.0
gotchaSolidJS reactive primitives must be imported from 'solid-js' even when using this compiler; the compiler does not auto-inject them.
fix
Ensure 'import { createSignal, createEffect } from 'solid-js'' is present in component source.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'solid-js'
solid-js not installed as a dependency.
fix
Run: npm install solid-js
TypeError: compile is not a function
Using default import instead of named import.
fix
Change import to: import { compile } from 'oc-template-solid-compiler'
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
solid-jsrequiredPeer dependency to compile SolidJS components
oc-template-solidrequiredTemplate type expected by OC registry
Agent activity
2 hits · last 30 days
node
2
Resources
oc-template-solid-compiler — npm install oc-template-solid-compiler · libregistry