[scheduler] Track bundle size of scheduler packages#22682
Open
flaviendelangle wants to merge 1 commit into
Open
[scheduler] Track bundle size of scheduler packages#22682flaviendelangle wants to merge 1 commit into
flaviendelangle wants to merge 1 commit into
Conversation
Deploy previewhttps://deploy-preview-22682--material-ui-x.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
The bundle size CI step (`upload-size-snapshot`) was running but did not include any scheduler entrypoints, so `@mui/x-scheduler` and `@mui/x-scheduler-premium` were never measured. - Expose the package root (`.`) export for both packages so they can be tracked like the other public packages (data grid, charts, pickers, tree view). The build already auto-generated a root entry from `src/index.ts`; this makes it an explicit, declared public entrypoint. - Add the scheduler packages to the bundle-size-checker config. Component entrypoints are discovered from each package's `exports` field via `findComponentsFromExports` (the existing `findComponents` helper only matches PascalCase build folders and so can't pick up the scheduler's kebab-case sub-path exports), so new views are tracked automatically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4ca4b87 to
6c76072
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bundle size CI step (
code-infra/upload-size-snapshotin.circleci/config.yml) was already running, but the entrypoint list intest/bundle-size/bundle-size-checker.config.mjsdid not include any scheduler entrypoints. As a result, the bundle size of@mui/x-schedulerand@mui/x-scheduler-premiumwas never measured or reported in the size-snapshot comment.This PR enables bundle-size tracking for both scheduler packages, the same way it works for the data grid, charts, pickers and tree view.
Changes
Expose the package root (
.) export@mui/x-schedulerand@mui/x-scheduler-premiumonly declared kebab-case sub-path exports (./event-calendar,./week-view, …) and no root.entry, so there was no package-level entrypoint to measure like the other packages have.".": "./src/index.ts"to theexportsof both packages.src/index.ts(code-infra adds.wheneverbuild/index.jsexists), so this mainly makes the root an explicit, declared public entrypoint (and updates thesrc/index.tsheader comment accordingly).Add the scheduler packages to the bundle-size config
@mui/x-scheduler,@mui/x-scheduler-premium) are added explicitly, mirroring how the other packages list their root.exportsfield via a newfindComponentsFromExportshelper, rather than being hardcoded.findComponentshelper scans the build output for PascalCase component folders (e.g.BarChart/index.js). The scheduler uses kebab-case sub-path exports (event-calendar,day-view, …), sofindComponentscannot pick them up.findComponentsFromExportsreads theexportskeys and filters out non-renderable sub-paths (models,locales,theme-augmentation,internals, anduse-*hooks). New views are therefore tracked automatically without editing this config.Resulting scheduler entrypoints (2 roots + 12 components):
The internal packages (
@mui/x-scheduler-internals,@mui/x-scheduler-internals-premium) are intentionally excluded, consistent with how other*-internalspackages (e.g.@mui/x-internals) are not measured.Testing
eslint+prettier --checkpass on the changed files.tsc --noEmitpasses for both@mui/x-schedulerand@mui/x-scheduler-premiumafter adding the root export.🤖 Generated with Claude Code