fix: inline window control icons to drop @tabler/icons-react barrel import - #40
Conversation
…mport (#39) Replace the barrel import of IconMinus/IconPlus/IconX from @tabler/icons-react with three inline SVG replicas in ControlIcons.tsx, matching Tabler's outline geometry and stroke attributes 1:1 (verified via SSR markup comparison). Also drops @tabler/icons-react from peerDependencies. This stops mantine-window from triggering the Rolldown/Vite LARGE_BARREL_MODULES optimizer warning and removes a peer dependency consumers previously had to install.
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces a new ChangesReplace tabler icon imports with local ControlIcons
Estimated code review effort: 2 (Simple) | ~10 minutes Related issues: Suggested labels: dependencies, enhancement Suggested reviewers: gfazioli 🥕📦, no more barrel to tow, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package/src/ControlIcons.tsx (1)
36-62: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider marking decorative icons as
aria-hidden.These SVGs are purely decorative controls inside buttons; adding
aria-hidden="true"on the<svg>wrapper would avoid redundant announcements by screen readers if the parent button lacks its own accessible name context.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package/src/ControlIcons.tsx` around lines 36 - 62, The ControlIcons SVGs are decorative and should be hidden from assistive tech to avoid redundant announcements. Update the shared ControlIcon wrapper used by IconX, IconPlus, and IconMinus to set aria-hidden="true" on the rendered svg, so these icons stay presentational inside the button controls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package/src/ControlIcons.tsx`:
- Around line 36-62: The ControlIcons SVGs are decorative and should be hidden
from assistive tech to avoid redundant announcements. Update the shared
ControlIcon wrapper used by IconX, IconPlus, and IconMinus to set
aria-hidden="true" on the rendered svg, so these icons stay presentational
inside the button controls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1265f725-3a7c-4948-ba9d-dd8af7b6c2bd
📒 Files selected for processing (3)
package/package.jsonpackage/src/ControlIcons.tsxpackage/src/Window.tsx
💤 Files with no reviewable changes (1)
- package/package.json
Addresses CodeRabbit review nitpick on PR #40: the control icons are always rendered inside an ActionIcon that carries its own aria-label (Close/Collapse/Expand window), so marking the SVGs aria-hidden avoids redundant screen-reader announcements. No visual change.
|
@coderabbitai addressed the |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
git log --oneline -5
git show 0af594b -- package/src/ControlIcons.tsx | head -100Length of output: 1493
[resolve] ᕦ(ò_óˇ)ᕤ |
Problem
Issue #39: consumers building
@gfazioli/mantine-windowin a Vite SSR project (Rolldown optimizer) get aLARGE_BARREL_MODULESwarning during dependency optimization, because the package importedIconMinus/IconPlus/IconXfrom the@tabler/icons-reactbarrel (6149 re-exports). Since@tabler/icons-reactwas an external peer dependency, the publisheddistpreserved the barrel import.Scope note: this is a dev/SSR dependency-optimization warning, not a runtime or production-build error.
@tabler/icons-reactshipssideEffects: false, so production bundles were already tree-shaken down to the 3 icons, and the barrel itself belongs to Tabler rather than to this package. Even so, the package can avoid contributing to the warning altogether.Fix
package/src/ControlIcons.tsxwith three inline SVG icons (IconX,IconPlus,IconMinus) — geometry and stroke attributes copied 1:1 from@tabler/icons-reactv3.44.0 outline icons.Window.tsxnow imports the control icons from./ControlIconsinstead of the Tabler barrel.@tabler/icons-reactfrompeerDependencies— consumers no longer need to install it for this component.The
@rolldown/plugin-transform-importsapproach suggested in the issue was not applicable: this package builds with Rollup, not Rolldown. Inlining the three trivial control icons is the same approach Mantine core itself uses (CloseButtonrenders an inline SVG), removes a peer dependency, and eliminates the warning at the source.Verification
distno longer contains any real@tabler/icons-reactimport/require.renderToStaticMarkup): the SVG emitted by each inline icon is byte-for-byte identical to Tabler's (modulo the unusedtabler-iconclassName — no stylesheet targets it).yarn testgreen: format + typecheck (package + docs) + lint + jest 154/154.Closes #39
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Chores