[code-infra] Setup flat build for packages#47670
Conversation
f935950 to
699f017
Compare
Netlify deploy previewhttps://deploy-preview-47670--material-ui.netlify.app/ Bundle size report
|
538021a to
ffaafcb
Compare
ffaafcb to
47bde0e
Compare
0726c3b to
215cbb3
Compare
215cbb3 to
3bfe54e
Compare
da5075d to
c9af863
Compare
9da8f34 to
83de605
Compare
83de605 to
1e7a971
Compare
1e7a971 to
40ba657
Compare
2437862 to
bfb3ceb
Compare
bfb3ceb to
71dd2b5
Compare
71dd2b5 to
ff44f99
Compare
| - run: | ||
| name: Analyze exported typescript | ||
| command: pnpm test:attw | ||
| no_output_timeout: 20m |
There was a problem hiding this comment.
It takes more time by attw since it now checks the paths individually. It used to skip the * paths.
ff44f99 to
90da40c
Compare
| "author": "MUI Team", | ||
| "description": "Codemod scripts for Material UI.", | ||
| "bin": "./codemod.js", | ||
| "bin": "./src/codemod.js", |
There was a problem hiding this comment.
Will get transformed after build.
| "test": "pnpm --workspace-root test:unit --project \"*:@mui/icons-material\"", | ||
| "typescript": "tsc -p tsconfig.json", | ||
| "attw": "attw --pack ./build --exclude-entrypoints esm --include-entrypoints Close" | ||
| "attw-icons": "attw --pack ./build" |
There was a problem hiding this comment.
Changed the script name so that it does not run with pnpm test:attw since it'll take too much time to validate with so many new entries and block the CI.
Instead, it'll now run whenever the files are built again.
| }, | ||
| "exports": { | ||
| "./NProgressBar": "./src/NProgressBar/index.js", | ||
| "./SectionTitle": "./src/SectionTitle/index.tsx", |
There was a problem hiding this comment.
Explicit exports for non .ts files.
| "./transitions": "./src/transitions/index.ts", | ||
| "./useLazyRipple": "./src/useLazyRipple/index.ts", | ||
| "./version": "./src/version/index.ts", | ||
| "./*": "./src/*/index.js" |
There was a problem hiding this comment.
Explicit listing of .ts entrypoints since they are less in number than .js entrypoints.
90da40c to
c67d073
Compare
docs/data/material/getting-started/templates/checkout/components/PaymentForm.tsx
Outdated
Show resolved
Hide resolved
43ff752 to
74f1553
Compare
1. No more `esm` subdirectory inside `build` for es module files 2. Output is as per package.json's type value 3. For module, js files corresponds to esm and cjs files correspond to commonjs. 4. For commonjs or no value, js files are commonjs and mjs files correspond to module/esm. 5. Same for dts file, it'll be `d.ts` and `d.mts` for commonjs and `d.ts` and `d.cts` for module.
74f1553 to
029f7af
Compare
Not really if they are using barrel imports.
Its not a breaking change. I want to test this in alpha though just in case. If everything works, we can look into back-porting it. |
esmsubdirectory insidebuildfor es module filescommonjs.
correspond to module/esm.
d.tsandd.mtsfor commonjs andd.tsandd.ctsfor module.@mui/icons-materialsince it already has the prebuilt files. I built the files again intoliband removed oldlibdirectory. Updated its scripts to outputmjsandd.mtsfiles as well.package.jsonare now expanded to point to the files directly to have maximum bundler support (including codesandbox and stackblitz)."./*": "./src/*/index.ts"or"./*": "./src/*/index.js"While reviewing, please ignore the last commit has it has auto-generated files from icons package.