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

[Popper] Save 7 KB gzipped (for people only using it) #13804

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

oliviertassinari
Copy link
Member

No description provided.

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: Popper The React component. See <Popup> for the latest version. labels Dec 4, 2018
.size-limit.js Outdated
name: 'The size of the @material-ui/core/Popper component',
webpack: true,
path: 'packages/material-ui/build/Popper/index.js',
limit: '16.0 KB',
Copy link
Member Author

Choose a reason for hiding this comment

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

The withTheme import for RTL support costs us 7 kB gzipped. Maybe we should look in the body dir attribute instead? cc @eps1lon?

@oliviertassinari oliviertassinari changed the title [docs] Track Popper bundle size [Popper] Save 7 KB gzipped (for people only using it) Dec 4, 2018
name: 'The size of the @material-ui/core/Popper component',
webpack: true,
path: 'packages/material-ui/build/Popper/index.js',
limit: '10.0 KB',
Copy link
Member Author

@oliviertassinari oliviertassinari Dec 4, 2018

Choose a reason for hiding this comment

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

popper.js alone costs 7 kB: https://bundlephobia.com/result?p=popper.js.

@oliviertassinari oliviertassinari merged commit 8c684b3 into mui:master Dec 5, 2018
@oliviertassinari oliviertassinari deleted the react-popper-docs branch December 5, 2018 09:03
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Some issues:

  • does not detect direction changes
  • reads from the DOM during render phase
  • [core] Improve tree-shakeability #13391 is a candidate for reduced bundle size for Popper only usage since it will remove withStyles from the bundle

@oliviertassinari
Copy link
Member Author

  • I don't see how tree shaking can help. The issue is that withTheme imports the default theme and it's dependencies.
  • reads from the DOM during the render phase looks fine here.
  • people have to rerender the React when changing the direction. So I think that it fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Popper The React component. See <Popup> for the latest version. docs Improvements or additions to the documentation performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants