Skip to content

perf(renderer): load Radix primitives through public package entries - #26256

Merged
nwparker merged 1 commit into
mainfrom
nwparker/radix-published-leaf-imports
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/radix-published-leaf-imports

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Loading a small UI component currently pulls in the broad Radix entry during tests. Use each component's published package entry to reduce that import work while retaining its implementation.

What Changed

Replace 30 radix-ui root imports with public radix-ui/<primitive> entries. Component bodies, styles, refs, events, dependencies and lockfile remain byte-identical. The entries resolve to the same primitive implementations, including cmdk's separate Dialog version.

Why

These existing public entries remove unnecessary imports without adding a transform, dependency or isolation exception. A separate three-suite import observation retained Slot and removed the root entry; it did not trace native package internals or establish exclusive import costs.

Linked Issue

Related test performance work: #26250 and #26237. Incoming manifest lint blocker repaired in #26342.

Visual Proof

N/A — import paths only; no appearance or interaction change.

Testing

Before/after measurements below use frozen source 76d1b7bf29932f6e1edfb6b0b34d65c5c88e5f55, unchanged project setup and routing, isolation, four workers and filesystem module cache disabled. Every sample measures a complete pnpm test command through normal exit. Exact case/status maps, zero errors and process checks passed. All first, slower and regressing samples are retained; no warmup, retry or discard.

The broader measured cohort contains 130 original cases across 20 existing DOM suites:

Pair Before After Less time
1 7.252925s 5.352823s 26.20%
2 5.465424s 5.270446s 3.57%
3 5.474653s 5.313166s 2.95%
Mean 6.064334s 5.312145s 12.40%

All three broader pairs improved. The slower first qualified baseline is retained and contributes substantially to the mean; the other paired improvements are 3.57% and 2.95%. No sample was rejected, retried or discarded.

The first, smaller cohort contained 17 original cases across three Slot-heavy suites. Its mixed result prompted the broader measurement; every original sample remains here:

Pair Before After Less time
1 3.921457s 3.381347s 13.77%
2 5.278951s 4.122843s 21.90%
3 3.361083s 3.523278s -4.83%
Mean 4.187164s 3.675823s 12.21%

The third small-cohort pair regressed by 4.83%; it remains included. These cohorts do not measure the marginal benefit of all 30 changes against a Button-only alternative, stock warm-cache CI, or the complete test suite. They do not establish the overall 2× goal.

  • Eight correctness commands under Bun and actual Node, shuffled with seeds 104729/130363, retained all 130 original cases. The 21 temporary namespace identity checks passed in candidate qualification and were neither shipped nor timed.
  • Normal rebase onto merged main 7abd74e8187d39cbdc8ff127969c5cd384a2a20b; new head ba90fc7994e823d6ac4f557e689d155e41ec9bea. All 30 incoming and candidate files retain their qualified bytes. Upstream work is preserved.
  • Fresh changed-code checks and pnpm tc:web pass locally on macOS with background launch policy.
  • Fresh renderer build and boot-graph verification pass locally.
  • Fresh full CI 37700715594 passed on this head: all ten unit shards, static analysis/typecheck, relay integration, Linux/Windows package checks and selection evidence. All 35 checks completed: 19 passed, 16 explicit skips, no failures.

The timings retain their original source labels; they are not measurements of the newer complete main tree. No native integration or app was launched on the user's desktop.

Review

Independent source, import, correctness and all 12 timing reviews passed. Root verifies the 30 exact files after this rebase. CodeRabbit's review covered older head c3e400b3 with no actionable findings; bot coverage of the new head is not assumed. Fresh current-head checks passed; no unresolved review threads or actionable findings remain. Independent source review also verifies all 30 namespace uses retain their implementation bindings. No fresh bot coverage is claimed.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Notes

No SSH execution, folder/worktree ownership, remote protocol, platform behavior or runtime-authority changes. Import overlap and mocks prevent a whole-suite forecast. These measurements do not establish the overall 2× goal.

All four earlier failed full-CI attempts remain failures and are preserved:

Run Preserved result
37651067018 Runner communication loss; four shards passed, outcomes for 2,336 assigned files unknown. Cause unproved.
37663223570 Real watcher missed an 8s deadline; 11,681 files all reported, one failed case. Matching-byte Bun successes retained. Separate actual-Node runtime correction merged in #26315; causality from these imports unproved.
37684295554 All ten unit shards passed (11,715 files; 112,984 passing cases, three expected failures and 1,052 skips), Windows writer contract failed its 2s request deadline. Phase/cause unknown.
37692440583 Static analysis rejected incoming manifest 304 code lines against limit 300; downstream skips do not count as passes. #26342 now merged.

The separate Windows diagnostic first rejected LF/CRLF source preflight before launching contracts; the corrected definition ran all 60 native files successfully but its frozen collector rejected an inactive project name. Independent raw analysis passed; that workflow remains failed, the original Windows timeout was not reproduced, and no Windows repair is claimed. The new integration includes actual source changes since each failed attempt; it is not an unchanged retry or a repair claim for unknown failures.

Checklist

  • Focused change; before/after, mechanism and alternatives explained.
  • N/A visual proof explained; original tests retained.
  • Self-reviewed and independently checked; cross-platform and SSH considered.
  • Fresh full CI and review disposition complete before merge.

Pre-merge main also contains relay-only #26350 (a07f4b2cbd95), whose ten cloud/workflow paths do not overlap the 30 import targets or test runtime configuration. All 30 incoming bytes remain exact. CI above covers the qualified PR head; it does not cover this later relay-only commit as part of the eventual combined squash tree.

Merged squash de4ee59cba964d45489a2fbc3ab1a2f7937557aa has actual parent b1e09a4c8e8a9ebfaa3b798692c5d6c5412b4b02. Root checked that exactly the 30 qualified target paths changed and every before/after byte matches. Between pre-merge inspection and squash, main gained #25845 (OpenCode structured chat) and #26334 (remote chat history), in addition to relay-only #26350. The actual parent therefore includes all three later upstream commits. Every one of the 30 incoming and candidate files remains exact. Qualified-head CI does not cover these extra commits as part of the combined squash tree.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a002d664-fa62-42f3-bed4-329d47786a6f
📥 Commits

Reviewing files that changed from the base of the PR and between a576c0b and c3e400b.

📒 Files selected for processing (30)
  • src/renderer/src/components/JiraIssueWorkspace.tsx
  • src/renderer/src/components/LinearIssueWorkspace.tsx
  • src/renderer/src/components/artifacts/ArtifactDetailDrawer.tsx
  • src/renderer/src/components/file-path-cursor-tooltip.tsx
  • src/renderer/src/components/github-project/ProjectItemSlugDialog.tsx
  • src/renderer/src/components/gitlab-item-dialog/gitlab-item-dialog-view.tsx
  • src/renderer/src/components/linear-item-drawer-sheet.tsx
  • src/renderer/src/components/ui/accordion.tsx
  • src/renderer/src/components/ui/badge.tsx
  • src/renderer/src/components/ui/button.tsx
  • src/renderer/src/components/ui/checkbox.tsx
  • src/renderer/src/components/ui/collapsible.tsx
  • src/renderer/src/components/ui/command.tsx
  • src/renderer/src/components/ui/context-menu.tsx
  • src/renderer/src/components/ui/dialog.tsx
  • src/renderer/src/components/ui/dropdown-menu.tsx
  • src/renderer/src/components/ui/hover-card.tsx
  • src/renderer/src/components/ui/label.tsx
  • src/renderer/src/components/ui/popover.tsx
  • src/renderer/src/components/ui/progress.tsx
  • src/renderer/src/components/ui/scroll-area.tsx
  • src/renderer/src/components/ui/select.tsx
  • src/renderer/src/components/ui/separator.tsx
  • src/renderer/src/components/ui/sheet.tsx
  • src/renderer/src/components/ui/slider.tsx
  • src/renderer/src/components/ui/switch.tsx
  • src/renderer/src/components/ui/tabs.tsx
  • src/renderer/src/components/ui/toggle-group.tsx
  • src/renderer/src/components/ui/toggle.tsx
  • src/renderer/src/components/ui/tooltip.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Renderer components now import Radix primitives from component-specific subpaths instead of the package root. Components that use VisuallyHidden now reference its Root export. The summaries report no changes to component behavior or exported declarations.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to c3e40

This change loads Radix primitives through their dedicated package entries to reduce load work. No behavior change or merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 30 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: loading Radix primitives through their public package entries for renderer performance.
Description check ✅ Passed The description covers all required sections, explains the change and rationale, documents testing and performance results, provides visual-proof justification, and records review and compatibility co…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the nwparker/radix-published-leaf-imports branch 4 times, most recently from 1ab47cf to 9a0dbbd Compare October 7, 2026 21:52
@nwparker
nwparker force-pushed the nwparker/radix-published-leaf-imports branch from 9a0dbbd to ba90fc7 Compare October 7, 2026 23:10
@nwparker
nwparker merged commit de4ee59 into main Oct 7, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant