Repository navigation
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,070.74 ms -22.19 ms(-2.0%) | Renders: 76 (+0) | Paint: 1,707.57 ms -78.64 ms(-4.4%)
13 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1 task done
Contributor
Author
|
Closing in favor of #5243. Production consumer checks found no added client JavaScript for selective imports with the barrel-export design, including clean Next.js webpack and Turbopack builds. The whole-entrypoint bundle reports retain every metadata export and overstate the cost to those consumers; the measured results and scope are recorded in the addendum to #5243. |
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.
Closes #5242
Exports the
DataAttributes/CssVarsconstants through a new opt-in subpath per component:Supersedes #5243 (thanks @superhooman), rebuilt on the ESM constants from #5248.
Why a separate subpath
Exporting from the existing entrypoints (the #5243 shape) costs +21.5 kB gzip total: the minifier can no longer inline the constants into their use sites, and
@base-ui/reactalone grows +9.8 kB (+6.6%). With the subpath, all 124 existing bundles are byte-identical; only consumers who import metadata pay for it. Attaching constants to the parts (Dialog.Popup.CssVars) was rejected for the same reason, with no way to opt out.Changes
metadata.tsfiles re-exporting the existing constant modules, flat file-derived names (DialogPopupCssVars).AlertDialogPopupCssVars,ContextMenuItemDataAttributes), so each entrypoint is self-sufficient.index.test.tsreflects that and asserts every exported constant resolves to adata-*/--*string.data-drawer-content) stay private.Docs reference tables for the new subpaths are left for a follow-up.
Bundle size