Skip to content

Store ZIndexPortal refs instead of IDs to unblock shadow DOM#6753

Merged
PavelVanecek merged 2 commits intomainfrom
shadowdom
Dec 10, 2025
Merged

Store ZIndexPortal refs instead of IDs to unblock shadow DOM#6753
PavelVanecek merged 2 commits intomainfrom
shadowdom

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Dec 9, 2025

Description

document.getElementById is not available inside a shadow DOM so we can't use that.

Related Issue

Fixes #6752

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes

Summary by CodeRabbit

  • New Features

    • Added a new Shadow DOM example demonstrating how to render charts within a shadow DOM container using ZIndexLayer.
  • Tests

    • Updated z-index portal tests to reflect internal rendering approach changes; test coverage and functionality remain unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

The pull request refactors the z-index registry to track DOM Element references instead of string IDs. Changes span the state slice, selectors, portal components, and tests, updating registration/unregistration actions to carry actual element objects and adjusting all consumer code accordingly. A new shadow DOM example is added.

Changes

Cohort / File(s) Change Summary
State Management
src/state/zIndexSlice.ts
Updated ZIndexEntry to store element and panoramaElement (Element | undefined) instead of string IDs. Renamed actions to registerZIndexPortalElement and unregisterZIndexPortalElement with payload type changed from elementId: string to element: Element. Added castDraft import for immer integration.
Selectors & Core Logic
src/zIndex/zIndexSelectors.ts
Renamed selector from selectZIndexPortalId to selectZIndexPortalElement with return type changed from string | undefined to Element | undefined. Updated internal field access to use panoramaElement/element references.
Portal Components
src/zIndex/ZIndexPortal.tsx, src/zIndex/ZIndexLayer.tsx
ZIndexPortal: Added useRef<SVGGElement> to capture portal element directly; removed portalId and id attribute; dispatch now sends element reference via ref.current. ZIndexLayer: Updated selector call and portal lookup to use Element reference instead of ID-based document.getElementById.
Tests
test/zIndex/zIndexSelectors.spec.ts, test/zIndex/AllZIndexPortals.spec.tsx
Updated test suites to construct and dispatch DOM element references instead of string IDs. AllZIndexPortals.spec changed selector from [id^="recharts-zindex"] to g[tabindex="-1"] and added isNotNil filtering for element ID extraction.
Visual Regression Test
test-vr/tests/www/ZIndex.spec-vr.tsx
Added new Playwright test for ShadowDomExample component with snapshot assertion.
Documentation & Examples
www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx, www/src/docs/apiExamples/ZIndexLayer/index.tsx
Added new ShadowDomExample component demonstrating chart rendering into a closed shadow DOM. Created ShadowDomWrapper helper and registered example in the ZIndexLayer API documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • State slice logic: Review the castDraft integration and element reference assignment flow in reducers
  • Selector implementation: Verify correct field access for panorama/main element references and undefined handling
  • Portal ref management: Ensure useRef lifecycle and ref.current dispatch timing are correct in ZIndexPortal
  • Test expectations: Confirm DOM selector changes (g[tabindex="-1"]) align with rendering logic and that element ID extraction from state is properly filtered

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • ckifer

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: refactoring from storing element IDs to storing element refs to support shadow DOM usage.
Description check ✅ Passed The description covers key sections: explains the problem (document.getElementById unavailable in shadow DOM), links a related issue, specifies it as a bug fix, and confirms tests and VR tests were added.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch shadowdom

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1)

21-40: Consider memoizing or stabilizing children to avoid unnecessary re-renders.

Including children in the dependency array will cause the shadow DOM content to unmount and remount on every parent render, since children is typically a new object reference each time. For a documentation example this may be acceptable, but in production usage this pattern could cause performance issues and state loss.

If this is intentional for demonstration purposes, a brief comment explaining the trade-off would help future readers.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 670ebbe and 62ffdaa.

⛔ Files ignored due to path filters (3)
  • test-vr/__snapshots__/tests/www/ZIndex.spec-vr.tsx-snapshots/ShadowDomExample-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/ZIndex.spec-vr.tsx-snapshots/ShadowDomExample-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/ZIndex.spec-vr.tsx-snapshots/ShadowDomExample-1-webkit-linux.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • src/state/zIndexSlice.ts (5 hunks)
  • src/zIndex/ZIndexLayer.tsx (2 hunks)
  • src/zIndex/ZIndexPortal.tsx (1 hunks)
  • src/zIndex/zIndexSelectors.ts (2 hunks)
  • test-vr/tests/www/ZIndex.spec-vr.tsx (1 hunks)
  • test/zIndex/AllZIndexPortals.spec.tsx (3 hunks)
  • test/zIndex/zIndexSelectors.spec.ts (4 hunks)
  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1 hunks)
  • www/src/docs/apiExamples/ZIndexLayer/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx}: Never use any type (implicit or explicit) in TypeScript code
Prefer unknown over any and refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not use as type assertions in TypeScript; the only exception is as const

Files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
  • src/zIndex/ZIndexPortal.tsx
  • src/zIndex/zIndexSelectors.ts
  • src/zIndex/ZIndexLayer.tsx
  • www/src/docs/apiExamples/ZIndexLayer/index.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
  • src/state/zIndexSlice.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Ensure code lints by running npm run lint and follows Airbnb's Style Guide

Files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
  • src/zIndex/ZIndexPortal.tsx
  • src/zIndex/zIndexSelectors.ts
  • src/zIndex/ZIndexLayer.tsx
  • www/src/docs/apiExamples/ZIndexLayer/index.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
  • src/state/zIndexSlice.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (DEVELOPING.md)

All imports from recharts must use the public API entry point; imports from internal paths like recharts/types/* or recharts/src/* are not allowed

Files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
  • src/zIndex/ZIndexPortal.tsx
  • src/zIndex/zIndexSelectors.ts
  • src/zIndex/ZIndexLayer.tsx
  • www/src/docs/apiExamples/ZIndexLayer/index.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
  • src/state/zIndexSlice.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode any strings or formatting choices in library code; users should provide localized strings as desired

Files:

  • src/zIndex/ZIndexPortal.tsx
  • src/zIndex/zIndexSelectors.ts
  • src/zIndex/ZIndexLayer.tsx
  • src/state/zIndexSlice.ts
test/**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Aim for 100% unit test code coverage when writing new code

Files:

  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
test/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (test/README.md)

test/**/*.{test,spec}.{ts,tsx}: Aim for 100% unit test code coverage when writing new code
Prefer to use the createSelectorTestCase helper function when writing or modifying tests
Use the expectLastCalledWith helper function instead of expect(spy).toHaveBeenLastCalledWith(...) for better typing and autocompletion
Verify the number of selector calls using the spy object from createSelectorTestCase to spot unnecessary re-renders and improve performance
Mock getBoundingClientRect in tests using the helper function provided in test/helper/MockGetBoundingClientRect.ts
Use vi.useFakeTimers() in all tests due to Redux autoBatchEnhancer dependency on timers and requestAnimationFrame
Call vi.runOnlyPendingTimers() to advance timers after renders when not using createSelectorTestCase helper, and avoid vi.runAllTimers() to prevent infinite loops
Use userEvent.setup({ advanceTimers: vi.runOnlyPendingTimers }) or the userEventSetup helper function from test/helper/userEventSetup.ts when creating userEvent instances
When testing tooltips on hover, use vi.runOnlyPendingTimers() after each userEvent.hover() call or use the showTooltip helper function from tooltipTestHelpers.ts to account for requestAnimationFrame delays

Files:

  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

When running unit tests, prefer to run a single test file using npm run test -- path/to/TestFile.spec.tsx rather than running all tests with npm test

Files:

  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
🧠 Learnings (11)
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Verify the number of selector calls using the spy object from `createSelectorTestCase` to spot unnecessary re-renders and improve performance

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • src/zIndex/zIndexSelectors.ts
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to test/component/**/*.spec.tsx : Use React Testing Library for testing component interactions and behavior upon rendering

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Use `vi.useFakeTimers()` in all tests due to Redux autoBatchEnhancer dependency on timers and `requestAnimationFrame`

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • test/zIndex/zIndexSelectors.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Mock `getBoundingClientRect` in tests using the helper function provided in `test/helper/MockGetBoundingClientRect.ts`

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Call `vi.runOnlyPendingTimers()` to advance timers after renders when not using `createSelectorTestCase` helper, and avoid `vi.runAllTimers()` to prevent infinite loops

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to storybook/stories/**/*.stories.tsx : Use Storybook for smoke tests and add play functions with assertions for actual tests

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • test/zIndex/zIndexSelectors.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Prefer to use the `createSelectorTestCase` helper function when writing or modifying tests

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • test/zIndex/zIndexSelectors.spec.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : When testing tooltips on hover, use `vi.runOnlyPendingTimers()` after each `userEvent.hover()` call or use the `showTooltip` helper function from `tooltipTestHelpers.ts` to account for requestAnimationFrame delays

Applied to files:

  • test-vr/tests/www/ZIndex.spec-vr.tsx
  • test/zIndex/zIndexSelectors.spec.ts
📚 Learning: 2025-11-23T13:30:10.395Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.

Applied to files:

  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
  • src/zIndex/zIndexSelectors.ts
  • test/zIndex/AllZIndexPortals.spec.tsx
  • src/state/zIndexSlice.ts
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All imports from `recharts` must use the public API entry point; imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed

Applied to files:

  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
📚 Learning: 2025-11-16T09:14:24.918Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6640
File: src/cartesian/Bar.tsx:156-159
Timestamp: 2025-11-16T09:14:24.918Z
Learning: In recharts, SSR (Server-Side Rendering) is not yet supported—charts don't render at all in SSR environments. The `isAnimationActive: 'auto'` mode is preparatory work for future SSR support, so testing of this mode should be deferred until SSR support is actually implemented.

Applied to files:

  • www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx
🧬 Code graph analysis (8)
test-vr/tests/www/ZIndex.spec-vr.tsx (1)
www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1)
  • ShadowDomExample (53-73)
www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1)
storybook/stories/API/props/AnimationProps.ts (1)
  • isAnimationActive (29-36)
src/zIndex/ZIndexPortal.tsx (1)
src/state/hooks.ts (1)
  • useAppDispatch (9-15)
src/zIndex/zIndexSelectors.ts (1)
src/state/store.ts (1)
  • RechartsRootState (23-38)
src/zIndex/ZIndexLayer.tsx (2)
src/state/hooks.ts (1)
  • useAppSelector (40-50)
src/zIndex/zIndexSelectors.ts (1)
  • selectZIndexPortalElement (13-34)
www/src/docs/apiExamples/ZIndexLayer/index.tsx (2)
www/src/docs/exampleComponents/types.ts (1)
  • ChartExample (3-23)
www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1)
  • ShadowDomExample (53-73)
test/zIndex/zIndexSelectors.spec.ts (2)
src/state/store.ts (1)
  • createRechartsStore (57-110)
src/zIndex/zIndexSelectors.ts (2)
  • selectZIndexPortalElement (13-34)
  • selectAllRegisteredZIndexes (36-50)
test/zIndex/AllZIndexPortals.spec.tsx (1)
src/util/DataUtils.ts (1)
  • isNotNil (202-204)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build, Test, Pack
🔇 Additional comments (15)
www/src/docs/apiExamples/ZIndexLayer/index.tsx (1)

4-5: LGTM!

The new ShadowDomExample is correctly imported and added to the examples array following the established pattern. The structure matches the ChartExample type requirements.

Also applies to: 13-17

test-vr/tests/www/ZIndex.spec-vr.tsx (1)

11-14: LGTM!

The VR test correctly disables animations for deterministic screenshot comparisons, following the same pattern as the existing PrahaMetro test.

src/zIndex/ZIndexLayer.tsx (1)

90-92: Clean refactor that correctly addresses the shadow DOM limitation.

The change from document.getElementById to direct element references is the right approach. React's createPortal accepts Element | DocumentFragment as the container, so passing the element reference directly is valid and avoids the shadow DOM boundary issue.

Also applies to: 99-108

src/zIndex/zIndexSelectors.ts (1)

13-34: LGTM!

The selector is correctly updated with explicit return type Element | undefined. The logic properly accesses the new element-based state structure while maintaining the same null-checking pattern.

test/zIndex/AllZIndexPortals.spec.tsx (2)

39-40: Good adaptation to element-based portal handling.

Using g[tabindex="-1"] as the selector is a reasonable approach since ZIndexPortal components render <g> elements with this attribute. This decouples the test from the previous ID-based implementation.

Also applies to: 48-49


65-82: Thoughtful handling of element comparison edge case.

The comment explaining why IDs are compared instead of element references directly (to avoid React warnings about accessing internal properties) is helpful for future maintainers. The isNotNil filter correctly handles cases where entry.element might be undefined.

www/src/docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx (1)

53-73: LGTM!

The example component properly demonstrates shadow DOM usage with Recharts, using correct public API imports and appropriate prop types.

test/zIndex/zIndexSelectors.spec.ts (4)

18-36: LGTM!

The test correctly verifies element-based portal registration and selection. It properly creates distinct DOM elements for each test case and validates that the selector returns the correct element references after registration and undefined after unregistration.


38-55: LGTM!

Good coverage of edge cases including undefined zIndex handling and proper differentiation between panorama and main chart element registrations at the same z-index.


104-111: LGTM!

Good addition to verify that element registration doesn't affect the zIndex list memoization, ensuring the selector properly separates concerns between portal existence and element references.


127-149: LGTM!

Thorough test coverage for element registration/unregistration behavior, correctly verifying that the zIndex list remains stable and memoized when only element references change.

src/zIndex/ZIndexPortal.tsx (1)

7-20: LGTM!

The migration from ID-based to ref-based portal registration is well implemented. The conditional registration check (if (ref.current)) correctly guards against null refs, and the cleanup properly unregisters using only zIndex and isPanorama. This approach will work correctly in shadow DOM contexts where document.getElementById is unavailable.

src/state/zIndexSlice.ts (3)

91-109: LGTM!

The use of castDraft from Immer is the correct approach for storing DOM Element references in Redux state. This works well because serializableCheck is already disabled in the store configuration (src/state/store.ts).

The implementation correctly handles both registration into existing entries and creation of new entries with proper conditional assignment based on isPanorama.


110-122: LGTM!

The unregistration correctly only clears the element reference without affecting the consumer count or entry existence. This maintains proper separation between portal lifecycle (registerZIndexPortal/unregisterZIndexPortal) and element reference management.


10-26: LGTM!

The type documentation is well updated to reflect the shift from element IDs to Element references. The explanation about the "registration in progress" state (undefined element) is helpful for understanding the two-phase registration pattern.

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 56.86275% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.82%. Comparing base (670ebbe) to head (62ffdaa).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../docs/apiExamples/ZIndexLayer/ShadowDomExample.tsx 18.51% 44 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6753      +/-   ##
==========================================
- Coverage   93.91%   93.82%   -0.09%     
==========================================
  Files         514      515       +1     
  Lines       42833    42897      +64     
  Branches     4991     4989       -2     
==========================================
+ Hits        40227    40249      +22     
- Misses       2600     2642      +42     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@codecov
Copy link

codecov bot commented Dec 9, 2025

Bundle Report

Changes will decrease total bundle size by 552 bytes (-0.02%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.16MB -195 bytes (-0.02%) ⬇️
recharts/bundle-es6 1.0MB -250 bytes (-0.02%) ⬇️
recharts/bundle-umd 519.89kB -107 bytes (-0.02%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
state/zIndexSlice.js 76 bytes 4.77kB 1.62%
zIndex/ZIndexLayer.js -221 bytes 2.94kB -6.99%
zIndex/ZIndexPortal.js -113 bytes 1.82kB -5.85%
zIndex/zIndexSelectors.js 8 bytes 1.25kB 0.65%
view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
state/zIndexSlice.js 150 bytes 5.4kB 2.85%
zIndex/ZIndexLayer.js -226 bytes 3.14kB -6.72%
zIndex/ZIndexPortal.js -137 bytes 2.59kB -5.02%
zIndex/zIndexSelectors.js 18 bytes 1.52kB 1.2%
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js -107 bytes 519.89kB -0.02%

@PavelVanecek PavelVanecek requested a review from ckifer December 9, 2025 23:47
Copy link
Member

@ckifer ckifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any downsides to doing this at all besides storing more unserializable state?

@PavelVanecek
Copy link
Collaborator Author

Jest/vitest don't like tests with elements in them, the error message was quite cryptic. Everything else seems to work fine.

@PavelVanecek PavelVanecek merged commit ee0b17b into main Dec 10, 2025
37 of 40 checks passed
@PavelVanecek PavelVanecek deleted the shadowdom branch December 10, 2025 01:18
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.

2 participants