Repository navigation
perf(core): merge props in a single pass - #12173
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: the single-pass merge keeps results identical for every typed input and roughly halves the cost of a call, but one line changes how a falsy style is handled.
packages/core/src/utils/mergeProps.ts:122picks the single style with??while lines 106-117 count only truthy styles, so a falsystylesuch asstyle={false},0or''beside one other style replaces it and React throws (for example<Skeleton width={200} height={20} style={false} />now crashes on the client and inrenderToString, where it rendered before); change the line tomerged.style = s4 || s3 || s2 || s1;and add a test for a falsy fourth argument.
Everything else checks out: the public API surface is unchanged, and the existing tests, typecheck, lint and formatting pass on this head.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim, changeset: props merge in a single pass with no intermediate object clones or array allocations: verified (
mergeProps.ts:73spreads once,:80-89concatenates class names,:123-129builds one style object). - Claim, changeset: a patch release for
@astryxdesign/core: verified (the changeset check passes). - Claim, description: fixes the linked issue: verified (one props copy per call; the issue's three call shapes give identical results).
- Claim, description: the old code called the two-object merge in several passes, copying objects and filtering arrays: verified for the base file (the filtered array was for class names only).
- Claim, description: spreads props once, concatenates class names, merges styles only when several are set: verified (
mergeProps.ts:73,:80-89,:119-130). - Claim, description: the unit tests pass: verified (23 of 23 on this head).
- Claim, description: the Core typecheck passes: verified on this head.
- File
.changeset/merge-props-single-pass.md: clear. - File
packages/core/src/utils/mergeProps.test.ts: clear; the new case covers the three-style merge, and no case covers a falsy style. - File
packages/core/src/utils/mergeProps.ts: finding at line 122 (above).
|
Updated. Switched to |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. Next step: a maintainer adds the ci:run label so CI runs.
The follow-up commit fixes the falsy style case from the last review: mergeProps.ts:122 now skips falsy styles the same way the count above it does, and the new test pins it. The merged props now match the previous implementation for every typed and untyped input checked, and the public API is unchanged.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim, changeset: props merge in a single pass with no intermediate object clones or array allocations: verified (
mergeProps.ts:73spreads once,:80-89concatenates class names,:119-130builds one style object only for two or more styles). - Claim, changeset: a patch release for
@astryxdesign/core: verified (no public API change; the changeset check passes). - Claim, description: fixes the linked issue: verified (one props copy per call; the issue's three call shapes give identical results).
- Claim, description: the old code called the two-object merge in several passes, copying objects and filtering arrays: verified for the base file (the filtered array was for class names only).
- Claim, description: spreads props once, concatenates class names, merges styles only when several are set: verified (
mergeProps.ts:73,:80-89,:119-130). - Claim, description: the unit tests pass: verified (24 of 24 on this head).
- Claim, description: the Core typecheck passes: verified on this head.
- File
.changeset/merge-props-single-pass.md: clear. - File
packages/core/src/utils/mergeProps.test.ts: clear; the falsy fourth-argument case fails against the previous??line and passes here. - File
packages/core/src/utils/mergeProps.ts: clear; line 122 and the spreads at lines 124-129 now use the same truthiness test as the count.
|
/approve-spec 2e4aff7 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| DropdownMenu | 113.3 kB (+104 B) · 19.8 kB CSS (0) | — |
| TableHeaderCell | 106.2 kB (+104 B) · 20.0 kB CSS (0) | — |
| MoreMenu | 113.5 kB (+102 B) · 19.8 kB CSS (0) | — |
224 more components
| Component | Size | LoC |
|---|---|---|
| lab/MediaFullscreenButton | 223.3 kB (+102 B) · 1.5 kB CSS (0) | — |
| ContextMenu | 105.2 kB (+101 B) · 19.6 kB CSS (0) | — |
| Markdown | 208.5 kB (+101 B) · 23.4 kB CSS (0) | — |
| lab/Schedule | 117.7 kB (+101 B) · 3.9 kB CSS (0) | — |
| Selector | 120.2 kB (+100 B) · 19.7 kB CSS (0) | — |
| TableCell | 106.3 kB (+100 B) · 20.1 kB CSS (0) | — |
| lab/MediaCaptionsButton | 223.3 kB (+100 B) · 1.5 kB CSS (0) | — |
| lab/MediaPlayButton | 223.3 kB (+100 B) · 1.5 kB CSS (0) | — |
| lab/MediaSeekButton | 223.3 kB (+100 B) · 1.5 kB CSS (0) | — |
| lab/MediaTime | 223.3 kB (+100 B) · 1.5 kB CSS (0) | — |
| lab/MediaTimeSlider | 223.3 kB (+100 B) · 1.5 kB CSS (0) | — |
| lab/MediaPlaybackRate | 223.3 kB (+99 B) · 1.5 kB CSS (0) | — |
| lab/MediaVolume | 223.3 kB (+99 B) · 1.5 kB CSS (0) | — |
| Table | 124.2 kB (+96 B) · 21.1 kB CSS (0) | — |
| CommandPalette | 82.7 kB (+95 B) · 13.5 kB CSS (0) | — |
| charts/Chart | 247.7 kB (+93 B) · 516 B CSS (0) | — |
| Drawer | 57.3 kB (+89 B) · 8.7 kB CSS (0) | — |
| lab/AudioPlayer | 233.4 kB (+88 B) · 1.8 kB CSS (0) | — |
| charts/ChartTooltip | 224.2 kB (+87 B) · 451 B CSS (0) | — |
| SideNavItem | 82.4 kB (+82 B) · 12.3 kB CSS (0) | — |
| BreadcrumbItem | 102.5 kB (+81 B) · 14.0 kB CSS (0) | — |
| DateRangeInput | 106.1 kB (+81 B) · 14.2 kB CSS (0) | — |
| lab/VideoPlayer | 231.0 kB (+80 B) · 2.1 kB CSS (0) | — |
| Dialog | 27.8 kB (+78 B) · 7.3 kB CSS (0) | — |
| TextArea | 94.6 kB (+78 B) · 10.0 kB CSS (0) | — |
| richtext/RichTextView | 287.5 kB (+78 B) · 2.4 kB CSS (0) | — |
| InputGroup | 63.2 kB (+77 B) · 8.8 kB CSS (0) | — |
| NumberInput | 106.2 kB (+77 B) · 13.0 kB CSS (0) | — |
| StatusDot | 34.7 kB (+77 B) · 5.7 kB CSS (0) | — |
| lab/SelectableCardGroup | 71.5 kB (+77 B) · 162 B CSS (0) | — |
| Popover | 104.3 kB (+76 B) · 15.5 kB CSS (0) | — |
| lab/ChatTypingIndicator | 26.6 kB (+76 B) · 612 B CSS (0) | — |
| lab/Comments | 388.4 kB (+76 B) · 2.5 kB CSS (0) | — |
| Breadcrumbs | 16.7 kB (+75 B) · 3.4 kB CSS (0) | — |
| InfoTip | 51.9 kB (+75 B) · 5.7 kB CSS (0) | — |
| CommandPaletteList | 16.6 kB (+74 B) · 3.4 kB CSS (0) | — |
| Overlay | 23.9 kB (+74 B) · 4.1 kB CSS (0) | — |
| Toolbar | 48.2 kB (+74 B) · 8.6 kB CSS (0) | — |
| lab/CommentThread | 381.3 kB (+74 B) · 2.4 kB CSS (0) | — |
| TabMenu | 84.3 kB (+73 B) · 12.3 kB CSS (0) | — |
| lab/CommentComposer | 186.5 kB (+73 B) · 1.9 kB CSS (0) | — |
| CheckboxList | 74.8 kB (+72 B) · 8.1 kB CSS (0) | — |
| FileInput | 77.4 kB (+72 B) · 12.8 kB CSS (0) | — |
| Link | 57.9 kB (+72 B) · 7.4 kB CSS (0) | — |
| SegmentedControlItem | 19.3 kB (+72 B) · 4.3 kB CSS (0) | — |
| Tokenizer | 112.9 kB (+72 B) · 21.9 kB CSS (0) | — |
| BottomSheet | 75.4 kB (+71 B) · 7.8 kB CSS (0) | — |
| FieldLabel | 56.9 kB (+71 B) · 6.1 kB CSS (0) | — |
| PowerSearch | 318.2 kB (+71 B) · 27.3 kB CSS (0) | — |
| Section | 7.9 kB (+71 B) · 6.4 kB CSS (0) | — |
| lab/ChatReactionBar | 129.0 kB (+71 B) · 1.1 kB CSS (0) | — |
| ChatMessage | 17.3 kB (+70 B) · 3.7 kB CSS (0) | — |
| ChatToolCalls | 34.6 kB (+70 B) · 8.8 kB CSS (0) | — |
| DropdownMenuSubMenu | 80.4 kB (+70 B) · 11.0 kB CSS (0) | — |
| Field | 61.1 kB (+70 B) · 7.6 kB CSS (0) | — |
| List | 19.2 kB (+70 B) · 810 B CSS (0) | — |
| Carousel | 77.7 kB (+69 B) · 12.1 kB CSS (0) | — |
| ChatTokenizedText | 7.6 kB (+69 B) · 4.1 kB CSS (0) | — |
| ContextMenuItem | 38.7 kB (+69 B) · 7.3 kB CSS (0) | — |
| Kbd | 17.3 kB (+69 B) · 3.6 kB CSS (0) | — |
| lab/CommentPin | 61.7 kB (+69 B) · 1.2 kB CSS (0) | — |
| lab/LineClamp | 15.7 kB (+69 B) · 168 B CSS (0) | — |
| AvatarGroup | 49.7 kB (+68 B) · 6.1 kB CSS (0) | — |
| NavHeadingMenuItem | 18.7 kB (+68 B) · 6.7 kB CSS (0) | — |
| lab/ChatVirtualizer | 57.8 kB (+68 B) · 223 B CSS (0) | — |
| ChatComposerTokenElement | 87.9 kB (+67 B) · 12.5 kB CSS (0) | — |
| ToggleButton | 94.9 kB (+67 B) · 11.3 kB CSS (0) | — |
| Token | 30.1 kB (+67 B) · 5.0 kB CSS (0) | — |
| TopNav | 81.0 kB (+67 B) · 12.1 kB CSS (0) | — |
| ChatComposerInput | 87.9 kB (+66 B) · 12.5 kB CSS (0) | — |
| TopNavMegaMenuItem | 15.4 kB (+66 B) · 4.2 kB CSS (0) | — |
| lab/MediaPlayer | 31.3 kB (+66 B) · 165 B CSS (0) | — |
| richtext/RichTextEditor | 310.8 kB (+66 B) · 2.7 kB CSS (0) | — |
| Avatar | 46.9 kB (+65 B) · 6.0 kB CSS (0) | — |
| Banner | 69.7 kB (+65 B) · 11.6 kB CSS (0) | — |
| ChatComposer | 90.7 kB (+65 B) · 13.5 kB CSS (0) | — |
| CommandPaletteFooter | 17.7 kB (+65 B) · 3.7 kB CSS (0) | — |
| CommandPaletteInput | 34.0 kB (+65 B) · 7.9 kB CSS (0) | — |
| EmptyState | 7.1 kB (+65 B) · 510 B CSS (0) | — |
| MetadataList | 17.4 kB (+65 B) · 3.8 kB CSS (0) | — |
| RadioList | 62.6 kB (+65 B) · 7.6 kB CSS (0) | — |
| TreeList | 47.0 kB (+65 B) · 6.0 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 315.1 kB (+65 B) · 454 B CSS (0) | — |
| charts/ChartLegend | 49.4 kB (+64 B) · 224 B CSS (0) | — |
| Tab | 15.1 kB (+64 B) · 4.3 kB CSS (0) | — |
| lab/TabBarMoreList | 104.2 kB (+64 B) · 1.8 kB CSS (0) | — |
| CheckIndicator | 8.9 kB (+63 B) · 681 B CSS (0) | — |
| LayoutPanel | 22.3 kB (+63 B) · 5.1 kB CSS (0) | — |
| lab/EmojiPicker | 120.9 kB (+63 B) · 751 B CSS (0) | — |
| lab/LogStream | 8.3 kB (+63 B) · 1.6 kB CSS (0) | — |
| ChatMessageMetadata | 20.9 kB (+62 B) · 4.2 kB CSS (0) | — |
| CheckboxListItem | 82.0 kB (+62 B) · 12.5 kB CSS (0) | — |
| DropdownMenuGroup | 6.5 kB (+62 B) · 3.4 kB CSS (0) | — |
| InputGroupText | 7.0 kB (+62 B) · 3.9 kB CSS (0) | — |
| ListItem | 81.1 kB (+62 B) · 12.5 kB CSS (0) | — |
| SegmentedControl | 103.5 kB (+62 B) · 7.2 kB CSS (0) | — |
| SideNavCollapseButton | 68.5 kB (+62 B) · 11.2 kB CSS (0) | — |
| CommandPaletteItem | 13.7 kB (+61 B) · 3.6 kB CSS (0) | — |
| LayoutHeader | 6.5 kB (+61 B) · 1.7 kB CSS (0) | — |
| TopNavItem | 14.7 kB (+61 B) · 4.0 kB CSS (0) | — |
| lab/ChatEmojiPicker | 127.8 kB (+61 B) · 773 B CSS (0) | — |
| lab/CodeEditor | 14.6 kB (+61 B) · 743 B CSS (0) | — |
| lab/MediaPlayerElement | 6.9 kB (+61 B) · 177 B CSS (0) | — |
| lab/PageControl | 79.0 kB (+61 B) · 709 B CSS (0) | — |
| CheckboxInput | 71.0 kB (+60 B) · 10.6 kB CSS (0) | — |
| StackItem | 16.7 kB (+60 B) · 219 B CSS (0) | — |
| lab/DialogHeroHeader | 92.2 kB (+60 B) · 372 B CSS (0) | — |
| lab/TransferListSelector | 151.0 kB (+60 B) · 1.4 kB CSS (0) | — |
| Button | 67.6 kB (+59 B) · 11.1 kB CSS (0) | — |
| ChatLayout | 91.2 kB (+59 B) · 11.7 kB CSS (0) | — |
| ChatSystemMessage | 7.2 kB (+59 B) · 3.8 kB CSS (0) | — |
| ComplexSelector | 83.7 kB (+59 B) · 13.2 kB CSS (0) | — |
| FieldStatus | 10.5 kB (+59 B) · 3.6 kB CSS (0) | — |
| FormLayout | 6.9 kB (+59 B) · 3.5 kB CSS (0) | — |
| Icon | 8.7 kB (+59 B) · 681 B CSS (0) | — |
| OverflowList | 12.7 kB (+59 B) · 3.7 kB CSS (0) | — |
| SideNavSection | 7.1 kB (+59 B) · 3.7 kB CSS (0) | — |
| TableBody | 6.7 kB (+59 B) · 3.3 kB CSS (0) | — |
| Timer | 15.7 kB (+59 B) · 6.4 kB CSS (0) | — |
| lab/CircularProgress | 9.1 kB (+59 B) · 859 B CSS (0) | — |
| Blockquote | 3.8 kB (+58 B) · 3.5 kB CSS (0) | — |
| ChatComposerDrawer | 18.5 kB (+58 B) · 4.8 kB CSS (0) | — |
| ChatMessageList | 30.3 kB (+58 B) · 7.4 kB CSS (0) | — |
| CheckboxIndicator | 2.8 kB (+58 B) · 849 B CSS (0) | — |
| DropdownMenuRadioGroup | 6.7 kB (+58 B) · 3.4 kB CSS (0) | — |
| RadioIndicator | 2.6 kB (+58 B) · 831 B CSS (0) | — |
| ScrollableArea | 11.5 kB (+58 B) · 4.4 kB CSS (0) | — |
| lab/SVGIcon | 8.0 kB (+58 B) · 765 B CSS (0) | — |
| lab/TransferList | 139.1 kB (+58 B) · 1.2 kB CSS (0) | — |
| BaseTypeahead | 83.9 kB (+57 B) · 12.1 kB CSS (0) | — |
| ChatLayoutScrollButton | 68.2 kB (+57 B) · 11.3 kB CSS (0) | — |
| CommandPaletteEmpty | 6.5 kB (+57 B) · 3.5 kB CSS (0) | — |
| DateInput | 208.1 kB (+57 B) · 18.9 kB CSS (0) | — |
| Item | 20.9 kB (+57 B) · 6.2 kB CSS (0) | — |
| TableRow | 7.2 kB (+57 B) · 4.1 kB CSS (0) | — |
| Thumbnail | 72.1 kB (+57 B) · 12.7 kB CSS (0) | — |
| TimeInput | 180.3 kB (+57 B) · 17.8 kB CSS (0) | — |
| ToggleButtonGroup | 42.0 kB (+57 B) · 3.7 kB CSS (0) | — |
| lab/DiffViewer | 95.9 kB (+57 B) · 2.1 kB CSS (0) | — |
| ButtonGroup | 44.8 kB (+56 B) · 3.7 kB CSS (0) | — |
| DateTimeInput | 232.0 kB (+56 B) · 20.6 kB CSS (0) | — |
| Divider | 5.2 kB (+56 B) · 535 B CSS (0) | — |
| LayoutFooter | 6.4 kB (+56 B) · 1.7 kB CSS (0) | — |
| MultiSelector | 109.0 kB (+56 B) · 18.9 kB CSS (0) | — |
| ProgressBar | 12.4 kB (+56 B) · 6.7 kB CSS (0) | — |
| Toast | 107.4 kB (+56 B) · 11.5 kB CSS (0) | — |
| TopNavMegaMenuFeaturedCard | 8.5 kB (+56 B) · 3.6 kB CSS (0) | — |
| lab/WeightedSVGIcon | 5.1 kB (+56 B) · 1.1 kB CSS (0) | — |
| AvatarStatusDot | 7.7 kB (+55 B) · 3.6 kB CSS (0) | — |
| Card | 10.4 kB (+55 B) · 7.0 kB CSS (0) | — |
| ChatDictationButton | 68.2 kB (+55 B) · 11.2 kB CSS (0) | — |
| ChatMessageBubble | 7.6 kB (+55 B) · 3.8 kB CSS (0) | — |
| DropdownMenuCheckboxItem | 29.4 kB (+55 B) · 7.6 kB CSS (0) | — |
| LayoutContent | 18.1 kB (+55 B) · 1.8 kB CSS (0) | — |
| Lightbox | 151.2 kB (+55 B) · 12.3 kB CSS (0) | — |
| Outline | 26.7 kB (+55 B) · 4.2 kB CSS (0) | — |
| RadioListItem | 78.1 kB (+55 B) · 11.1 kB CSS (0) | — |
| Switch | 111.1 kB (+55 B) · 10.4 kB CSS (0) | — |
| Timestamp | 31.3 kB (+55 B) · 11.4 kB CSS (0) | — |
| Typeahead | 94.9 kB (+55 B) · 14.4 kB CSS (0) | — |
| lab/ChatUnreadDivider | 3.8 kB (+55 B) · 348 B CSS (0) | — |
| AvatarGroupOverflow | 52.9 kB (+54 B) · 6.0 kB CSS (0) | — |
| Badge | 4.5 kB (+54 B) · 4.0 kB CSS (0) | — |
| CollapsibleGroup | 7.0 kB (+54 B) · 3.3 kB CSS (0) | — |
| CommandPaletteGroup | 3.7 kB (+54 B) · 3.5 kB CSS (0) | — |
| DrawerHeader | 71.0 kB (+54 B) · 14.3 kB CSS (0) | — |
| DropdownMenuDivider | 5.3 kB (+54 B) · 548 B CSS (0) | — |
| DropdownMenuItem | 28.6 kB (+54 B) · 7.1 kB CSS (0) | — |
| DropdownMenuRadioItem | 29.5 kB (+54 B) · 7.6 kB CSS (0) | — |
| HStack | 6.1 kB (+54 B) · 1.6 kB CSS (0) | — |
| NavIcon | 3.7 kB (+54 B) · 3.4 kB CSS (0) | — |
| ResizeHandle | 22.4 kB (+54 B) · 4.3 kB CSS (0) | — |
| Spinner | 26.8 kB (+54 B) · 6.6 kB CSS (0) | — |
| TypeaheadItem | 6.6 kB (+54 B) · 3.6 kB CSS (0) | — |
| VStack | 6.1 kB (+54 B) · 1.6 kB CSS (0) | — |
| lab/ChatReasoning | 7.3 kB (+54 B) · 967 B CSS (0) | — |
| lab/Stat | 4.4 kB (+54 B) · 646 B CSS (0) | — |
| AlertDialog | 133.1 kB (+53 B) · 16.2 kB CSS (0) | — |
| ClickableCard | 19.4 kB (+53 B) · 7.9 kB CSS (0) | — |
| Layout | 7.2 kB (+53 B) · 2.3 kB CSS (0) | — |
| NavHeadingMenu | 18.9 kB (+53 B) · 3.5 kB CSS (0) | — |
| Skeleton | 4.0 kB (+53 B) · 3.8 kB CSS (0) | — |
| Step | 32.3 kB (+53 B) · 5.7 kB CSS (0) | — |
| TextInput | 101.2 kB (+53 B) · 12.8 kB CSS (0) | — |
| lab/TabBar | 84.5 kB (+53 B) · 1.8 kB CSS (0) | — |
| Code | 3.8 kB (+52 B) · 3.5 kB CSS (0) | — |
| Collapsible | 29.6 kB (+52 B) · 4.5 kB CSS (0) | — |
| DialogHeader | 70.9 kB (+52 B) · 12.8 kB CSS (0) | — |
| IconButton | 67.6 kB (+52 B) · 11.1 kB CSS (0) | — |
| MetadataListItem | 7.1 kB (+52 B) · 3.6 kB CSS (0) | — |
| SideNav | 124.0 kB (+52 B) · 12.5 kB CSS (0) | — |
| Stack | 5.9 kB (+52 B) · 1.6 kB CSS (0) | — |
| lab/CircleCheckIndicator | 4.6 kB (+52 B) · 1.0 kB CSS (0) | — |
| lab/ListInput | 97.2 kB (+52 B) · 922 B CSS (0) | — |
| AspectRatio | 4.0 kB (+51 B) · 3.6 kB CSS (0) | — |
| Calendar | 78.8 kB (+51 B) · 11.8 kB CSS (0) | — |
| GridSpan | 3.7 kB (+51 B) · 3.4 kB CSS (0) | — |
| SelectableCard | 19.6 kB (+51 B) · 8.1 kB CSS (0) | — |
| SelectorOption | 24.7 kB (+51 B) · 6.8 kB CSS (0) | — |
| TableFooter | 3.6 kB (+51 B) · 3.3 kB CSS (0) | — |
| TableHeader | 3.6 kB (+51 B) · 3.3 kB CSS (0) | — |
| TableSelectionToolbar | 78.1 kB (+51 B) · 14.5 kB CSS (0) | — |
| Center | 4.4 kB (+50 B) · 4.6 kB CSS (0) | — |
| TabList | 48.5 kB (+50 B) · 6.8 kB CSS (0) | — |
| Stepper | 69.4 kB (+49 B) · 11.3 kB CSS (0) | — |
| TopNavHeading | 87.7 kB (+49 B) · 12.4 kB CSS (0) | — |
| AppShell | 100.9 kB (+48 B) · 14.9 kB CSS (0) | — |
| Grid | 4.6 kB (+48 B) · 3.8 kB CSS (0) | — |
| Heading | 14.1 kB (+48 B) · 5.8 kB CSS (0) | — |
| Citation | 21.2 kB (+47 B) · 4.5 kB CSS (0) | — |
| Pagination | 153.2 kB (+45 B) · 20.0 kB CSS (0) | — |
| TopNavMegaMenu | 81.7 kB (+45 B) · 13.0 kB CSS (0) | — |
| ChatSendButton | 68.0 kB (+44 B) · 11.1 kB CSS (0) | — |
| TopNavMenu | 87.2 kB (+44 B) · 12.4 kB CSS (0) | — |
| CodeBlock | 83.7 kB (+42 B) · 12.9 kB CSS (0) | — |
| lab/TourStep | 96.7 kB (+41 B) · 691 B CSS (0) | — |
| lab/NavigationScreen | 86.1 kB (+39 B) · 1.5 kB CSS (0) | — |
| lab/NavigationStack | 86.1 kB (+39 B) · 1.5 kB CSS (0) | — |
| Slider | 116.2 kB (+38 B) · 9.2 kB CSS (0) | — |
| Text | 13.3 kB (+37 B) · 5.8 kB CSS (0) | — |
| MobileNavToggle | 67.9 kB (+32 B) · 11.1 kB CSS (0) | — |
| SideNavHeading | 88.0 kB (+32 B) · 12.5 kB CSS (0) | — |
| MobileNav | 79.1 kB (+29 B) · 11.8 kB CSS (0) | — |
| lab/TabBarItem | 3.9 kB (0) · 1.8 kB CSS (0) | — |
Package size: @astryxdesign/core 7.92 MB packed (+163 B); no new dependencies.
Not run on this PR: add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
|
/approve-spec de353f5 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. Its workflow runs are waiting for a maintainer to approve them; the ci:run label is already applied.
The merge of main leaves this pull request's own changes untouched. The single-pass mergeProps still returns the same props as the previous implementation for every typed and untyped input checked, falsy style values included, and the public API is unchanged.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim, changeset: props merge in a single pass: verified (
mergeProps.ts:73spreads once,:80-89concatenates class names,:119-130builds one style object only for two or more styles). - Claim, changeset: no repeated intermediate object clones or array allocations during render: verified (one props copy at
:73; no arrays; a single style passes through as the same object at:122). - Claim, changeset: a patch release for
@astryxdesign/core: verified (no public API change; the changeset check passes). - Claim, description: fixes the linked issue: verified (one props copy per call; the issue's three call shapes give identical results).
- Claim, description: the old code merged in several passes, allocating intermediate object copies and filtering arrays: verified against the base file (a new props object, and a new style object when two styles meet, on each pass; the filtered array joined class names).
- Claim, description: spreads props once, concatenates class names, merges styles only when several are set: verified (
mergeProps.ts:73,:80-89,:119-130). - Claim, description: the unit tests pass: verified (24 of 24 on this head).
- Claim, description: the Core typecheck passes: verified on this head.
- File
.changeset/merge-props-single-pass.md: clear. - File
packages/core/src/utils/mergeProps.test.ts: clear; the falsy fourth-argument case fails against the first push's line and passes here. - File
packages/core/src/utils/mergeProps.ts: clear; the single-style pick and the spreads use the same truthiness test as the count.
|
/approve-spec a57b1d1 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet. Its workflow runs have started; build, typecheck, lint and the CLI smoke test pass, and the unit, interaction and accessibility suites are still running.
The single-pass mergeProps returns the same props as the previous implementation for every typed and untyped input checked, falsy style values included, and the public API is unchanged.
Claims and files checked
Review mode: same-head; reason: none
- Claim, changeset: props merge in a single pass: verified (
mergeProps.ts:73spreads once,:80-89concatenates class names,:119-130builds one style object only for two or more styles). - Claim, changeset: no repeated intermediate object clones or array allocations during render: verified (one props copy at
mergeProps.ts:73; no arrays; a single style passes through as the same object at:122). - Claim, changeset: a patch release for
@astryxdesign/core: verified (no public API change). - Claim, description: fixes the linked issue: verified (one props copy per call; the issue's three call shapes give identical results).
- Claim, description: the old code merged in several passes, allocating intermediate object copies and filtering arrays: verified against the base file (a new props object, and a new style object when two styles meet, on each pass; a filtered array joined class names).
- Claim, description: spreads props once, concatenates class names, merges styles only when several are set: verified (
mergeProps.ts:73,:80-89,:119-130). - Claim, description: the unit tests pass: verified (24 of 24 on these exact source and test files).
- Claim, description: the Core typecheck passes: verified (CI's typecheck passes on this head).
- File
.changeset/merge-props-single-pass.md: clear. - File
packages/core/src/utils/mergeProps.test.ts: clear; the falsy fourth-argument case fails against the first push's line and passes here. - File
packages/core/src/utils/mergeProps.ts: clear; the single-style pick and the spreads use the same truthiness test as the count.
|
(Posted by Cindy's agent.) Merged, thank you @TbhVishal! Props now merge in a single pass, so every component render does less work. It ships in the next release, with you credited. |
Fixes #12062
In
mergeProps.ts,mergePropsrepeatedly calledmergeTwoPropsin multiple passes, allocating intermediate object copies and filtering arrays forclassNameandstyle.Replaced the sequential passes with a single-pass merge that spreads props once, performs direct string concatenation for class names, and merges styles only when multiple styles are set.
Tested locally with:
pnpm exec vitest run packages/core/src/utils/mergeProps.test.tspnpm -F @astryxdesign/core typecheck