Skip to content

[x-license] move test keys to a dedicated /test-keys subpath#22334

Open
aemartos wants to merge 4 commits intomui:masterfrom
aemartos:feature/sto-159-x-license-move-test-keys-out-of-public-internals-export
Open

[x-license] move test keys to a dedicated /test-keys subpath#22334
aemartos wants to merge 4 commits intomui:masterfrom
aemartos:feature/sto-159-x-license-move-test-keys-out-of-public-internals-export

Conversation

@aemartos
Copy link
Copy Markdown
Member

@aemartos aemartos commented May 5, 2026

Summary

@mui/x-license/internals is the runtime entrypoint imported by every commercial package (data-grid-pro/premium, charts-pro/premium, date-pickers-pro, tree-view-pro, scheduler-premium) to wire up useLicenseVerifier and Watermark. It was also re-exporting every entry of test-keys.ts, 17 base64+md5 strings used only by tests, which leaked them into the public TypeScript surface and inflated CI bundle-size measurements.

This PR is a refactor with no behavior change.

Motivation

  • API hygiene: test-only fixtures shouldn't ship as part of internals' public type surface. Removing them avoids accidental adoption and frees us from supporting them as stable API.
  • Accurate CI measurement: the bundle-size-checker measured internals with import *, which forced test-keys into the count. The number it reports, and uses to gate regressions, will now reflect what real consumers actually pull.
  • Tree-shaking guarantee: modern bundlers strip these already, but export * barrel chains are a known weak spot in older esbuild/SSR/edge runtimes. After this change, test-keys aren't reachable from internals at all.

No production consumer was importing these symbols, so no runtime behavior changes.

@aemartos aemartos self-assigned this May 5, 2026
@aemartos aemartos added internal Behind-the-scenes enhancement. Formerly called “core”. scope: x-license Changes related to @mui/x-license. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels May 5, 2026
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 5, 2026

Deploy preview

https://deploy-preview-22334--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,019.44 ms 🔺+92.07 ms(+9.9%) | Renders: 30 (+0) | Paint: 1,466.02 ms 🔺+142.05 ms(+10.7%)

Test Duration Renders
Heatmap: 100x100 grid 651.53 ms 🔺+50.56 ms(+8.4%) 2 (+0)
LineChart with big data amount (with marks) 84.59 ms 🔺+10.25 ms(+13.8%) 2 (+0)
BarChartPro with big data amount 55.95 ms 🔺+10.15 ms(+22.2%) 3 (+0)
Area chart with big data amount (no marks) 23.80 ms 🔺+3.49 ms(+17.2%) 2 (+0)
LineChartPro with big data amount and zoomed in (with marks) 33.61 ms 🔺+3.35 ms(+11.1%) 2 (+0)

…and 9 more — details


Check out the code infra dashboard for more information about this PR.

@aemartos aemartos changed the title [x-license] Move test keys to a dedicated /test-keys subpath [x-license] move test keys to a dedicated /test-keys subpath May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. scope: x-license Changes related to @mui/x-license. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant