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] Compress throw new Error() to save bundle size #14618

Open
oliviertassinari opened this issue Sep 14, 2024 · 5 comments
Open

[core] Compress throw new Error() to save bundle size #14618

oliviertassinari opened this issue Sep 14, 2024 · 5 comments
Assignees
Labels
new feature New feature or request performance scope: code-infra Specific to the core-infra product

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 14, 2024

Summary

Today, MUI X throws errors in plain strings:

throw new Error(
[
'MUI X: The Tree View component requires all items to have a unique `id` property.',
'Alternatively, you can use the `getItemId` prop to specify a custom id for each item.',
'An item was provided without id in the `items` prop:',
JSON.stringify(item),
].join('\n'),
);

those add bundle size to end-users

Examples

We should be able to encode them with a key and only bundle this. See mui/material-ui#21214 for prior art on Material UI.

Motivation

No response

Search keywords: -

@oliviertassinari oliviertassinari added performance new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 14, 2024
@oliviertassinari oliviertassinari changed the title [core] Compress throw new Errro() to save bundle size [core] Compress throw new Errror() to save bundle size Sep 14, 2024
@oliviertassinari oliviertassinari changed the title [core] Compress throw new Errror() to save bundle size [core] Compress throw new Error() to save bundle size Sep 14, 2024
@michelengelen michelengelen added component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 16, 2024
@michelengelen
Copy link
Member

added to the board

@flaviendelangle
Copy link
Member

@michelengelen This is not a tree view topic, it's general to X and probably more a core-infra topic.

@michelengelen michelengelen added scope: code-infra Specific to the core-infra product and removed component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! labels Sep 17, 2024
@michelengelen
Copy link
Member

Thanks for pointing that out @flaviendelangle ... moved it out of the board!
I'll assign this to me so we don't lose track of it!

@michelengelen michelengelen self-assigned this Sep 17, 2024
@flaviendelangle
Copy link
Member

flaviendelangle commented Sep 17, 2024

And I suspect that Toolpad / Base UI / Pigment CSS could also benefit from this.
Adding it to the code infra board could be a good approach to make sure we build something re-usable throughout all our repos.

cc @Janpot

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 17, 2024

Base UI also has a few of those https://github.com/mui/base-ui/blob/1ab27b0510e0ba19157597f17642022a6208ae09/packages/mui-base/src/Slider/Root/SliderProvider.tsx#L21. It's not super important for MUI X, I mean, there are likely other ways to save bundle size to go after first.

Top-level issue created: mui/mui-public#204.

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

No branches or pull requests

3 participants