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

[core-infra] Remove useless fragments #44516

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 24, 2024

I'm having some fun with the AST, allowing https://github.com/reactjs/react-docgen to extract props descriptions even when the component doesn't return a React element. We shouldn't be shipping dead code to developers, this PR avoids this. This should both improve bundle size and runtime.

DefinitelyTyped/DefinitelyTyped#65135 should help in the future.

@oliviertassinari oliviertassinari added the scope: code-infra Specific to the core-infra product label Nov 24, 2024
@oliviertassinari oliviertassinari changed the title [core] Remove useless fragments [core-infra] Remove useless fragments Nov 24, 2024
@mui-bot
Copy link

mui-bot commented Nov 24, 2024

Netlify deploy preview

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

PigmentHidden: parsed: +2.29% , gzip: +2.84%
Hidden: parsed: +1.85% , gzip: +2.13%
@material-ui/core: parsed: +0.20% , gzip: +0.37%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 16b8868

@@ -628,58 +628,59 @@ export default async function generateComponentApi(
const filename = componentInfo.filename;
let reactApi: ComponentReactApi;

if (componentInfo.isSystemComponent || componentInfo.name === 'Grid2') {
Copy link
Member Author

@oliviertassinari oliviertassinari Nov 24, 2024

Choose a reason for hiding this comment

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

That hard-coded logic felt wrong, we further added stuff around it in 08dce48#diff-eef575d465fe9894710e7eb399c76ad3e3900a8cbb6d374be7f303c4b6c6ef51R627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants