material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs-infra] Fix broken sandboxes with relative module imports

Open bharatkashyap opened this issue 1 year ago • 1 comments

bharatkashyap avatar Jun 26 '24 22:06 bharatkashyap

Netlify deploy preview

https://deploy-preview-42767--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad) No bundle size changes

Generated by :no_entry_sign: dangerJS against f2ff725b9525d509573b9ab4b31dc8202d710eed

mui-bot avatar Jun 26 '24 22:06 mui-bot

@bharatkashyap I created #43145 fro mexperimental purpose.

My concern with the current solution is that you take into consideration that imports are from ./xxx which is not always the case. In MUI X we have two case where we could need deeper imports.

For example the tree-view is looking to define 2 or 3 datasets to reuse every where. So they would likely have path like ../datasets/products.json Same for the charts that might have more data sets but that could be shared across multiple pages (and so multiple folders)

In the PR, I propose to respect the file splitting in the generated codesandbox, but move all the files at the same level.

alexfauquette avatar Aug 01 '24 14:08 alexfauquette

[docs-infra][Do not merge] Fix broken sandboxes with relative module imports #43145

Thanks @alexfauquette for this! Your proposal makes sense to me; thanks for bringing to light this oversight :)

bharatkashyap avatar Aug 02 '24 06:08 bharatkashyap

I've replace the package-lock by the current one

The demo seems to work nice on both codesandbox and stackblitz :+1: https://deploy-preview-42767--material-ui.netlify.app/material-ui/react-autocomplete/#combo-box

alexfauquette avatar Aug 08 '24 14:08 alexfauquette