-
-
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] Re-add nx and setup build caching #38752
Conversation
Netlify deploy previewhttps://deploy-preview-38752--material-ui.netlify.app/ Bundle size report |
b5efa52
to
00e913b
Compare
Since the |
00e913b
to
6dcc6cb
Compare
Ok. I've updated |
d81ab26
to
882bc45
Compare
You can run
Agreed, maybe once we're publishing from CI we can think about enabling caching agin? There has been some exploration around introducing a task runner to set up dependencies between scripts:
I'll create a shaping page on notion to collect feedback across teams |
882bc45
to
505ceda
Compare
505ceda
to
7ec9004
Compare
Why not solve this with a build watch mode? This sounds like it would be faster in dev mode, and more deterministic than using nx cache. |
I can try adding a watch mode if nx has one. That way it'll continously build the changed package. But the flow still remains same mainly because I need to import items in the config file itself (vite/webpack) which doesn't work directly. So in the consumer app, I still need to do yarn install to get the changes. |
@brijeshb42 I was thinking of vite build watch mode vitejs/vite#1434 (not nx). Also, I guess we could bypass the build as we do it for the rest of the docs by consuming the source directly. I usually default to doing this out of simplicity, e.g. to not have to think of build until it's for releasing npm packages. |
The problem is that vite watch mode will only work on source files, not for the vite config file itself where we import the theme from material and pass it to our plugin. It would've worked perfectly fine if this import was in any of the app files. In the case of |
Indeed, the way our dev mode in the docs works is by aliasing the dependent workspaces to their source files. The aliasing happens in the Next.js app compilation and doesn't apply to the next.config.js. yarn workspace linking doesn't work for us because our package.json files don't have module resolution fields set up (that gets added during the build in the build folder which is not a workspace). @brijeshb42 From your comments I deduce that your current DX on this package is as follows: You have a small test project, in which you've linked the |
@Janpot You are exactly right. That is the reason for this PR |
Ok, then I think the approach could indeed be to limit which packages are being built. Have you tried scoping down the command to only one workspace?
or
I don't want to block this PR if there is no alternative, but my personal preference would also be to wait with caching if we have other options. If we end up setting up |
I did have a |
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.
Ok for me 👍
If anyone else doesn't have any objections, I'll merge this tomorrow before release PR. |
First run of
release:build
Subsequent run of
release:build
nx
is especially helpful to me while I am working on zero-runtime packages as they can't be consumed directly as of now. They need to be built everytime before consumption in their respective apps.