Repository navigation
Conversation
…iptors exist Renderable holes statically reached the whole runtime host descriptor renderer (deopt.ts host bodies, keyed host reconcile, adoption, records) and through it the generic setHostProps/attribute/style and controlled-form writers, so every .tsrx app shipped them even when nothing built a host element descriptor. - runtime/drivers.ts: HOST_DESCRIPTORS driver, named only by enableHostDescriptors, so bundler tree-shaking drops the renderer and oxc folds the guards. childSlot and deoptItemBody read it once, on host values. - deopt.ts: reconcileDeoptNode keeps text; reconcileDeoptHost takes host descriptors; text and host commit orders get their own ops. - Host factories install it (createHostElement, scoped element records, public factories); createElementFromConfig no longer does, and compiled JSX installs it per module only when a value-position tag may be a host string. - componentSlot's dynamic host tag renders through hostStringTagBody without the driver, so it no longer installs it. - Compiler: module function declarations that are never reassigned call componentSlotFunction instead of the generic dynamic-tag entry. - bundle-size: renderable-holes scenario gates that a pure .tsrx app drops the renderer; descriptor-children keeps it as the control. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 26, 2026 21:32
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 1fb58a5 | Commit Preview URL Branch Preview URL |
Oct 26 2026, 09:34 PM |
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
46 other measured values are unchanged. Public-import reachability bundles (bytes)
95 other measured values are unchanged. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 1fb58a5 | Commit Preview URL Branch Preview URL |
Oct 26 2026, 09:37 PM |
10 tasks done
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runtime host element descriptor renderer is now an optional capability. Only code that can build a host element descriptor installs it, so
.tsrxapps that never create one stop shipping it, along with the generic attribute, style and controlled-form writers it pulls in.Before this change, every renderable
{expr}hole statically reached all ofruntime/deopt.tsthroughchildSlot, and through itsetHostPropsinhost-props.tsand the select/radio/default-value paths informs.ts. Chrome coverage showed most apps used 1–2% ofdeopt.ts. Relay used 2% over its whole e2e suite and never created a descriptor.Changes
runtime/drivers.ts):HOST_DESCRIPTORSholds the host-only entry points (reconcile,body,adopts,landPair,unchanged,adoptQueue,placeUpgraded). OnlyenableHostDescriptorsnames them, so Rolldown and esbuild tree-shaking drop the implementations. Oxc also folds the guards. The previousDESCRIPTOR_HOST_PROPSgate dropped onlysetHostProps, and only under oxc.childSlotanddeoptItemBodyread the driver once, after reading the element type:typeof elementType === 'string' && HOST_DESCRIPTORS ? HOST_DESCRIPTORS : null. That read happens only on host-descriptor values. Reading the type first resolves a deferred JSX value, whose factory installs the driver. Arrays, iterables, Fragments, component descriptors, text and render functions keep the shared list path indeopt.ts.deopt.tssplit by function, not by file:reconcileDeoptNodekeeps text and empties, and the newreconcileDeoptHosttakes host descriptors.reconcileDeoptChildrendispatches inline (typeof child === 'object' && isHostDescriptor(child)), so call counts don't change. Text and host commit orders get their own ops (applyDeoptText,applyDeoptOrder). Host-only code now callssetHostPropsdirectly.createHostElement, scoped element records and the public factories install the driver;createElementFromConfigno longer does. Compiled JSX adds a module-levelenableHostDescriptors()only whendescriptorTagKindsays a value-position tag may resolve to a host string. So_frag$N, module functions and Fragments never install it.componentSlot's dynamic host tag renders throughhostStringTagBodywithout the driver, so it no longer installs it either.functiondeclaration that is never reassigned now callscomponentSlotFunctioninstead of the generic dynamic-tagcomponentSlot. Before, onlylazy()consts were proven to be functions. Relay's<ThreadPortal>was the call that kept its renderer.Client JS gzip, every example (sum of non-server chunks,
vite build, gzip -9)deopt.tsrawstorybook is built by Storybook, not Vite, so it is not in this table; its e2e passes. wayfinder, signal-chat and monaco still keep
hostStringTagBodyandsetHostPropsfor their imported dynamic tags (see follow-ups).Growth justification. Apps that really build host descriptors grow 107–222 B gzip, about +370 B raw. The breakdown, from octane-jsx js-framework source-map attribution:
reconcileDeoptChildrensitesdeoptItemBody/childSlot/renderPreparedChildListEach piece is what keeps call counts unchanged while letting tree-shaking drop the renderer everywhere else.
benchmarks/bundle-sizerows that moved (gzip)The other 15 of 37 gzip rows are unchanged, including js-framework, todo, chat and weather octane-tsrx.
Minimal reachability (
run-minimal.mjs):Performance A/B (same session, base 7246709 ↔ head, alternating)
js-framework (
pair.mjs, 30 pairs, run twice): all 40/40 work counters equal in both runs (calls_*anddom_*, octane-tsrx and octane-jsx). Every timing ratio's median is within ±3%. octane-jsxselectwas 1.024 [1.018, 1.030] in run 1 and 1.013 [1.000, 1.023] in run 2. octane-tsrxswapandremoveshowed the same spread in the opposite direction, andclear0.885 in run 2.dbmon (6 alternating rounds × 30 iterations, both dialects): semantic gate passed. Median head/base ratio is 1.000 for every op except
tick_partial, which measured 0.7 vs 0.8 ms (tsrx) and 0.85 vs 0.8 ms (jsx) at the 0.1 ms timer step; its range spans 1.0.effectful-list (6 alternating rounds × 30): effect-counter gate passed every round. Ratios: tsrx mount_1k 1.000, update_deps 1.002, clear 1.000, remount 0.990, remove_100_scattered 1.000; jsx mount_1k 1.005, update_nodeps 1.000, update_deps 1.006, clear 1.000, remount 1.000, remove_100_scattered 1.000.
app-frame-hydration (
--base): blocks, renders,renderBlockentries and heap bytes are identical; client gzip is 120,107 → 118,060. A 20-pair run showedframecold 1.050 [0.998–1.065] while the other scenarios were neutral. A 40-pair rerun of the two flagged scenarios came back neutral:descriptor-renderer: run from the head harness against each tree's runtime. All 144
children.mjsand 252forms.mjswork counters are identical.props.mjsandevents.mjsfail identically on base and head: they look up runtime setters such assetDeoptClassthat no longer exist on main, a pre-existing harness drift.Validation
pnpm format:files:check(changed files);pnpm syncproduced no generated changes;node scripts/split-runtime.mjs check: 34 modules, 0 violationstsc -p packages/octane/tsconfig.jsonclean;pnpm typecheck:filesadds no errors beyond what the touched test files already have on basepnpm test: the single-process local run hit a vitest main-process heap OOM at 328 s, a local resource limit, so the full suite is left to the four CI shards. Run locally instead: 151 descriptor, slot, hydration, universal, compiler andcomponentSlottest files, 3,400 tests, all passing, plusdescriptor-host-capabilityinoctaneandoctane-prodcommands.e2eper example, run sequentially): cartlane (both modes), cinebase, draftboard, electron, flowboard, gridlab, hacker-news (20), harbor, lexical-playground, mailroom, monaco-playground, pagecraft (both modes), pulseboard, relay, signal-chat (14), storybook, streambox, threadline, wayfinder, workbenchReachability gate.
run-minimal.mjs renderable-holes: a pure.tsrxapp with holes over text, a string array, a returned component descriptor and children. It must dropreconcileDeoptHost,reconcileDeoptChildren,hostElementBodyandsetHostPropsand keepchildSlotandrenderPreparedChildList.descriptor-childrenmust keep all of them. On base the gate fails with[reconcileDeoptChildren, hostElementBody, setHostProps]retained.Fresh-runtime behavior.
descriptor-host-capability.test.tscovers five creator paths, each in a fresh module realm:.map;createHostElement);componentSlotdynamic tag;createElement.Removing each installer in turn (the compiler's module install,
createHostElement's, scoped records', or the public factories') fails exactly its own case.perf-review:node scripts/perf-review-scan.mjs→ 0 candidates. Manual checks:HOST_DESCRIPTORS, only when the value is a host descriptor (child-slots.tshostDriver,deopt.tsdeoptItemBody).hostDriver.reconcilewhere they calledreconcileDeoptNode; text items indeoptItemBodyskip adeoptChildNamespacecall;reconcileDeoptChildrendispatches inline;createHostElementcalls the installer once.DeoptOrderis unchanged; commit ops now push one of two monomorphic functions._$enableHostDescriptors()) and in the call-site entry name (componentSlotFunction).concise-code: src +232 −176 (runtime +220 −170, most of it thereconcileDeoptHostmove out ofreconcileDeoptNode).reconcileDeoptHost,buildDeoptAdoptQueue,placeUpgradedList,HostDescriptorDriver,HOST_DESCRIPTORS, andenableHostDescriptors(moved fromdeopt.ts).DESCRIPTOR_HOST_PROPS(≈25 lines) worked under oxc but kept ~2.4 KB raw: oxc keeps unused self-recursive functions such asflattenDeoptChildrenKeyed, and esbuild never folds.deopt.tswould move ~1,200 lines and save nothing over the driver.Risk / follow-ups
ApolloProviderin cinebase), or whosecomponentSlottags are imports (Hydrate,@octanejs/seo, monacoEditor), still keep part or all of the renderer. Proving those tags are functions needs cross-module export metadata, likeVOID_EXPORTS_META..tsrx.mapfallbacks over host rows still emitcreateScopedElement('li', …), so those apps keep the renderer. Avoiding descriptors there would change the elementtypea custom receiver'smapobserves.descriptor-renderer/props.mjsandevents.mjsare broken on main (stale setter names); a separate fix.pnpm testwas not run locally (single-process OOM); the CI shards are the evidence.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Touches core render reconciliation (
childSlot, de-opt host paths) and compiler slot selection; behavior is heavily tested but regressions could affect host adoption, hydration, or bundle reachability.Overview
Makes the host element descriptor renderer an optional, tree-shakeable capability so client bundles that only render text, arrays, component descriptors, and compiled children no longer ship
reconcileDeoptHost,hostElementBody,setHostProps, and related de-opt paths.The runtime introduces
HOST_DESCRIPTORSindrivers.ts(installed viaenableHostDescriptors).childSlotand list/de-opt code consulthostDriveronly when a value is a host descriptor; host reconciliation moves toreconcileDeoptHost, whilereconcileDeoptNodehandles text/empties. The compiler emits module-levelenableHostDescriptors()only for JSX tags that may resolve to a host string at runtime, and routes module function components throughcomponentSlotFunctioninstead of the generic dynamic-tagcomponentSlot.Benchmarks add a
renderable-holesbundle-size scenario (must drop host renderer symbols) and extend recursive-context work gates forcomponentSlotFunction. New tests cover host-renderer installation across dynamic tags, scoped rows, andcreateElement.Reviewed by Cursor Bugbot for commit 1fb58a5. Bugbot is set up for automated code reviews on this repo. Configure here.