browser-runtime-octane
v0.1.0
Published
Octane JSX, TSX, and TSRX compiler and renderer adapter for browser-module-runtime.
Maintainers
Readme
browser-runtime-octane
Octane compiler and renderer plugin for browser-module-runtime.
Install
npm install [email protected] [email protected] [email protected]Usage
import {createRuntime} from 'browser-module-runtime';
import {octane} from 'browser-runtime-octane';
const runtime = createRuntime({plugins:[octane({version:'0.2.3'})]});
runtime.define('/Counter.tsrx', `
import {useState} from 'octane';
export default function Counter() @{
const [count,setCount]=useState(0);
<button onClick={() => setCount(count+1)}>Count: {count}</button>
}
`, {type:'octane'});
const handle = await runtime.mount({module:'/Counter.tsrx',target:'#app'});
// Later: await handle.dispose(); await runtime.dispose();type="octane" delegates JSX, TSX, and TSRX detection to Octane's browser compiler (octane/compiler). Rendering uses octane.createRoot; the returned mount handle owns cleanup. An exact Octane version contributes its package-root mapping so generated octane/internal/* imports resolve through the runtime linker.
