-
-
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
[core-infra] Add no-relative-packages #44489
[core-infra] Add no-relative-packages #44489
Conversation
ce8ccae
to
548208b
Compare
Netlify deploy previewhttps://deploy-preview-44489--material-ui.netlify.app/ Bundle size report |
it mostly is, the main problem I've seen so far is that it stops us from being able to rely on workspace topology to detect changes. e g. to run tests selectively. for things like the vitest config, we could always place those in their own package. |
@@ -4,6 +4,7 @@ import fetch from 'cross-fetch'; | |||
import fse from 'fs-extra'; | |||
import * as mui from '@mui/icons-material'; | |||
import synonyms from 'docs/data/material/components/material-icons/synonyms'; | |||
// eslint-disable-next-line import/no-relative-packages | |||
import myDestRewriter from '../../packages/mui-icons-material/renameFilters/material-design-icons'; |
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.
can likely be reorganized to live under this package instead. but low priority.
b0d8dd4
to
1b74b9e
Compare
// Some of these occurences are deliberate and fixing them will break things in repos that use @monorepo dependency | ||
'import/no-relative-packages': 'off', |
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.
The change of this PR
Oh, interesting, I would have assumed that change detections would resolve all imports, relative or absolute. In any cases, this PR seems safe to go with. I don't really like that it make it harder to import stuff relative, but I sense that the general desire of the team is to get more package isolation inside repositories, this helps. |
I assume change detection algorithms mostly work by following workspace dependencies and not so much by evaluating each and every potential import in each and every file in a package. I expect a change detection algorithm to only work reliably if all the package boundaries are respected religiously. |
Move mui/mui-x#15437 from MUI X to code-infra.
This breaks in Base UI. Some are nice, they show cases where we import private APIs in the
app/experiments
some are weird, e.g. https://github.com/mui/base-ui/blob/d7809157ccc737608acc70a1ecbb42dfbca7ae78/packages/mui-base/vitest.config.ts#L2 seems fine. So I guess it makes sense to move forward.