Skip to content

build: add component size check - #8111

Draft
tomdavies73 wants to merge 1 commit into
masterfrom
component_size_reporting
Draft

build: add component size check #8111
tomdavies73 wants to merge 1 commit into
masterfrom
component_size_reporting

Conversation

@tomdavies73

@tomdavies73 tomdavies73 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Proposed behaviour

Adds a component size check which can be observed locally. Intended to help devs in checking sizes in component changes during development. Whilst not indicative of bundle size it can be used as a measurement to track if component size changes are intended.

Will also never block PRs, only to be used as a supplementary check when needed.

Locally via npm run component-size-check:

Screenshot 2026-08-03 at 11 30 58

Current behaviour

Currently, there is no standardised way to check component size differences easily and quickly.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

@tomdavies73 tomdavies73 self-assigned this Jul 31, 2026
@tomdavies73 tomdavies73 added DO NOT MERGE Work in progress This is a WIP PR so may not be ready for review labels Jul 31, 2026
@tomdavies73
tomdavies73 force-pushed the component_size_reporting branch 4 times, most recently from d50e556 to f8851f9 Compare August 3, 2026 10:32
@tomdavies73 tomdavies73 changed the title build: add component size build: add component size check Aug 3, 2026
@tomdavies73
tomdavies73 force-pushed the component_size_reporting branch from f8851f9 to 82a3e30 Compare August 3, 2026 10:43
@tomdavies73
tomdavies73 force-pushed the component_size_reporting branch from 82a3e30 to 7b53bdb Compare August 3, 2026 11:03
@ibutakova

Copy link
Copy Markdown
Contributor

Tracking size regressions looks to be very helpful.

Although right now, summing up .js files ignores the dependency graph. It might flag harmless tree-shakeable code or miss a massive dependency outside the folder, which makes the output hard to trust.

I see here two ways to play, depending on what you want to do:

  1. Stick to this but automate a faster, dedicated ESM build so devs don't wait on full npm run.
  2. Pivot and measure the actual consumer bundle impact (using a temporary entry via the public API, bundling it, and diffing raw/gzip sizes against the merge base). I'm leaning toward this one)) Carbon has a real reason to understand changes that add or replace dependencies, modify public exports, introduce optional features or affect widely shared utilities.

There's a chance I missed the scope. Anyway, regression tracking rules. Let me know if these thoughts actually fit our workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No UX QA Required Pending QA Pending Review Work in progress This is a WIP PR so may not be ready for review

Development

Successfully merging this pull request may close these issues.

2 participants