-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[code-infra] Update package layout for better ESM support #43264
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy previewhttps://deploy-preview-43264--material-ui.netlify.app/ Menu: parsed: +1.74% , gzip: +2.03% Bundle size reportDetails of bundle changes (Toolpad) |
closes #44055
closes #43980
closes #44265
closes #44180
Might close:
Add a new mode to the build:
Notes:
./esm/*
export to icons for people who used the vite alias workaround@mui/joy/node
bundle is included in the client bundle when Joy UI component is being imported into a RSC #37934To Do:
figure out theBlocked on [core] Removeexport *
usage in files that have a'use client'
pragma.'use client'
from index files and useAutocomplete reexport #41956@mui/material-pigment-css
@mui/material-pigment-css
and@mui/icons-material
esmExternals
from the docs (investigate) [docs] Remove esmExternals from the docs #43068Bundle size increase
The bundle size increase can be fully attributed to the inclusion of the following ESM/CJS interop helper in the webpack output:
Code
This is caused by the following import
material-ui/packages/mui-system/src/useMediaQuery/useMediaQuery.ts
Line 75 in eab1b9e
A potential switch to using
use-sync-external-store
has been explored in #43476 but ultimately it makes sense to keep it, it manifests in the webpack runtime.Resolutions
To try out the changes use following resolutions: