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] Try out new JSX transform where available #22455

Merged
merged 6 commits into from
Sep 4, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Sep 2, 2020

Since this is on track to become the default in Babel 8 we should try it out periodically. Since it's only available in React 17 we can use existing scripts. I extended running with react@next to our azure pipeline which is responsible for bundle size tracking.

I'm mostly interested in the bundle size overhead due to effectively bundling two APIs for creating React elements. Since we also consider react as external (effectively ignoring it in the bundle size output) we should apply to react/jsx-runtime. Once we tree-shake the actual react module (e.g. import { useMemo } from 'react' we should include react and react/jsx-runtime.

Babel announcement

@eps1lon eps1lon added the core Infrastructure work going on behind the scenes label Sep 2, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Sep 3, 2020

No bundle size changes comparing 2574143...925c5e3

Generated by 🚫 dangerJS against 925c5e3

@eps1lon
Copy link
Member Author

eps1lon commented Sep 3, 2020

@material-ui/styles: parsed: -0.16% heart_eyes, gzip: +1.14%

As is tradition:
Gru meme consisting of 4 images: 1. planning: "work on tree shaking" 2. triumphant: "reduce stat size" 3. triumphant: "Increase gzipped size by 1kB" 4. realizing the disappointing outcome: "Increase gzipped size by 1kB"

@eps1lon eps1lon merged commit a927c9f into mui:next Sep 4, 2020
@eps1lon eps1lon deleted the feat/jsx-runtime branch September 4, 2020 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants