Repository navigation
perf(core): motions one callback starts read stylesheets in one pass - #10728
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TimeInput | 162.0 kB (+211 B) · 16.0 kB CSS (0) | — | — · — · — |
| BottomSheet | 67.9 kB (+171 B) · 7.7 kB CSS (0) | — | — · — · — |
| lab/PageControl | 75.2 kB (+167 B) · 709 B CSS (0) | — | — · — · — |
34 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| SideNav | 114.2 kB (+162 B) · 11.4 kB CSS (0) | — | — · — · — |
| ChatLayout | 83.0 kB (+156 B) · 10.5 kB CSS (0) | — | — · — · — |
| DateTimeInput | 208.2 kB (+154 B) · 18.7 kB CSS (0) | — | — · — · — |
| lab/TabBar | 76.9 kB (+154 B) · 1.8 kB CSS (0) | — | — · — · — |
| PowerSearch | 286.7 kB (+152 B) · 24.1 kB CSS (0) | — | — · — · — |
| SegmentedControl | 96.2 kB (+152 B) · 6.9 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 151.1 kB (+141 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/Comments | 350.1 kB (+139 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 106.9 kB (+138 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 105.7 kB (+136 B) · 773 B CSS (0) | — | — · — · — |
| lab/NavigationStack | 82.2 kB (+134 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/NavigationScreen | 82.2 kB (+133 B) · 1.5 kB CSS (0) | — | — · — · — |
| Slider | 109.3 kB (+129 B) · 8.8 kB CSS (0) | — | — · — · — |
| DateInput | 186.5 kB (+128 B) · 17.0 kB CSS (0) | — | — · — · — |
| Switch | 103.8 kB (+126 B) · 9.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 343.2 kB (+126 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/TourStep | 97.4 kB (+122 B) · 590 B CSS (0) | — | — · — · — |
| Lightbox | 122.5 kB (+121 B) · 10.6 kB CSS (0) | — | — · — · — |
| Popover | 91.0 kB (+115 B) · 14.2 kB CSS (0) | — | — · — · — |
| TableCell | 109.6 kB (+1 B) · 17.9 kB CSS (0) | — | — · — · — |
| DropdownMenu | 97.2 kB (0) · 17.6 kB CSS (0) | — | — · — · — |
| List | 18.0 kB (0) · 790 B CSS (0) | — | ✓ · ✓ · — |
| ListItem | 70.4 kB (0) · 11.4 kB CSS (0) | — | ✓ · ✓ · ✓ |
| Markdown | 187.3 kB (0) · 20.6 kB CSS (0) | — | — · — · — |
| MoreMenu | 97.5 kB (0) · 17.6 kB CSS (0) | — | — · — · — |
| MultiSelector | 94.9 kB (0) · 16.8 kB CSS (0) | — | — · — · — |
| Pagination | 109.8 kB (0) · 17.8 kB CSS (0) | — | — · — · — |
| Selector | 99.8 kB (0) · 17.4 kB CSS (0) | — | — · — · — |
| Table | 124.6 kB (0) · 18.3 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 109.2 kB (0) · 17.7 kB CSS (0) | — | — · — · — |
| Tokenizer | 91.5 kB (0) · 18.8 kB CSS (0) | — | — · — · — |
| lab/TabBarItem | 3.8 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| ContextMenu | 108.3 kB (−1 B) · 17.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.9 kB (−1 B) · 454 B CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.19 MB packed (+1.1 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so marking it ready for review starts its run (it already carries ci:run).
The animator now reads fresh promotions' stylesheets in one batched style pass per callback (architecture:react-component-runtime INV18): eight new rows drop from 8 forced passes to 1, List's first reorder key move from 2 animator passes to 1, and both new proofs fail against main's animator. Rendered output, the public API and the compositor run through a blocked main thread are unchanged.
Non-blocking:
component:ListPR2 indocs/specs/components/List/List.spec.mdstill lists the per-row style pass as an implementation gap; consider removing that sentence here or in a follow-up.- The
readcomment atpackages/core/src/motion/animator.ts:816restates its name; consider dropping it.
[Automated review]
An element's first promotion keeps its stylesheet's will-change beside the animator's. For an element that came in the same task, the animator read that stylesheet at once, right after writing the element's translate, so each element forced a style pass: eight for a list whose eight rows glide together. The promotion is still written in the task that starts the motion. Its stylesheet's reasons now join it in one microtask after the callback, shared by every animator: it takes the promotions off, reads every stylesheet, then writes the promotions back. So the motions that one callback starts force one style pass. The List reorder proof drops its allowance of one pass per row that glides for the first time, and component:List PR2 drops that pass as an implementation gap.
1ac16e3 to
9bce3d7
Compare
|
/approve-spec 9bce3d7 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so marking it ready for review starts its run (it already carries ci:run).
The animator now reads the stylesheets of not-yet-read promotions in one batched style pass per callback (architecture:react-component-runtime INV18): eight fresh rows go from 8 style passes to 1 and the List's first key move from 2 animator passes to 1, and both proofs fail against the base. Both earlier notes are addressed (the restating comment is gone and component:List PR2 no longer records the gap), and an engineering owner has approved that record edit at this head.
[Automated review]
User impact
One callback can start motions on elements that came in the same task. The animator then forced a style pass per element there: eight for eight rows that glide together, two on a list reorder's first key move.
Problem and solution fit
will-changebeside the animator's, so the animator reads that stylesheet once.translate. So every element forced a style pass.Expected behavior and authority
architecture:react-component-runtimeINV18: a read happens "in one batched measurement pass per change, never interleaved with writes", and its review row fails "a read interleaved with writes".Smallest restoration
writePromotionwrites the promoted channels at once and queues the stylesheet read when it is unread (queueSheetRead,flushSheetReads).will-change, and a pseudo-element's promotion.component:ListPR2 drops that pass as an implementation gap.Evidence
opacity, translate). The key move counts at most 1 (3 of 3).Scope
Testing
uiproject (21,047 tests); core TypeScript (rc 0). At this head, the motion and List units pass (1,199). Three existing cases that read the stylesheet's reasons now wait a microtask for them.auditspec files of the 22 Core folders that import the animator.check:knowledgeandcheck:changesets.