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

[docs-infra] Document bundle size of each component #602

Open
2 tasks
oliviertassinari opened this issue Sep 11, 2024 · 2 comments
Open
2 tasks

[docs-infra] Document bundle size of each component #602

oliviertassinari opened this issue Sep 11, 2024 · 2 comments
Assignees
Labels
docs Improvements or additions to the documentation performance scope: docs-infra Specific to the docs-infra product status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 11, 2024

Summary

Bundle size matters. I think it's important we document it in the docs. Documenting:

  • Forces us to measure it
  • Means developers know we know what it is
  • Means developers easily know if it's good enough for their use cases

For example, see propeldata/ui-kit#157 who are looking for a select component, there is a reputation for bloat to debunk (Base UI) and solve (Material UI).

Examples

I tried two iterations:

but never had time to work on this to finish it (It's why I was eager to fill: https://www.notion.so/mui-org/React-Engineer-Docs-infra-02023ab7104241888ca2ab3bcb32e19d). I was more trying to fix a regression in the DX.

Motivation

It's related to #201.

Closing this I think involves two steps:

  • Implementing it for Base UI
  • Supporting it for docs-infra so Material UI can also show components' size (assuming we fix their size)

Search keywords: -

@oliviertassinari oliviertassinari added status: waiting for maintainer These issues haven't been looked at yet by a maintainer docs Improvements or additions to the documentation performance scope: docs-infra Specific to the docs-infra product labels Sep 11, 2024
@atomiks
Copy link
Contributor

atomiks commented Sep 12, 2024

Displaying bundle size accurately is a difficult problem. If you only use one single component from the library, then it’s fully accurate. However once you start using multiple components, the numbers become inaccurate as the sizes don’t add up simply/cumulatively as displayed due to shared dependencies/logic/compression, etc.

I propose we take a non-naive approach to this. https://bundlejs.com allows you to export the specific components you're actually using, treeshaking enabled, to see a true picture. We could have a UI for this on the website where they select all the components they're using/will decide to use to get a true picture of the bundle size.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 13, 2024

Oh, I forgot I had opened mui/material-ui#40591. The best I could figure out in the past was pastelsky/bundlephobia#389.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation performance scope: docs-infra Specific to the docs-infra product status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants