refactor(core): split runtime commit pipeline by concern#283
refactor(core): split runtime commit pipeline by concern#283RtlZeroMemory merged 1 commit intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughThis pull request restructures the runtime commit pipeline by decomposing a monolithic commit.ts file into specialized modules. It centralizes type definitions in shared.ts and extracts equality comparisons, composite rendering, container reconciliation, error boundary handling, exit transitions, and validation logic into dedicated modules. The main commit.ts file is reduced from 1851 to 59 lines via re-exports, preserving the behavioral surface while reorganizing internal implementation. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/runtime/commit/equality.ts (1)
451-470: Consider extending fast-reuse coverage to additional container types.
canFastReuseContainerSelfonly supports fast-reuse checks forfragment,box,row,column,focusZone,focusTrap, andthemed. However,isContainerVNodeincludes 12 additional container kinds:grid,layers,field,tabs,accordion,breadcrumb,pagination,splitPane,panelGroup,resizablePanel,modal, andlayer.These additional container types will always return
falsefrom fast-reuse checks, falling through to the slower "new-instance" path even when props haven't changed. Adding prop equality functions for these containers could improve rendering performance in views using these widgets.Example: Adding fast-reuse support for grid
case "grid": return gridPropsEqual(prev.props, (next as typeof prev).props);This pattern can be applied to the other missing container kinds alongside their corresponding prop equality functions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/runtime/commit/equality.ts` around lines 451 - 470, canFastReuseContainerSelf currently only handles a subset of container kinds; extend its switch to include the other container kinds (grid, layers, field, tabs, accordion, breadcrumb, pagination, splitPane, panelGroup, resizablePanel, modal, layer) and return the result of their corresponding prop-equality functions (e.g., gridPropsEqual(prev.props, (next as typeof prev).props), layersPropsEqual(...), fieldPropsEqual(...), etc.). Add/import any missing prop-equality helpers and ensure each new case compares prev.props and next.props in the same pattern used for fragment/box/row, so unchanged props can take the fast-reuse path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/core/src/runtime/commit/equality.ts`:
- Around line 451-470: canFastReuseContainerSelf currently only handles a subset
of container kinds; extend its switch to include the other container kinds
(grid, layers, field, tabs, accordion, breadcrumb, pagination, splitPane,
panelGroup, resizablePanel, modal, layer) and return the result of their
corresponding prop-equality functions (e.g., gridPropsEqual(prev.props, (next as
typeof prev).props), layersPropsEqual(...), fieldPropsEqual(...), etc.).
Add/import any missing prop-equality helpers and ensure each new case compares
prev.props and next.props in the same pattern used for fragment/box/row, so
unchanged props can take the fast-reuse path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 957b27e6-b6b1-4f30-9c3e-501001f39758
📒 Files selected for processing (8)
packages/core/src/runtime/commit.tspackages/core/src/runtime/commit/composite.tspackages/core/src/runtime/commit/container.tspackages/core/src/runtime/commit/equality.tspackages/core/src/runtime/commit/errorBoundary.tspackages/core/src/runtime/commit/shared.tspackages/core/src/runtime/commit/transitions.tspackages/core/src/runtime/commit/validation.ts
Summary
packages/core/src/runtime/commit.tsinto internal helper modules underpackages/core/src/runtime/commit/.Why
Validation
npm run lintnpm run typechecknpm run buildnode scripts/run-tests.mjs --filter "packages/core/dist/runtime/__tests__/"node scripts/run-tests.mjs --filter "packages/core/dist/app/__tests__/widgetRenderer"node scripts/run-tests.mjs --filter "packages/core/dist/__tests__/integration/"node scripts/run-tests.mjsPTY / Frame Audit Evidence
stty rows 68 cols 300REZI_STARSHIP_EXECUTION_MODE=worker REZI_STARSHIP_DEBUG=1 REZI_FRAME_AUDIT=1 npx tsx packages/create-rezi/templates/starship/src/main.tsbackend_submitted=5689,worker_payload=5689,worker_accepted=5689,worker_completed=5689,hash_mismatch_backend_vs_worker=0bridge submitted=4921 completed=4921,comms submitted=768 completed=768cycle-theme,go-comms,comms-hail,toggle-command-palette,quitbridge -> commsandshowToastOverlaytoggling on and off during the runREZI_FRAME_AUDIT=1 npx tsx packages/create-rezi/templates/animation-lab/src/main.tsbackend_submitted=1849,worker_payload=1849,worker_accepted=1849,worker_completed=1849,hash_mismatch_backend_vs_worker=0,DRAW_CANVAS(8): 9245Summary by CodeRabbit
Refactor