Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive React 19 support to the visx library while maintaining backward compatibility with React 16.14+. The changes enable automatic JSX runtime transformation, standardize module exports across all packages, and update the demo application to React 19 and Next.js 15.
Key changes:
- Removed manual
Reactimports from component files across all packages (leveraging automatic JSX transform) - Added
exportsfield to all package.json files for improved ESM/CJS resolution and tree-shaking - Standardized React peerDependencies to
^16.14.0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0across all packages
Reviewed Changes
Copilot reviewed 299 out of 311 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/visx-xychart/test/components/AreaStack.test.tsx | Fixed React 19 key prop warnings by using inline string literals instead of spreading key from object |
| packages/visx-xychart/test/components/AreaSeries.test.tsx | Updated test to avoid spreading key prop and use inline string literals |
| packages/visx-xychart/src/components/Tooltip.tsx | Refactored to prevent key prop spreading in React 19 |
| packages/visx-xychart/src/utils/*.ts | Migrated from deep imports to package root imports |
| packages/visx-xychart/package.json | Added exports field and updated React/react-spring peerDependencies |
| packages/*/src/index.ts | Added explicit type exports using export type * pattern |
| packages/*/package.json | Added exports field and standardized React peerDependency version |
| packages/visx-demo/* | Updated demo sandboxes to use package root imports instead of deep imports |
| babel.config.js | Enabled automatic JSX runtime |
| .eslintrc.js | Disabled react-in-jsx-scope rule for automatic JSX transform |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Size Changes
View raw build statsPrevious (master){
"visx-annotation": {
"esm": 28559,
"lib": 36491
},
"visx-axis": {
"esm": 20709,
"lib": 25119
},
"visx-bounds": {
"esm": 2662,
"lib": 3136
},
"visx-brush": {
"esm": 52910,
"lib": 55596
},
"visx-chord": {
"esm": 2663,
"lib": 3373
},
"visx-clip-path": {
"esm": 3394,
"lib": 4415
},
"visx-curve": {
"esm": 336,
"lib": 1475
},
"visx-delaunay": {
"esm": 2305,
"lib": 3035
},
"visx-demo": {
"esm": 0,
"lib": 0
},
"visx-drag": {
"esm": 12368,
"lib": 13865
},
"visx-event": {
"esm": 3815,
"lib": 5091
},
"visx-geo": {
"esm": 12450,
"lib": 15408
},
"visx-glyph": {
"esm": 12256,
"lib": 15780
},
"visx-gradient": {
"esm": 15496,
"lib": 19482
},
"visx-grid": {
"esm": 16678,
"lib": 19853
},
"visx-group": {
"esm": 1251,
"lib": 1681
},
"visx-heatmap": {
"esm": 6399,
"lib": 7278
},
"visx-hierarchy": {
"esm": 10161,
"lib": 14656
},
"visx-legend": {
"esm": 23920,
"lib": 29153
},
"visx-marker": {
"esm": 7834,
"lib": 9673
},
"visx-mock-data": {
"esm": 326036,
"lib": 329336
},
"visx-network": {
"esm": 4124,
"lib": 5913
},
"visx-pattern": {
"esm": 9161,
"lib": 11621
},
"visx-point": {
"esm": 1003,
"lib": 1781
},
"visx-react-spring": {
"esm": 13119,
"lib": 16134
},
"visx-responsive": {
"esm": 15447,
"lib": 17439
},
"visx-sankey": {
"esm": 3278,
"lib": 4160
},
"visx-scale": {
"esm": 19205,
"lib": 30085
},
"visx-shape": {
"esm": 82414,
"lib": 102780
},
"visx-stats": {
"esm": 12881,
"lib": 13990
},
"visx-text": {
"esm": 8309,
"lib": 9806
},
"visx-threshold": {
"esm": 2386,
"lib": 2946
},
"visx-tooltip": {
"esm": 13934,
"lib": 18441
},
"visx-vendor": {
"esm": 2974,
"lib": 3226
},
"visx-visx": {
"esm": 1524,
"lib": 3989
},
"visx-voronoi": {
"esm": 2013,
"lib": 2621
},
"visx-wordcloud": {
"esm": 2423,
"lib": 3192
},
"visx-xychart": {
"esm": 171585,
"lib": 216557
},
"visx-zoom": {
"esm": 16001,
"lib": 18276
}
}Current{
"visx-annotation": {
"esm": 19623,
"lib": 23755
},
"visx-axis": {
"esm": 13345,
"lib": 18132
},
"visx-bounds": {
"esm": 1476,
"lib": 1915
},
"visx-brush": {
"esm": 41979,
"lib": 44001
},
"visx-chord": {
"esm": 1886,
"lib": 2683
},
"visx-clip-path": {
"esm": 1488,
"lib": 2713
},
"visx-curve": {
"esm": 336,
"lib": 2594
},
"visx-delaunay": {
"esm": 1448,
"lib": 2489
},
"visx-demo": {
"esm": 0,
"lib": 0
},
"visx-drag": {
"esm": 9039,
"lib": 11025
},
"visx-event": {
"esm": 3533,
"lib": 5257
},
"visx-geo": {
"esm": 8044,
"lib": 11674
},
"visx-glyph": {
"esm": 7177,
"lib": 11421
},
"visx-gradient": {
"esm": 6854,
"lib": 11581
},
"visx-grid": {
"esm": 9578,
"lib": 12892
},
"visx-group": {
"esm": 484,
"lib": 1030
},
"visx-heatmap": {
"esm": 3473,
"lib": 4564
},
"visx-hierarchy": {
"esm": 8620,
"lib": 13458
},
"visx-legend": {
"esm": 14783,
"lib": 20754
},
"visx-marker": {
"esm": 3806,
"lib": 6120
},
"visx-mock-data": {
"esm": 325619,
"lib": 330728
},
"visx-network": {
"esm": 3041,
"lib": 5105
},
"visx-pattern": {
"esm": 7332,
"lib": 10317
},
"visx-point": {
"esm": 761,
"lib": 1901
},
"visx-react-spring": {
"esm": 8675,
"lib": 11009
},
"visx-responsive": {
"esm": 9021,
"lib": 11514
},
"visx-sankey": {
"esm": 2482,
"lib": 3894
},
"visx-scale": {
"esm": 18804,
"lib": 30918
},
"visx-shape": {
"esm": 51794,
"lib": 74614
},
"visx-stats": {
"esm": 9234,
"lib": 10690
},
"visx-text": {
"esm": 5939,
"lib": 7453
},
"visx-threshold": {
"esm": 2045,
"lib": 2758
},
"visx-tooltip": {
"esm": 9156,
"lib": 13672
},
"visx-vendor": {
"esm": 2974,
"lib": 3226
},
"visx-visx": {
"esm": 1524,
"lib": 3999
},
"visx-voronoi": {
"esm": 1281,
"lib": 2088
},
"visx-wordcloud": {
"esm": 1968,
"lib": 2995
},
"visx-xychart": {
"esm": 125096,
"lib": 155595
},
"visx-zoom": {
"esm": 12485,
"lib": 14835
}
} |
- Removed IE 11 from targets - Added specific modern browser versions (Chrome 108+, Firefox 133+, Safari 15.6+, etc.) - Changed loose: false for stricter transpilation - Added useBuiltIns and useSpread optimizations to React preset
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 299 out of 396 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version |
This PR adds React 19 support to visx with automatic JSX transform and improves module resolution across all packages.
💥 Breaking Changes
Reactimports have been removed from component files across all packages.^16.14.0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0(previously varied between^16.0.0-0,^16.3.0-0, and^16.8.0-0). This ensures consistent minimum version requirements across all visx packages.🚀 Enhancements
exportsfield to all package.json files for better ESM/CJS module resolution and tree-shaking supportimport { Foo } from '@visx/shape'instead ofimport Foo from '@visx/shape/lib/shapes/Foo')^16.14.0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0🐛 Bug Fix
keyprop in Tooltip component and test files🏠 Internal
loose: false) and React preset optimizations (useBuiltIns,useSpread)Note: This PR maintains backward compatibility with React 16.14+ while adding full support for React 19. No API changes are required for existing users, though updating bundler configurations to leverage the new
exportsfield is recommended for optimal tree-shaking.IE 11 and legacy browser support has been dropped in favor of modern browser targets. If you still need to support IE 11:
node_modules/@visx/*packages with your own Babel/TypeScript configuration targeting IE 11Closes