-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Shift aliasing responsibilities from babel to webpack #33199
Conversation
|
test: /\.(js|mjs|jsx)$/, | ||
resourceQuery: { not: [/raw/] }, | ||
include: | ||
/node_modules(\/|\\)(notistack|@mui(\/|\\)x-data-grid|@mui(\/|\\)x-data-grid-pro|@mui(\/|\\)x-license-pro|@mui(\/|\\)x-data-grid-generator|@mui(\/|\\)x-date-pickers-pro|@mui(\/|\\)x-date-pickers)/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to test that notistack and x-data-grid are still using the local version of Material UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work for x-data-grid
(I left the externals in). Inspected notistack
, the version installed doesn't seem to be importing any @mui/
packages anywhere. It added us in peerDependencies
for some reason though.
Screen.Recording.2022-06-17.at.23.43.09.mov
What about scripts executed with babel-node? There is a couple of them that import from @mui/ scoped packages. They may need the aliases defined in Babel config. |
This PR only changes it for the docs. We can phase out babel-node in separate efforts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about scripts executed with babel-node? There is a couple of them that import from @mui/ scoped packages. They may need the aliases defined in Babel config.
Actually, the scripts will just use linked packages from yarn workspaces, so they should work just fine.
'@mui/base': path.resolve(__dirname, '../packages/mui-base/src'), | ||
'@mui/material-next': path.resolve(__dirname, '../packages/mui-material-next/src'), | ||
'@mui/joy': path.resolve(__dirname, '../packages/mui-joy/src'), | ||
docs: path.resolve(__dirname, './'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs
are likely not necessary to be specified here. Workspace linking should work just fine.
@michaldudak FYI this PR may be superseded by #35197 |
Superseded by https://github.com/mui/material-ui/pull/40792/files |
next-transpile-modules
compile workspace dependenciesThis avoids the need to specify the aliasing again for transpiled modules.
In an ideal world we'd avoid aliasing altogether. In Toolpad we avoid them by building and watching each of the workspaces separately.