Skip to content
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] Fix utils bundle size entrypoint #43304

Merged
merged 4 commits into from
Aug 15, 2024
Merged

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Aug 15, 2024

Use an ESM entrypoint instead of a commonjs to get a more accurate depiction of reality. Also removing the alias as we can rely on pnpm package linking through the publishConfig.directory option.
We don't have this problem with other modules as they don't use the esm/ layout. We'll unify the package layout as part of improved ESM support.

Noticed this in #43243

🤔 I was initially surprised by the large bundle size reduction. It looks like it now manages to aggressively tree-shake things such as the (in production) unused chainProptypes and the functions it's called with.

bundles diff

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Aug 15, 2024
@Janpot Janpot changed the title [code-infra] Fix utils bundle size [code-infra] Fix utils bundle size entrypoint Aug 15, 2024
@mui-bot
Copy link

mui-bot commented Aug 15, 2024

Netlify deploy preview

https://deploy-preview-43304--material-ui.netlify.app/

@material-ui/utils: parsed: -51.53% 😍, gzip: -30.92% 😍

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 656740c

@Janpot Janpot marked this pull request as ready for review August 15, 2024 07:46
@Janpot Janpot requested a review from a team August 15, 2024 09:59
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change makes sense. 👍
Do you know why code coverage could have decreased? 🤷

@Janpot
Copy link
Member Author

Janpot commented Aug 15, 2024

Do you know why code coverage could have decreased

I saw identical coverage before and after on my local. I was assuming codocov being confused

@Janpot Janpot merged commit 87aad6d into mui:next Aug 15, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants