Repository navigation
perf: initialize client block fields once - #989
Merged
domgan-oai merged 1 commit intoSep 8, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
September 8, 2026 08:56
Closed
68 of 84 tasks
7 of 8 tasks
14 of 21 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
BlockImpl,ScopeImpl, andLiteBlockImplfield declarations type-only; their constructors remain the single source of runtime field initialization.createdStamplast on blocks andslotslast on scopes.Why
With native class-field semantics, the previous declarations defined 70 properties as
undefinedbefore the constructors assigned their values. That work occurs for every client block, keyed row, and child scope. It also generalized several numeric fields during warm-up.Changes
declarein the three runtime classes, retaining every constructor assignment and field.octanepatch changeset.Validation
LiteBlockImpl.parentNodeinitialization makes the same mount fail at the DOM insertion boundary.git diff --check.octaneandoctane-prod(3 tests each), Chromium integration, parity, lint, typecheck, and provenance.pnpm syncand pinned Vitest/typecheck could not start: frozen install returned 403 for@tsrx/[email protected], and the sync preflight returned 403 for@tsrx/[email protected].Risk / follow-ups
Native field definitions previously shadowed deliberately installed setters on internal class prototypes; constructor assignments can invoke such setters. No supported API promises prototype mutation of framework-owned Blocks/Scopes. The source-only mount timings need corroboration by the compiled benchmark before any broad speed claim.
Refs #981.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches the hot-path client runtime object layout; behavior is guarded by new mount/hydration tests, with a noted edge case if prototype setters were installed on framework-owned block/scope classes.
Overview
Runtime object construction no longer emits native class-field initializers for
BlockImpl,ScopeImpl, andLiteBlockImpl. Uninitialized instance fields are nowdeclare(type-only), so each new block/scope/lite proxy is shaped only by the existing constructor assignments—avoiding dozens of redundantundefineddefinitions per allocation under native class-field compilation while keeping the same fields and V8 hidden-class intent.Property order is explicitly preserved:
createdStampstays last on blocks andslotslast on scopes (constructor assignment order adjusted where needed).Regression coverage adds
component-mount-shapes.test.tsfor nested hookless children (DOM identity, ref detach), keyed vs sibling identity, and hydration adopting server nodes without replacement. An octane patch changeset documents the change.Reviewed by Cursor Bugbot for commit 8d907d4. Bugbot is set up for automated code reviews on this repo. Configure here.