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

[core] Improve imports from the core monorepo #10418

Closed
wants to merge 4 commits into from

Conversation

flaviendelangle
Copy link
Member

The only imports from @mui/monorepo left are @mui/monorepo/test
I would like move utils on the core repo to an internal package @mui-internal/test-utilities

@flaviendelangle flaviendelangle self-assigned this Sep 21, 2023
@flaviendelangle flaviendelangle added the core Infrastructure work going on behind the scenes label Sep 21, 2023
@mui-bot
Copy link

mui-bot commented Sep 21, 2023

Deploy preview: https://deploy-preview-10418--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 86db0bf

@flaviendelangle flaviendelangle marked this pull request as ready for review September 21, 2023 09:55
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love this change, I feel like the @mui/... prefix was a nice way to indicate that it comes from another MUI package. It would be nice if we could have a standardized form to rename packages from the monorepo.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like the existing docs and docsx approach is pretty well established in everyone's head, but I can also second this though, ideally, we should aim at using a similar approach to aliasing/naming all packages and currently docs, docsx and typescript-to-proptypes are probably the only exceptions. 🤔 🤷
This could become @mui/docs or @mui-internal/docs (although the former would be a better fit given how the alias names are chosen)

Copy link
Member Author

Choose a reason for hiding this comment

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

This could become @mui/docs

We already have this one but it's almost empty

I do agree that the current aliases are a mess.
But for me @mui/monorepo is not the solution.
I would prefer, as Lukas suggest to move the code on the doc to some @mui-internal packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

For me the main pain of @mui/monorepo is that in theory anything on the core repo is "public API" because it's used by us, so anytime they break something, maybe we are impacted.

The idea of removing this alias eventually, is to make clear which folders in there repo is public API and which one they can totally rework without caring for others.

So once we are not using @mui/monorepo anymore, we can start cleaning the other aliases (move to the new @mui-internal nomenclature everywhere would be a good start).

And then we will be able to move those new @mui-internal packages to another repo if we want.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok gotcha. I'm not sure how I feel about the non-required aliases overall, they do require getting used to. When I played with the babel config a few weeks ago I wasn't sure what was what. Non-magic stuff is easier for newcomers, and doesn't require engineers who update the configs to have as much accumulated knowledge of the project.

But I do see the benefits of @mui-internals, and if it was all standardized to that I would be reasonably happy.

Feel free to merge anyway, just wanted to voice my concerns.

Copy link
Member Author

Choose a reason for hiding this comment

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

What are you referring to when you talk about "non-required aliases" ?

My dream scenario would be that one day we have one repo for the infra with all the code published on NPM and versioned in well-defined packages.

Copy link
Contributor

Choose a reason for hiding this comment

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

The @mui/... to local ./packages are the required ones:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not following you

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Nice cleanup overall! 👍

import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
Copy link
Member

Choose a reason for hiding this comment

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

I feel like the existing docs and docsx approach is pretty well established in everyone's head, but I can also second this though, ideally, we should aim at using a similar approach to aliasing/naming all packages and currently docs, docsx and typescript-to-proptypes are probably the only exceptions. 🤔 🤷
This could become @mui/docs or @mui-internal/docs (although the former would be a better fit given how the alias names are chosen)

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 22, 2023
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@michelengelen michelengelen changed the base branch from master to next November 6, 2023 14:23
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 10, 2023
@flaviendelangle flaviendelangle force-pushed the monorepo-aliases branch 2 times, most recently from 96f9a5d to 3e0cc6e Compare November 10, 2023 08:57
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 23, 2023
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@flaviendelangle
Copy link
Member Author

Closing because a lot of things changed in the infra since I opened this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants