Skip to content

chore: universal root component now carries a committed range - #587

Merged
leonidaz merged 5 commits into
mainfrom
perf/universal-root-scoped-updates
Aug 6, 2026
Merged

leonidaz merged 5 commits into
mainfrom
perf/universal-root-scoped-updates

Conversation

@leonidaz

@leonidaz leonidaz commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

based on info from #574 (comment)


Note

High Risk
Changes core universal commit, reconciliation, scheduling, and listener tables; incorrect retention or epoch logic could cause stale UI, lost updates, or broken suspense/event behavior.

Overview
Universal renderer now treats the root component like any other owner with a committed range, so urgent updates to root state replay through the scoped path instead of falling back to a whole-tree prepare.

During eligible plain urgent renders, unchanged component subtrees (matching props, contexts, component revision, no pending updates, no boundary/portal issues) emit retained range blueprints and reconcile without re-executing those owners; dirty epochs stamped on scheduleOwned force re-render for scheduled work. Child owner claims add a sequential cursor fast path when sibling order is stable.

Scoped replay fixes include using the committed range key, skipping redundant feature walks for root scope, aligning root materializeValue identity paths with scoped replay, and retiring event/local listeners only for hosts that were re-staged or removed (so retained subtrees keep listeners). Owner children merge retained and drafted records in claim order.

Benchmarks add root-state-clean / root-state-dirty scenarios and a clean/dirty ratio guard; tests cover root-state siblings, context invalidation, list reorder, and suspense resolve beside retained siblings.

Reviewed by Cursor Bugbot for commit 02bbbf9. Bugbot is set up for automated code reviews on this repo. Configure here.

Boundary invalidation and queued suspense replays re-render without hook
updates, so retained-subtree adoption needs their signals: scheduled owners
(plus ancestors) captured per attempt, full-root schedules disabling
retention, and runReplay attempts marked ineligible.
…sets

scheduleOwned stamps the owner chain with the root's dirty epoch (amortized
O(1) per call), prepare consumes the epoch with a single increment, and the
retained-subtree bail checks one integer instead of a Set lookup.
@github-actions github-actions Bot added the chore PR: tooling, dependencies, repo maintenance label Aug 6, 2026
@leonidaz
leonidaz marked this pull request as ready for review August 6, 2026 04:43
@leonidaz
leonidaz merged commit 2b98a33 into main Aug 6, 2026
51 of 52 checks passed
@leonidaz
leonidaz deleted the perf/universal-root-scoped-updates branch August 6, 2026 04:58

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 02bbbf9. Configure here.

Comment thread packages/octane/src/universal-core.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore PR: tooling, dependencies, repo maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant