{"_id":"@aurumjs/rendering","name":"@aurumjs/rendering","dist-tags":{"latest":"0.10.2"},"versions":{"0.10.2":{"name":"@aurumjs/rendering","version":"0.10.2","description":"Renderer-independent component model and rendering primitives for Aurum","type":"module","main":"./prebuilt/esnext/index.js","types":"./prebuilt/esnext/index.d.ts","exports":{".":{"types":"./prebuilt/esnext/index.d.ts","import":"./prebuilt/esnext/index.js"}},"scripts":{"build":"tsc -p tsconfig.build.json","test":"tsc -p tsconfig.test.json --noEmit --declaration false --declarationMap false && vitest run","prepack":"npm run build"},"dependencies":{"@aurumjs/streams":"^0.10.0"},"devDependencies":{"vitest":"^4.0.16"},"license":"MIT","gitHead":"115fc28ffe30a71d85da8da4d0a6ef5aaf64319e","_id":"@aurumjs/rendering@0.10.2","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-FajcsFveoWRjLlgtY6yqwFhcc/T2Jwcw/0/woDg8JQYyfIr8dNwhBP2UdBEi+NpZgym7FlOqoKSHbesHXcQEgA==","shasum":"8563db440557121e2e4257c45523cbeb44ef0cdf","tarball":"https://registry.npmjs.org/@aurumjs/rendering/-/rendering-0.10.2.tgz","fileCount":51,"unpackedSize":143865,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF0iUw3P8tCOXQ3KOskxrmWjANMK45JAm7LtDN0adK+VAiEAuGWEhQrYm9Txznhxi7pvY+viOQKlwBzNsDTJB1kgI00="}]},"_npmUser":{"name":"cyberphoenix90","email":"Joao260690@gmail.com"},"directories":{},"maintainers":[{"name":"cyberphoenix90","email":"Joao260690@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rendering_0.10.2_1787913297083_0.3842317870670009"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-28T10:34:56.914Z","0.10.2":"2026-08-28T10:34:57.224Z","modified":"2026-08-28T10:34:57.451Z"},"maintainers":[{"name":"cyberphoenix90","email":"Joao260690@gmail.com"}],"description":"Renderer-independent component model and rendering primitives for Aurum","license":"MIT","readme":"# @aurumjs/rendering\n\nThe component model and renderer-facing primitives for Aurum. Its JSX factory accepts components but deliberately exposes no implicit intrinsic tags.\n\n`Renderable` recursively describes primitives, nested arrays, promises, scalar sources, collection sources, and element models. Component prerender results are generic, allowing renderer extensions to declare their native intermediate model without falling back to `any`. Browser node types and the DOM marker runtime live in `@aurumjs/html`, not this package.\n\n## Custom rendering hosts\n\n`renderToTree` evaluates Aurum components into a persistent, host-neutral `RenderTree`. Reactive values update that tree in place, collection entries retain identity across incremental mutations, and `onPatch` reports inserts, removals, moves, text changes, and property changes.\n\n```ts\nimport { renderToTree } from '@aurumjs/rendering';\n\nconst tree = renderToTree(application, { cancellationToken: lifetime });\ntree.onPatch.subscribe((patch) => terminalRenderer.apply(patch), lifetime);\n```\n\nExtensions that already expose host mutation primitives can implement `RendererHost<Node>` and use `renderToHost`. The core renderer owns component evaluation, reactive subscriptions, promises, and subtree disposal; the host only creates and mutates its native nodes.\n\nProperties remain host-neutral values. Renderer packages can provide `resolveProperty` to normalize concepts such as HTML classes and styles without introducing those semantics into the component renderer.\n\n## Component handles\n\nFor imperative APIs that need to return values, a component can explicitly expose a typed public contract. Handles are populated after attachment and cleared automatically on detach; ordinary state and one-way commands should continue to use streams.\n\n```tsx\ninterface EditorHandle {\n    focus(): void;\n    getSelection(): string;\n}\n\nconst editor = createComponentHandle<EditorHandle>();\n\nfunction Editor(props: { handle: ComponentHandle<EditorHandle> }, children, api: AurumComponentAPI) {\n    let input!: HTMLTextAreaElement;\n    api.expose(props.handle, {\n        focus: () => input.focus(),\n        getSelection: () => input.value\n    });\n    return <textarea onAttach={(node) => (input = node)} />;\n}\n\nconst editorAPI = await editor.awaitValue(cancellationToken);\neditorAPI.focus();\n```\n\n## Developer-tool graph\n\nIn an Aurum debug build, component evaluations are registered as inspectable\ninstances. Parent/child component edges and links from reactive sources to\nrender ranges are removed with the same cancellation scopes that own the\nrendered content. Production builds omit these renderer-level records while\nretaining the lightweight source graph supplied by `@aurumjs/streams`.\n\nCustom hosts built with `renderToTree` or `renderToHost` receive this behavior\nautomatically. A renderer with its own mutation loop can call\n`registerAurumRenderBinding` to associate a source with its native output.\n","readmeFilename":"README.md","_rev":"1-1b2cd1e22e347c6c2cc8018ba7a6e8bd"}