Repository navigation
perf(octane): ship the host descriptor renderer only where host descriptors exist - #2249
Merged
domgan-oai merged 4 commits intoOct 27, 2026
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]>
Keep the host descriptor and memo bail drivers independently installable. Combine their bundle checks so descriptor children retain both the host renderer and the implicit bailout, while renderable holes still drop the renderer.
domgan-oai
marked this pull request as ready for review
October 27, 2026 13:06
Contributor
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
47 other measured values are unchanged. Public-import reachability bundles (bytes)
96 other measured values are unchanged. |
MDX treats bare prose in this multiline paragraph as another paragraph. Use the same string expression as the other guides and cover the rendered structure in the route smoke test.
This was referenced Oct 27, 2026
6 of 9 tasks
trueadm
added a commit
that referenced
this pull request
Oct 28, 2026
…tely (#2255) #2249 reached the host renderer through one HOST_DESCRIPTORS object. Apps that install the renderer reach all seven of its fields, and a minifier keeps every property name in full: the object literal plus about 14 hostDriver.x reads at call sites. Make each entry point its own module binding, set together by enableHostDescriptors. HOST_BODY is set exactly when the renderer is installed, so it serves as the installed check, and callers keep the guard shapes that fold away in a bundle that never installs it. An early return keeps repeat installs from the public factories to one check, as ??= did. Against main d44d6d9: js-framework octane-jsx −99 raw / −28 gzip, descriptor-children −99 raw / −80 gzip, renderable-holes −3 raw / −5 gzip. Both reachability gates pass. Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Dominic Gannaway <[email protected]>
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
This fork-based replacement for #2247 preserves its commits and merges
mainatfcb02246d. Applications that can create host element descriptors install the renderer. Applications that use only renderable holes over text, arrays, components, and compiled children can drop it.The conflict resolution keeps #2246’s memo and context handling alongside the host renderer. The
descriptor-childrenbundle must retain both the implicit bailout and the host renderer. Therenderable-holesbundle must retain the shared list path and drop the host renderer. The renderer diff againstmainhas the same 16 files as #2247.The website integration job also caught an existing nested paragraph on the Signals guide. The opening sentence now uses the same MDX string expression as the neighboring guides, so the browser can hydrate it as a single paragraph. A route smoke assertion catches nested paragraphs independently of hydration timing.
Validation
pnpm syncproduced no generated changes.git diff --check.pnpm exec octane-tsc -p packages/octane/tsconfig.json.octaneandoctane-prodprojects. All 1,037 tests passed across 18 test-file runs, covering descriptors, host upgrades, context, memo, Strong-mode compilation, and the universal renderer.renderable-holes,descriptor-children,memo-context,context,controlled-input, andhydrate-frame.node scripts/split-runtime.mjs checkfound zero violations across 34 modules./docs/signals. The smoke assertion caught the nested paragraph before the MDX fix.ea476e160passed, including repository-wide formatting, typecheck, four Node test shards, four React parity shards, and Chromium integration. CI runRisk / follow-ups
The full example size comparisons are from #2247. Local validation on this merged head measured the six bundle fixtures above.
Provenance
agent-authored)Conflict resolution by Codex task on host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes core child-slot and de-opt reconciliation routing plus compiler capability detection; incorrect tree-shaking or tag classification could break host DOM updates or dynamic tags.
Overview
Makes the host element descriptor renderer optional at bundle time so client JavaScript only retains
reconcileDeoptHost,hostElementBody, generic host prop writers, and related de-opt paths when something in the app can actually create a host descriptor.The compiler now emits an
enableHostDescriptorscapability when JSX cannot prove a function component (dynamic tags); static host factories andcreateHostElementstill install the driver at runtime.HOST_DESCRIPTORSindrivers.tscentralizes host reconcile/adopt/upgrade hooks, andchildSlot/deoptItemBodybranch on that driver instead of always pulling host code through sharedreconcileDeoptNode. Modulefunctioncomponents are classified like lazy components for codegen (componentSlotFunction), avoiding the genericcomponentSlotdynamic-tag path.Benchmarks add a
renderable-holesscenario that must drop the host renderer while keeping list/child-slot paths;descriptor-childrenmust still retain it. Tests cover host capability install sites and updated slot codegen expectations.Reviewed by Cursor Bugbot for commit 6c2b92f. Bugbot is set up for automated code reviews on this repo. Configure here.