Skip to content

[infra] WIP - use .mjs extension instead of nested package.json #46500

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

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Jul 10, 2025

We're building types in topological order, so we can rely on types of dependencies existing. We can remove the paths and references from these files and make those builds self-contained. This is necessary to be able to rewrite generated .d.ts files to .d.mts. Otherwise typescript tries to find source files for those .d.mts files and those don't exist (it looks for .mts source files).

@mui-bot
Copy link

mui-bot commented Jul 10, 2025

Netlify deploy preview

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

Bundle size report

Bundle Parsed Size Gzip Size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against b59579a

@brijeshb42 brijeshb42 force-pushed the wip-mjs branch 4 times, most recently from 24185d9 to 1d174b6 Compare July 11, 2025 09:32
"build:stable": "node ../../scripts/build.mjs stable",
"build:types": "tsx ../../scripts/buildTypes.mts",
"build:copy-files": "node ../../scripts/copyFiles.mjs",
"build:stable": "MUI_EXPERIMENTAL_MJS=true node ../../scripts/build.mjs stable",
Copy link
Member Author

@Janpot Janpot Jul 14, 2025

Choose a reason for hiding this comment

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

I was thinking we could just set this in CI globally? Then test with the pkg-pr-new packages on that parcel project

@Janpot Janpot changed the title [infra] WIP - use .mjs extension instead of nexted package.json [infra] WIP - use .mjs extension instead of nested package.json Jul 16, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 16, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 16, 2025
@@ -239,14 +239,6 @@ jobs:
pnpm --filter @mui/material typescript:module-augmentation
pnpm --filter @mui/joy typescript:module-augmentation
pnpm --filter @mui/system typescript:module-augmentation
- run:
Copy link
Member Author

@Janpot Janpot Jul 16, 2025

Choose a reason for hiding this comment

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

Getting rid of this. It does exactly nothing as far as I can see. Have enquired about this before and never received any comment on this doing something useful.

"packageExtensions": {
"@pigment-css/react": {
"peerDependencies": {
"@mui/types": "7"
Copy link
Member Author

Choose a reason for hiding this comment

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

Missing peer dependency in pigment

@@ -3,7 +3,7 @@
// Actual .ts source files are transpiled via babel
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

What does removing this do ?

Copy link
Member Author

@Janpot Janpot Jul 17, 2025

Choose a reason for hiding this comment

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

Makes it a standalone project, without project references. We're not building with tsc --buid so project references don't do much for us. We're running our own builds in order. We can't use tsc --build because that doesn't support being run in parallel on projects that share project references. The only way we could potentially use it is to generate all type declarations at once with a single tsc command for the whole repo. Or with parallellism set to 1 for the build. At which point we may as well just build in topological order, which we already do. In essence we don't need project references because with lerna we're already doing what project references do, without all the limitations they set.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants