feat(v6): recharts rewrite + Next.js 16 docs + remove echarts-theme-rsuite#104
feat(v6): recharts rewrite + Next.js 16 docs + remove echarts-theme-rsuite#104
Conversation
- Replace ECharts/echarts-for-react with recharts v2.15.4 - New ChartContainer with responsive sizing, empty state, loading state - Chart wrappers: BarChart, LineChart, AreaChart, ComposedChart, ScatterChart, PieChart, RadarChart, RadialBarChart, Treemap, FunnelChart - Styled components: XAxis, YAxis, CartesianGrid, Tooltip, Legend, Brush - Series: Bar, Line, Area, Scatter, Pie/Cell, Radar, RadialBar, Funnel - Auto color cycling using rsuite palette - Full TypeScript support - Updated README with new API docs Agent-Logs-Url: https://github.com/rsuite/charts/sessions/de933675-a809-4e04-b6f4-36e7a85872c5 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rsuite/charts/sessions/de933675-a809-4e04-b6f4-36e7a85872c5 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rsuite/charts/sessions/b2c56f25-d3a0-4233-be80-0ba8cedf0265 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
…kage - Remove packages/echarts-theme-rsuite (no longer needed — recharts replaced ECharts) - Promote packages/charts/* to repo root (src/, tsup.config.ts, tsconfig.json, CHANGELOG.md) - Move packages/docs/ → docs/ at repo root - Rewrite root package.json: single @rsuite/charts library, no workspaces - Delete turbo.json - Update .gitignore (dist/, docs/.next/, docs/out/) - Fix tsconfig.json (standalone, no extends) - Fix docs/package.json (@rsuite/charts: file:..) Agent-Logs-Url: https://github.com/rsuite/charts/sessions/b2c56f25-d3a0-4233-be80-0ba8cedf0265 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/rsuite/charts/sessions/557458e1-8764-41ba-b510-1035dd4d5940 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
|
Deployment failed with the following error: Learn More: https://vercel.com/rsuite?upgradeToPro=build-rate-limit |
… simplify CI to React 18 - Add jest@^27.5.1 and jest-environment-jsdom@^27.5.1 to devDependencies (jest was in scripts but not declared; jest-environment-jsdom is required separately since Jest 28, but we pin to 27 to match @swc-node/jest@1.5.2) - Update @testing-library/react ^11 → ^13.4.0 (React 18 compatible) - Update @types/jest ^26 → ^27.4.0 (matches jest@27) - Simplify jest.config.js: remove dead react-17/react-18 alias blocks - Update CI workflow: drop React 16/17 matrix (v6 targets React 18) and remove --force flag from npm ci - Regenerate package-lock.json to be in sync with package.json Agent-Logs-Url: https://github.com/rsuite/charts/sessions/557458e1-8764-41ba-b510-1035dd4d5940 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
…cide-react SVGs - Add webpack alias in docs/next.config.ts pointing @rsuite/charts → ../src/index.ts so the docs build works without needing a pre-built dist/ - Add tsconfig path alias in docs/tsconfig.json for TypeScript IntelliSense - Add lucide-react@^1.8.0 to docs/package.json - Replace emoji icons with lucide-react SVG icons in: - docs/app/page.tsx (hero icon + chart grid cards) - docs/app/components/Sidebar.tsx (sidebar logo) Agent-Logs-Url: https://github.com/rsuite/charts/sessions/2ca44d22-d78c-4c5d-ba16-07d167bca814 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
…bpack alias Next.js 16 defaults to Turbopack for `next dev`, which rejects a bare `webpack` config. Add `turbopack.resolveAlias` so both dev (Turbopack) and build (webpack) resolve @rsuite/charts → ../src/index.ts. Agent-Logs-Url: https://github.com/rsuite/charts/sessions/cedc2099-4108-4a38-a257-1fd4688a6847 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
…arts Turbopack does not accept absolute filesystem paths in resolveAlias — it interprets them as server-relative URL paths, causing: "server relative imports are not implemented yet" Use '../src/index.ts' (relative to the docs/ project root) for Turbopack, while keeping the absolute path for the webpack fallback used by next build. Agent-Logs-Url: https://github.com/rsuite/charts/sessions/0afde7fd-e3ec-4278-ad82-2a9fbfb901c2 Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
…esolution Turbopack auto-detects its root by searching for lockfiles upward and was picking /Users/apple/package-lock.json (home dir) as the root instead of the docs/ directory. Relative paths in turbopack.resolveAlias are resolved against this root, so '../src/index.ts' was resolving to /src/index.ts (non-existent) rather than charts/src/index.ts. Setting turbopack.root = __dirname (docs/) corrects the root so that: '../src/index.ts' → docs/../src/index.ts → charts/src/index.ts ✓ This fixes the "Module not found: Can't resolve @rsuite/charts" error in Turbopack dev mode, which in turn fixes the empty chart boxes shown in the docs site (charts were blank because the JS bundle failed to load the module). Agent-Logs-Url: https://github.com/rsuite/charts/sessions/b80e051f-1fa7-4b17-bd05-8fd4b693443c Co-authored-by: simonguo <1203827+simonguo@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #104 +/- ##
==========================================
+ Coverage 83.20% 92.71% +9.50%
==========================================
Files 21 30 +9
Lines 530 974 +444
Branches 135 99 -36
==========================================
+ Hits 441 903 +462
+ Misses 74 70 -4
+ Partials 15 1 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…lts, test hex values, docs React version
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 227 changed files in this pull request and generated 11 comments.
Files not reviewed (1)
- docs/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…emap tooltip - utils.ts: skip auto-Cell injection when any data item already has an explicit `fill` property, preventing palette colors from overriding user-supplied per-datum fills - Treemap.tsx: replace hardcoded tooltip colors with colors.tooltipBackground, colors.tooltipBorder, colors.tooltipLabel, and colors.tooltipText so that dark mode renders correctly - utils.test.ts: add 5 tests covering Pie auto-Cell scenarios (inject, skip all fills, skip partial fills, skip when children present, empty palette guard)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 66 out of 226 changed files in this pull request and generated 6 comments.
Files not reviewed (1)
- docs/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…hart rendering @rsuite/charts is symlinked into docs/node_modules, but its dist files resolve 'react' from the root-level node_modules/react (a different module instance than docs/node_modules/react). This dual-React-instance issue silently breaks hook calls inside chart components (BarChart, etc.) when rendered through the CodeDemo live-preview, causing blank preview boxes with no visible error. Add turbopack resolveAlias to pin react / react-dom / jsx-runtime to the single docs/node_modules/react installation.
turbopack resolveAlias does not accept absolute paths (path.resolve) —
it prepends './' turning them into invalid relative paths like
'./Users/apple/...'. Use paths relative to turbopack.root ('../') instead.
Also alias '@rsuite/charts' to './src/index.ts' so turbopack compiles
the TypeScript source directly (no stale-dist risk) and all React imports
resolve to the single docs/node_modules/react instance.
The sucrase + new Function approach silently failed to render chart components due to a dual-React-instance issue (BarChart's internal hooks ran against a different React instance than the one driving the preview). react-live passes React and all scope dependencies explicitly into the execution context, avoiding the instance mismatch. noInline=true preserves the existing render(...) call style used in all code samples. Also restore next.config.ts to the simple form (turbopack.root only), removing the broken resolveAlias absolute paths that were causing 'server relative imports' errors.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 66 out of 226 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- docs/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const handleCopy = () => { | ||
| navigator.clipboard.writeText(children.trim()); | ||
| setCopied(true); | ||
| setTimeout(() => setCopied(false), 2000); | ||
| }; |
There was a problem hiding this comment.
navigator.clipboard.writeText(...) can throw or be unavailable (non-secure contexts, permission denied). Right now this will produce an unhandled rejection/exception in the docs UI. Wrap this in try/catch (and/or await + .catch) and consider a fallback copy mechanism or a user-visible error state.
| "dependencies": { | ||
| "@rsuite/charts": "file:..", | ||
| "lucide-react": "^1.8.0", | ||
| "next": "^16.2.4", | ||
| "prism-react-renderer": "^2.4.1", | ||
| "react": "^19.0.0", | ||
| "react-dom": "^19.0.0", | ||
| "recharts": "^2.15.4", | ||
| "sucrase": "^3.35.1" |
There was a problem hiding this comment.
PR description says the docs use react-code-view / @react-code-view/unplugin + Markdown markers, but the docs app currently uses a custom CodeDemo implementation (sucrase + new Function) and has no react-code-view dependency. Please either update the PR description to match the implementation, or add the missing dependency/plugin and migrate pages accordingly.
https://charts-3gc71bzf5-rsuite.vercel.app/
Rewrites
@rsuite/chartsv6 on top of recharts, ships a Next.js 16 docs site with live chart examples, and removes the legacyecharts-theme-rsuitepackage.Key Changes
BarChart,LineChart,AreaChart,PieChart,ComposedChart,ScatterChart,RadarChart,RadialBarChart,Treemap,FunnelChart) rebuilt on recharts with rsuite palette auto-coloring viainjectSeriesColorsdocs/app with sidebar navigation, API reference, and installation guidereact-code-viewin the proper Markdown format — each page has anindex.mdwith code blocks wrapped in<!--start-code-->/<!--end-code-->markers, transformed at build time by@react-code-view/unpluginwebpack plugin, with chart components passed asdependenciesfor live in-browser executionecharts-theme-rsuitepackage and all ECharts dependenciessrcIndexPathinresolveAliasto bypass Turbopack/webpack root-detection issues