Repository navigation
perf(compiler): add opt-in fixed primitive child bindings - #1226
Merged
domgan-oai merged 3 commits intoSep 21, 2026
Merged
domgan-oai merged 3 commits into
domgan-oai merged 3 commits into
Conversation
domgan-oai
marked this pull request as ready for review
September 21, 2026 20:58
domgan-oai
marked this pull request as draft
September 21, 2026 21:19
domgan-oai
marked this pull request as ready for review
September 21, 2026 21:31
1 task done
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
Add opt-in specialization for primitive props in named DOM binding child programs. Select repeated presentation fields with
domBindingFixedProps: ['variant', 'radius']; default requests remain generic and shared. The versioned extraction request carries proven values so the selected child program can fold unreachable presentation branches. Ordinary renderer output retains its authored behavior.The public seven-child fixture has distinct literal labels and one shared extracted child module in both profiles. The child shrinks from 828 to 699 gzip bytes; its complete production binding/runtime bundle shrinks from 11,825 to 11,652 gzip bytes (173 bytes), and by 545 minified bytes. Source, tooling, and semantic controls are matched; only the explicit propagation option differs. These measurements do not establish a default application or startup benefit.
Changes
compile,createOctaneCompiler,octane/compiler/vite, and@octanejs/vite-plugin, including Vite compiler resets. Keep literal labels and IDs live to share extracted programs.Validation
pnpm sync, scoped formatting, andgit diff --checktsgo; public TSRX fixture and Vite option type checksnode benchmarks/bench.mjs --quick --ratios dom-binding-fixed-props: all six guards pass, including full-bundle non-growth and one shared child module with seven distinct labelspnpm format:check,pnpm typecheck, and workspacepnpm testwere not run; current-head CI is required separatelyThe general
codegen-sizesuite fails its Rspack CSS SSR asset assertion (496.main.cjsplusmain.cjs, expected onlymain.cjs); the unchanged base34e83cee9reproduces the same failure. No existing ratio guards or budgets were changed.Risk / follow-ups
Imported child bodies are unavailable during parent planning, so automatic selection of profitable prop facts is deliberately disabled. Opting in to fields with many different literal values can duplicate programs; measure the complete bundle and select repeated presentation fields. Rspack/Rsbuild wrapper option surfaces are not extended by this change. Consumer adoption and release validation remain separate work.
Specialization adds one primitive comparison per used fact during preparation. CPU, memory, and page latency were not measured. Arbitrary helper calls and module object tables are not evaluated or pruned, and non-finite literal defaults stay live.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches DOM binding codegen and runtime prop validation on an opt-in path; default generic child requests are unchanged but enabled builds alter generated programs and failure modes.
Overview
Adds an opt-in
domBindingFixedPropscompiler option (viacompile, bundler, Vite, and@octanejs/vite-plugin) so parent call sites can propagate caller-authored primitive literals into extracted DOM binding child programs. Default extraction stays on the generic shape[1, orderedPropNames]; specialized requests use[2, props, fixedPairs]on the existingoctane-propsquery.The new
fixedBindingPropspipeline constant-folds proven primitives in child projections, drops unreachable conditional/template arms, and emits prepare-time checks that throw if fixed props drift at runtime. Only bounded primitives qualify; dynamic props, callbacks, uncertain reads, and non-finite defaults stay live. Generic plans keep a no-op specializer.Ships a dedicated
dom-binding-fixed-propsbenchmark (six ratio guards), MCP benchmark registration, fixture/docs, and broad compiler/behavior/plugin tests covering adoption, mount, updates, hydration handoff, and shared child modules across differing literal labels.Reviewed by Cursor Bugbot for commit e01bbb7. Bugbot is set up for automated code reviews on this repo. Configure here.