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] Improve export to CodeSandbox #22346

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Aug 24, 2020
@mui-pr-bot
Copy link

No bundle size changes comparing 1ece36d...7a08768

Generated by 🚫 dangerJS against 7a08768

);
const packagesWithDTPackage = Object.keys(deps)
.filter((name) => packagesWithBundledTypes.indexOf(name) === -1)
// All the Material-UI packages come with bundled types
Copy link
Member

Choose a reason for hiding this comment

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

No they don't. The existing logic is sound. Why not just add the new package to the existing logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

No they don't.

Do you have an example?

Why not just add the new package to the existing logic?

Assuming all the Material-UI packages should come with bundled types, why spend mental energy on maintaining such list?

Note that codesandbox is silent when a wrong package is included. For instance, take this demo https://material-ui.com/system/basics/#demo, open it to codesandbox, and look at the installed dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

@material-ui/utils.

Copy link
Member

@eps1lon eps1lon Aug 26, 2020

Choose a reason for hiding this comment

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

For instance, take this demo material-ui.com/system/basics/#demo, open it to codesandbox, and look at the installed dependencies.

Maybe tell me what you think is wrong?

Copy link
Member Author

@oliviertassinari oliviertassinari Aug 26, 2020

Choose a reason for hiding this comment

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

@material-ui/utils

Cool, I will fix that so we can merge this pull request as is. Happy to have surfaced this issue.

Maybe tell me what you think is wrong?

Capture d’écran 2020-08-26 à 11 27 28

Copy link
Member

Choose a reason for hiding this comment

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

The assumption is still wrong. I don't understand why we can't keep the correct assumption and extend the packages that do ship types? Adding types to /utils is not really worth it at this this time.

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 current approach forces to keep track of a list of packages that support TypeScript. Assuming we will add 10 new packages, I don't see the value of having to think about it when we can go all-in on TypeScript. The value of TypeScript support of /utils is so material-ui-x can use the package more efficiently. e.g. https://github.com/mui-org/material-ui-x/blob/fc207098f9c919faa88ec5cb827a37f5d7b87e9b/packages/grid/x-grid/src/XGrid.tsx#L3

Copy link
Member Author

@oliviertassinari oliviertassinari Aug 26, 2020

Choose a reason for hiding this comment

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

So in both cases, it doesn't work (@types/material-uiSystem doesn't exist and will likely never), we might as well well pick the approach that has a chance to eventually work.

@oliviertassinari oliviertassinari dismissed eps1lon’s stale review August 29, 2020 10:59

I believe the concern was answer with 1. #22346 (comment), 2. long term objective to go all-in on TypeScript, 3. #22367

@eps1lon eps1lon merged commit dbac30f into mui:next Sep 3, 2020
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants