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 codesandbox generation logic #22221

Merged
merged 2 commits into from Aug 16, 2020

Conversation

oliviertassinari
Copy link
Member

When using the export to codesandbox feature of the demos with the data grid, we get: https://codesandbox.io/s/quirky-galois-9kfv5?file=/demo.tsx. For instance, using https://deploy-preview-165--material-ui-x.netlify.app/components/autocomplete/#ComboBox.tsx. I think that we can simply include @material-ui/core, always in the list of dependency. It seems to be a simple default, with no significant downside.

Closes mui/mui-x#157

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

mui-pr-bot commented Aug 15, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 7631887

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.

The existing logic considered peer dependencies which core seems to be. The lab has a peer on core and so should the grid.

While the new logic is a decent approximation I see no reason to approximate it if we already have existing accurate logic.

@oliviertassinari
Copy link
Member Author

@eps1lon The motivation would be to edge for a known future, assuming we will have dozens of packages. Maintaining the list of peer dependencies could be overkill compared to the cost of overloading in codesandbox. It was already frustrating for @material-ui/x-grid and @material-ui/data-grid, what is it going to be later on? But I don't have a strong preference. I'm also happy to not anticipate, to see later.

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.

The point is that if the logic for peer dependencies is lacking then it's lacking for every package not just core. This is the sort of code we'll forgot about if we change the package structure and in line with "no abstraction is better then the wrong one".

It seems to me the existing logic isn't re-used because it might look "unclean" or includes "just copying code". Both these things are fine since they better reveal the underlying logic.

@oliviertassinari oliviertassinari merged commit 743384b into mui:next Aug 16, 2020
@oliviertassinari oliviertassinari deleted the docs-fix-codesandbox branch August 16, 2020 17:54
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.

[docs] Opening the data grid demos in codesandbox doesn't work
3 participants