Skip to content

Replace old bundle-viz with two new chart examples#7390

Merged
PavelVanecek merged 1 commit into
mainfrom
bundle-viz-v2
May 30, 2026
Merged

Replace old bundle-viz with two new chart examples#7390
PavelVanecek merged 1 commit into
mainfrom
bundle-viz-v2

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented May 30, 2026

Copy link
Copy Markdown
Collaborator

New bundle visualization examples, no code changes

Summary by CodeRabbit

  • New Features

    • Added interactive bundle size visualizations to the documentation showing Recharts component composition in treemap and sunburst chart formats with live data generation.
  • Tests

    • Added comprehensive test coverage for bundle size data generation and visualization.
  • Chores

    • Removed the standalone bundle visualization application; functionality is now integrated into the main documentation site.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR migrates bundle-size visualization from a standalone app to integrated examples within the documentation site. It refactors bundle-data generation to support parameterized build options, produces a new JSON visualization file, and adds Treemap and Sunburst components that consume the generated data with fallback support.

Changes

Bundle Size Visualization Examples and Data Generation

Layer / File(s) Summary
Bundle analysis refactoring and options
scripts/treeshaking.ts
Treeshaking script refactored to support parameterized build options (bundleDependencies). External dependency selection now reads package.json and respects the bundling flag. Rollup plugin setup and build execution centralized into shared buildBundle(...) and getRollupPlugins(...) helpers reused across treeshaking, module-graph, and size-reporting functions.
Bundle visualization data generation rewrite
scripts/generate-bundle-data.ts, scripts/generate-bundle-data.test.ts, package.json
Generate-bundle-data script completely rewritten to produce bundleSizeData.generated.json with treemap and sunburst entries. Implements CLI argument parsing (--example, --treemap-example, --sunburst-example), module-ID normalization, and hierarchical tree building from Rollup chunks. Exports reusable functions: parseBundleVisualizationTargets, buildBundleVisualizationTree, generateBundleVisualizationData. Comprehensive tests cover target parsing, tree construction, and end-to-end generation with dependency bundling.
Visualization data types and shared model
www/src/docs/exampleComponents/_bundleSize/types.ts
New types module defines visualization data contract: BundleVisualizationStage (size/reduction metrics), BundleVisualizationNode (hierarchical tree), BundleVisualizationEntry (example-specific visualization), and BundleVisualizationData (treemap and sunburst payload).
Treemap bundle visualization component
www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx
BundleSizeTreemap component loads generated treemap data with fallback support, transforms hierarchical tree into Recharts nodes, infers library families for deterministic coloring using hashing, and renders summary cards plus custom treemap rectangles with conditional labels. Includes base-URL resolution from module location and safe mount-aware data fetching.
Sunburst bundle visualization component and nav example
www/src/docs/exampleComponents/SunburstChart/BundleSizeSunburst.tsx, www/src/docs/exampleComponents/SunburstChart/SunburstChartNavExample.tsx
BundleSizeSunburst mirrors treemap functionality for Recharts SunburstChart: loads data with fallback, transforms tree into sunburst display nodes, and renders summary cards with formatted tooltip. SunburstChartNavExample provides a simple inline example with hardcoded data.
Example registry and component exports
www/src/docs/exampleComponents/TreeMap/index.ts, www/src/docs/exampleComponents/SunburstChart/index.ts, www/src/docs/exampleComponents/index.ts
BundleSizeTreemap and BundleSizeSunburst registered in respective example galleries with raw source and display metadata. SunburstChart added to allExamples export with order assignment.
Build script integration and file management
www/package.json, package.json, .gitignore, vitest.config.mts
Build pipelines updated: www/package.json runs bundle-data generation before vite build; root package.json uses npm exec with www prefix and adds @rollup/plugin-commonjs dependency; .gitignore excludes generated JSON; vitest config includes new test file.
Test coverage, example expectations, and deprecation
test-vr/tests/www/*.spec-vr.tsx, omnidoc/verifyExamples.spec.ts, www/src/views/ExampleView.css, bundle-viz/*
Screenshot tests added for BundleSizeTreemap and BundleSizeSunburst. Example coverage expectations updated to recognize SunburstChart as having examples. ExampleView border color uses theme variable. Legacy bundle-viz app completely removed.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • recharts/recharts#7032: Adds initial treeshaking utilities and tracked component logic that this PR modifies further.
  • recharts/recharts#7045: Modifies bundle-size reporting pipeline APIs and baseline/reduction-percentage logic that overlap with this PR's treeshaking refactor.
  • recharts/recharts#6897: Introduces example-coverage test infrastructure that this PR updates for SunburstChart.

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and generic. It lacks required sections like Related Issue, Motivation/Context, Testing details, and does not check any boxes from the template. Add a detailed description following the repository template: explain the motivation for replacing bundle-viz, link related issues, describe testing performed, and indicate which checklist items apply (likely new feature or breaking change).
Docstring Coverage ⚠️ Warning Docstring coverage is 4.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing the old bundle-viz standalone app with two new Sunburst and Treemap chart examples integrated into the documentation.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bundle-viz-v2

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.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx (2)

5-31: ⚡ Quick win

Import the shared bundle-visualization types here.

These types duplicate www/src/docs/exampleComponents/_bundleSize/types.ts, so the treemap loader can drift from the generator contract without a compiler catch. Import the shared exports instead of redeclaring them locally.

🤖 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 `@www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx` around lines 5
- 31, The duplicated type declarations (BundleVisualizationStage,
BundleVisualizationNode, BundleVisualizationEntry, BundleVisualizationData)
should be removed and replaced with imports from the shared bundle-visualization
types module used by the generator; update BundleSizeTreemap.tsx to import the
shared types (e.g., BundleVisualizationStage, BundleVisualizationNode,
BundleVisualizationEntry, BundleVisualizationData) instead of redeclaring them
so the treemap loader and generator share the same contract and the TypeScript
compiler will catch mismatches.

54-477: 🏗️ Heavy lift

Extract the shared bundle-size helpers before these two examples diverge.

Most of this loader/transform/coloring code is mirrored in www/src/docs/exampleComponents/SunburstChart/BundleSizeSunburst.tsx. Moving the common pieces into _bundleSize would keep both examples aligned and remove a lot of double-maintenance.

🤖 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 `@www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx` around lines 54
- 477, Duplicate bundle-size loader/transform/coloring helpers are present;
extract them into a shared module named _bundleSize and have both examples
import the common code. Create a new module (_bundleSize) that exports the
shared constants/types and functions (e.g.
generatedBundleVisualizationAssetPath, BundleVisualization types,
getWebsiteBaseUrl, loadGeneratedBundleVisualizationEntry,
useBundleVisualizationEntry, collectLeafNodes, getPackageName,
inferLibraryFamily, getDisplayPathSegments, insertLeaf, createBuildNode,
buildTreemapDisplayData, getLibraryColorSeed, getNodeFill, finalizeDisplayNode,
getHumanReadableSize, clamp, hashString), move their implementations there,
update BundleSizeTreemap.tsx and BundleSizeSunburst.tsx to import the needed
symbols, and remove the duplicated implementations from both files so they rely
on the single source of truth.
🤖 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.

Inline comments:
In `@scripts/generate-bundle-data.ts`:
- Around line 117-120: The thrown Error in the default branch of
parseBundleVisualizationTargets() lists only the "*-example" flags while the
function accepts both real and example aliases (--treemap, --sunburst,
--example, --treemap-example, --sunburst-example); update the error message
thrown for unknown argument (variable argument) to enumerate all supported flags
(include --example, --treemap, --treemap-example, --sunburst,
--sunburst-example) so the CLI help text matches the actual accepted aliases and
points users to valid options.

In `@scripts/treeshaking.ts`:
- Around line 149-163: The Rollup bundle may leak if bundle.generate throws
because bundle.close() is only called on the success path; update the
buildBundle (used by treeshake/getModuleGraph/bundle-size reporting) to always
close the Rollup bundle by creating the bundle variable before calling rollup,
then wrap the generate/close sequence in try/finally (or try/catch/finally) and
in the finally block await bundle.close() only if bundle is defined, rethrowing
any error so failures still propagate; ensure you reference the same bundle
variable used with bundle.generate and bundle.close so resources are cleaned on
error.

In `@www/package.json`:
- Around line 7-9: The build:client script currently always invokes
generate-bundle-data which hard-fails if ../es6/index.js is missing; update the
workflow so the root build is produced before generate-bundle-data or make
generate-bundle-data tolerant of a missing ../es6/index.js. Concretely, either
change the "build:client" NPM script to run the root build/preflight (e.g., run
the root package's build or a script that ensures ../es6/index.js exists) before
invoking "generate-bundle-data", or modify ../scripts/generate-bundle-data.ts to
detect a missing ../es6/index.js and either generate a fallback or exit
gracefully with a clearer message; reference the "build:client" script,
"generate-bundle-data" script, ../scripts/generate-bundle-data.ts, and the
../es6/index.js artifact to locate the code to change.

In `@www/src/docs/exampleComponents/TreeMap/index.ts`:
- Around line 16-23: The Treemap example registry entry (treeMapExamples ->
BundleSizeTreemap) is added but not referenced by the API examples list; update
the consumer in the Treemap examples file so the new example is reachable: open
the Treemap consumer (the module that currently hard-codes SimpleTreemap and
TreemapWithPaddingAndGaps), import or reference the BundleSizeTreemap entry from
treeMapExamples and add it to the exported examples array (the same list that
contains SimpleTreemap and TreemapWithPaddingAndGaps) so BundleSizeTreemap
appears on the Treemap examples page.

---

Nitpick comments:
In `@www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx`:
- Around line 5-31: The duplicated type declarations (BundleVisualizationStage,
BundleVisualizationNode, BundleVisualizationEntry, BundleVisualizationData)
should be removed and replaced with imports from the shared bundle-visualization
types module used by the generator; update BundleSizeTreemap.tsx to import the
shared types (e.g., BundleVisualizationStage, BundleVisualizationNode,
BundleVisualizationEntry, BundleVisualizationData) instead of redeclaring them
so the treemap loader and generator share the same contract and the TypeScript
compiler will catch mismatches.
- Around line 54-477: Duplicate bundle-size loader/transform/coloring helpers
are present; extract them into a shared module named _bundleSize and have both
examples import the common code. Create a new module (_bundleSize) that exports
the shared constants/types and functions (e.g.
generatedBundleVisualizationAssetPath, BundleVisualization types,
getWebsiteBaseUrl, loadGeneratedBundleVisualizationEntry,
useBundleVisualizationEntry, collectLeafNodes, getPackageName,
inferLibraryFamily, getDisplayPathSegments, insertLeaf, createBuildNode,
buildTreemapDisplayData, getLibraryColorSeed, getNodeFill, finalizeDisplayNode,
getHumanReadableSize, clamp, hashString), move their implementations there,
update BundleSizeTreemap.tsx and BundleSizeSunburst.tsx to import the needed
symbols, and remove the duplicated implementations from both files so they rely
on the single source of truth.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 46d396c3-d4de-4237-8363-76d7afa3bb4d

📥 Commits

Reviewing files that changed from the base of the PR and between c973308 and 1dea907.

⛔ Files ignored due to path filters (16)
  • bundle-viz/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
  • test-vr/__snapshots__/tests/AreaChart/stacked.spec-vr.tsx-snapshots/multiple-data-arrays-exclusive-dataKey-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/AreaChart/stacked.spec-vr.tsx-snapshots/multiple-data-arrays-repeated-dataKey-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/AreaChart/stacked.spec-vr.tsx-snapshots/multiple-data-arrays-repeated-dataKey-without-XAxis-dataKey-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/AreaChart/stacked.spec-vr.tsx-snapshots/single-data-array-without-XAxis-dataKey-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/Bar.6192.spec-vr.tsx-snapshots/ComposedChart-with-stacked-Area-and-Bar-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/SunburstChartExamples.spec-vr.tsx-snapshots/BundleSizeSunburst-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/SunburstChartExamples.spec-vr.tsx-snapshots/BundleSizeSunburst-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/SunburstChartExamples.spec-vr.tsx-snapshots/BundleSizeSunburst-1-webkit-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/TreemapApiExamples.spec-vr.tsx-snapshots/BundleSizeTreemap-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/TreemapApiExamples.spec-vr.tsx-snapshots/BundleSizeTreemap-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/TreemapApiExamples.spec-vr.tsx-snapshots/BundleSizeTreemap-1-webkit-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/dark-mode.spec-vr.tsx-snapshots/dark-mode-examples-list-1-chromium-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/dark-mode.spec-vr.tsx-snapshots/dark-mode-examples-list-1-firefox-linux.png is excluded by !**/*.png
  • test-vr/__snapshots__/tests/www/dark-mode.spec-vr.tsx-snapshots/dark-mode-examples-list-1-webkit-linux.png is excluded by !**/*.png
📒 Files selected for processing (26)
  • .gitignore
  • bundle-viz/README.md
  • bundle-viz/index.html
  • bundle-viz/package.json
  • bundle-viz/src/App.tsx
  • bundle-viz/src/bundle-data.json
  • bundle-viz/src/main.tsx
  • bundle-viz/tsconfig.json
  • bundle-viz/vite.config.ts
  • omnidoc/verifyExamples.spec.ts
  • package.json
  • scripts/generate-bundle-data.test.ts
  • scripts/generate-bundle-data.ts
  • scripts/treeshaking.ts
  • test-vr/tests/www/SunburstChartExamples.spec-vr.tsx
  • test-vr/tests/www/TreemapApiExamples.spec-vr.tsx
  • vitest.config.mts
  • www/package.json
  • www/src/docs/exampleComponents/SunburstChart/BundleSizeSunburst.tsx
  • www/src/docs/exampleComponents/SunburstChart/SunburstChartNavExample.tsx
  • www/src/docs/exampleComponents/SunburstChart/index.ts
  • www/src/docs/exampleComponents/TreeMap/BundleSizeTreemap.tsx
  • www/src/docs/exampleComponents/TreeMap/index.ts
  • www/src/docs/exampleComponents/_bundleSize/types.ts
  • www/src/docs/exampleComponents/index.ts
  • www/src/views/ExampleView.css
💤 Files with no reviewable changes (8)
  • bundle-viz/vite.config.ts
  • bundle-viz/README.md
  • bundle-viz/index.html
  • bundle-viz/package.json
  • bundle-viz/src/bundle-data.json
  • bundle-viz/src/App.tsx
  • bundle-viz/tsconfig.json
  • bundle-viz/src/main.tsx

Comment on lines +117 to +120
default:
throw new Error(
`Unknown argument "${argument}". Supported options: --example, --treemap-example, --sunburst-example.`,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the error text in sync with the accepted flags.

parseBundleVisualizationTargets() accepts --treemap and --sunburst, but the thrown message only advertises the *-example forms. That makes the CLI look broken when someone passes a real supported alias.

🤖 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 `@scripts/generate-bundle-data.ts` around lines 117 - 120, The thrown Error in
the default branch of parseBundleVisualizationTargets() lists only the
"*-example" flags while the function accepts both real and example aliases
(--treemap, --sunburst, --example, --treemap-example, --sunburst-example);
update the error message thrown for unknown argument (variable argument) to
enumerate all supported flags (include --example, --treemap, --treemap-example,
--sunburst, --sunburst-example) so the CLI help text matches the actual accepted
aliases and points users to valid options.

Comment thread scripts/treeshaking.ts
Comment on lines 149 to +163
const bundle = await rollup({
input: tmpFile,
external: getExternals(),
external: getExternals(options),
treeshake: {
moduleSideEffects: false,
},
logLevel: 'silent',
plugins: [
{
name: 'recharts-alias',
resolveId(source) {
if (source === 'recharts') {
return srcEntry;
}
if (source.startsWith('file://')) {
return fileURLToPath(source);
}
return null;
},
},
nodeResolve({
extensions: ['.mjs', '.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
moduleDirectories: ['node_modules'],
}),
babel({
babelHelpers: 'bundled',
extensions: ['.js', '.jsx', '.ts', '.tsx'],
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-react', { runtime: 'automatic' }],
'@babel/preset-typescript',
],
}),
resolveDirectoryIndexPlugin,
],
plugins: getRollupPlugins(options, graphByModuleId),
});
const output = await bundle.generate({ format: 'esm' });
await bundle.close();
return output.output;
return {
output: output.output,
graphByModuleId,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Always close the Rollup bundle on failures.

If bundle.generate(...) throws, bundle.close() is skipped and the shared helper leaks Rollup resources on the error path. Since buildBundle(...) now backs treeshake, getModuleGraph, and bundle-size reporting, one failed build can leave later calls in a dirty state.

Possible fix
-    const bundle = await rollup({
-      input: tmpFile,
-      external: getExternals(options),
-      treeshake: {
-        moduleSideEffects: false,
-      },
-      logLevel: 'silent',
-      plugins: getRollupPlugins(options, graphByModuleId),
-    });
-    const output = await bundle.generate({ format: 'esm' });
-    await bundle.close();
-    return {
-      output: output.output,
-      graphByModuleId,
-    };
+    const bundle = await rollup({
+      input: tmpFile,
+      external: getExternals(options),
+      treeshake: {
+        moduleSideEffects: false,
+      },
+      logLevel: 'silent',
+      plugins: getRollupPlugins(options, graphByModuleId),
+    });
+    try {
+      const output = await bundle.generate({ format: 'esm' });
+      return {
+        output: output.output,
+        graphByModuleId,
+      };
+    } finally {
+      await bundle.close();
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const bundle = await rollup({
input: tmpFile,
external: getExternals(),
external: getExternals(options),
treeshake: {
moduleSideEffects: false,
},
logLevel: 'silent',
plugins: [
{
name: 'recharts-alias',
resolveId(source) {
if (source === 'recharts') {
return srcEntry;
}
if (source.startsWith('file://')) {
return fileURLToPath(source);
}
return null;
},
},
nodeResolve({
extensions: ['.mjs', '.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
moduleDirectories: ['node_modules'],
}),
babel({
babelHelpers: 'bundled',
extensions: ['.js', '.jsx', '.ts', '.tsx'],
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-react', { runtime: 'automatic' }],
'@babel/preset-typescript',
],
}),
resolveDirectoryIndexPlugin,
],
plugins: getRollupPlugins(options, graphByModuleId),
});
const output = await bundle.generate({ format: 'esm' });
await bundle.close();
return output.output;
return {
output: output.output,
graphByModuleId,
};
const bundle = await rollup({
input: tmpFile,
external: getExternals(options),
treeshake: {
moduleSideEffects: false,
},
logLevel: 'silent',
plugins: getRollupPlugins(options, graphByModuleId),
});
try {
const output = await bundle.generate({ format: 'esm' });
return {
output: output.output,
graphByModuleId,
};
} finally {
await bundle.close();
}
🤖 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 `@scripts/treeshaking.ts` around lines 149 - 163, The Rollup bundle may leak if
bundle.generate throws because bundle.close() is only called on the success
path; update the buildBundle (used by treeshake/getModuleGraph/bundle-size
reporting) to always close the Rollup bundle by creating the bundle variable
before calling rollup, then wrap the generate/close sequence in try/finally (or
try/catch/finally) and in the finally block await bundle.close() only if bundle
is defined, rethrowing any error so failures still propagate; ensure you
reference the same bundle variable used with bundle.generate and bundle.close so
resources are cleaned on error.

Comment thread www/package.json
Comment on lines +7 to +9
"generate-bundle-data": "tsx ../scripts/generate-bundle-data.ts",
"build": "npm run build:client && npm run prerender && npm run postprocess-sitemap && npm run validate-sitemap",
"build:client": "npm run generate-bundle-data && vite build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

build:client now has an unsatisfied root-build prerequisite.

This script always runs generate-bundle-data, but scripts/generate-bundle-data.ts hard-fails unless ../es6/index.js already exists. On a clean checkout, npm run build from www/ will now fail before Vite starts unless the root package was built separately.

🤖 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 `@www/package.json` around lines 7 - 9, The build:client script currently
always invokes generate-bundle-data which hard-fails if ../es6/index.js is
missing; update the workflow so the root build is produced before
generate-bundle-data or make generate-bundle-data tolerant of a missing
../es6/index.js. Concretely, either change the "build:client" NPM script to run
the root build/preflight (e.g., run the root package's build or a script that
ensures ../es6/index.js exists) before invoking "generate-bundle-data", or
modify ../scripts/generate-bundle-data.ts to detect a missing ../es6/index.js
and either generate a fallback or exit gracefully with a clearer message;
reference the "build:client" script, "generate-bundle-data" script,
../scripts/generate-bundle-data.ts, and the ../es6/index.js artifact to locate
the code to change.

Comment on lines 16 to +23
export const treeMapExamples = {
BundleSizeTreemap: {
Component: BundleSizeTreemap,
sourceCode: bundleSizeTreemapSource,
name: 'Bundle Size Treemap',
description:
'This chart shows actual bundle size of tree-shaken Recharts app. Click to individual rectangles to see nested folders and files.',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

BundleSizeTreemap still won’t show up on the Treemap examples page.

This adds the registry entry, but www/src/docs/apiExamples/Treemap/index.tsx:4-7 still hard-codes only SimpleTreemap and TreemapWithPaddingAndGaps, so the new example remains unreachable in docs. Please wire it into the consuming API examples list in the same PR.

🤖 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 `@www/src/docs/exampleComponents/TreeMap/index.ts` around lines 16 - 23, The
Treemap example registry entry (treeMapExamples -> BundleSizeTreemap) is added
but not referenced by the API examples list; update the consumer in the Treemap
examples file so the new example is reachable: open the Treemap consumer (the
module that currently hard-codes SimpleTreemap and TreemapWithPaddingAndGaps),
import or reference the BundleSizeTreemap entry from treeMapExamples and add it
to the exported examples array (the same list that contains SimpleTreemap and
TreemapWithPaddingAndGaps) so BundleSizeTreemap appears on the Treemap examples
page.

@chromatic-com

chromatic-com Bot commented May 30, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 198 tests unchanged
🟢 UI Review: 198 stories published -- no changes
Storybook icon Storybook Publish: 198 stories published

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.76277% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.07%. Comparing base (7d0c642) to head (1dea907).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...cs/exampleComponents/TreeMap/BundleSizeTreemap.tsx 88.29% 50 Missing ⚠️
...pleComponents/SunburstChart/BundleSizeSunburst.tsx 88.04% 49 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7390      +/-   ##
==========================================
+ Coverage   89.05%   89.07%   +0.01%     
==========================================
  Files         548      552       +4     
  Lines       40577    41454     +877     
  Branches     5581     5719     +138     
==========================================
+ Hits        36136    36924     +788     
- Misses       4432     4521      +89     
  Partials        9        9              

☔ 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
Copy Markdown
Contributor

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.

@PavelVanecek
PavelVanecek merged commit 8fea695 into main May 30, 2026
64 of 65 checks passed
@PavelVanecek
PavelVanecek deleted the bundle-viz-v2 branch May 30, 2026 07:13
@coderabbitai coderabbitai Bot mentioned this pull request Jul 3, 2026
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