Skip to content

Commit 8e69f66

Browse files
authored
Merge branch 'master' into styled-engine-ssr
2 parents 9c02d07 + c3d0272 commit 8e69f66

17 files changed

+1983
-1267
lines changed

.circleci/config.yml

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -592,70 +592,46 @@ jobs:
592592
environment:
593593
DANGER_COMMAND: prepareBundleSizeReport
594594
- setup_corepack
595+
595596
- run:
596597
name: build @mui packages
597598
command: pnpm lerna run --ignore @mui/icons-material --concurrency 6 --scope "@mui/*" build
599+
- aws-cli/setup:
600+
aws_access_key_id: $AWS_ACCESS_KEY_ID_ARTIFACTS
601+
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY_ARTIFACTS
602+
region: ${AWS_REGION_ARTIFACTS}
603+
598604
- run:
599-
name: create @mui/material canary distributable
605+
name: create and upload a size snapshot
600606
command: |
601-
cd packages/mui-material/build
602-
npm version 0.0.0-canary.${CIRCLE_SHA1} --no-git-tag-version
603-
npm pack
604-
mv mui-material-0.0.0-canary.${CIRCLE_SHA1}.tgz ../../../mui-material.tgz
607+
export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID_ARTIFACTS
608+
export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY_ARTIFACTS
609+
export AWS_REGION=$AWS_REGION_ARTIFACTS
610+
pnpm size:snapshot --concurrency 6
611+
612+
# === LEGACY START ===
613+
# remove once the UI can handle the new format
614+
# persist size snapshot on S3
605615
- when:
606616
# don't run on PRs
607617
condition:
608618
not:
609619
matches:
610-
# "^pull/\d+" is not valid YAML
611-
# "^pull/\\d+" matches neither 'pull/1' nor 'main'
612-
# Note that we want to include 'pull/1', 'pull/1/head' and ''pull/1/merge'
613-
pattern: '^pull/.+$'
614-
value: << pipeline.git.branch >>
620+
pattern: '.+'
621+
value: '${CIRCLE_PULL_REQUEST}'
615622
steps:
616-
- aws-cli/setup:
617-
aws_access_key_id: $AWS_ACCESS_KEY_ID_ARTIFACTS
618-
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY_ARTIFACTS
619-
region: ${AWS_REGION_ARTIFACTS}
620-
# Upload distributables to S3
621623
- aws-s3/copy:
622-
from: mui-material.tgz
624+
arguments: --content-type application/json
625+
from: size-snapshot.json
623626
to: s3://mui-org-ci/artifacts/$CIRCLE_BRANCH/$CIRCLE_SHA1/
624-
- store_artifacts:
625-
path: mui-material.tgz
626-
destination: mui-material.tgz
627-
- run:
628-
name: create a size snapshot
629-
command: pnpm size:snapshot
627+
# === LEGACY END ===
628+
629+
# Keep the artifact storage as a CircleCI artifact
630630
- store_artifacts:
631631
name: persist size snapshot as pipeline artifact
632632
path: size-snapshot.json
633633
destination: size-snapshot.json
634-
- when:
635-
# don't run on PRs
636-
condition:
637-
not:
638-
matches:
639-
# "^pull/\d+" is not valid YAML
640-
# "^pull/\\d+" matches neither 'pull/1' nor 'main'
641-
# Note that we want to include 'pull/1', 'pull/1/head' and ''pull/1/merge'
642-
pattern: '^pull/.+$'
643-
value: << pipeline.git.branch >>
644-
steps:
645-
- aws-cli/setup:
646-
aws_access_key_id: $AWS_ACCESS_KEY_ID_ARTIFACTS
647-
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY_ARTIFACTS
648-
region: ${AWS_REGION_ARTIFACTS}
649-
# persist size snapshot on S3
650-
- aws-s3/copy:
651-
arguments: --content-type application/json
652-
from: size-snapshot.json
653-
to: s3://mui-org-ci/artifacts/$CIRCLE_BRANCH/$CIRCLE_SHA1/
654-
# symlink size-snapshot to latest
655-
- aws-s3/copy:
656-
arguments: --content-type application/json
657-
from: size-snapshot.json
658-
to: s3://mui-org-ci/artifacts/$CIRCLE_BRANCH/latest/
634+
659635
- run:
660636
name: Run danger on PRs
661637
command: pnpm danger ci --fail-on-errors

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dist
3737
node_modules
3838
package-lock.json
3939
size-snapshot.json
40+
bundle-sizes/
4041
docs/public/static/blog/feed/*
4142
# vale downloaded config
4243
.github/styles/

dangerFileContent.ts

Lines changed: 0 additions & 265 deletions
This file was deleted.

dangerfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const tsx = require('tsx/cjs/api');
44
// danger uses babelify under the hood. The implementation is buggy and fails on our
55
// custom plugins in our codebase. We'll just disable it and do our own compilation.
66
// Danger must always be run with envirnonent variable `DANGER_DISABLE_TRANSPILATION="true"`.
7-
tsx.require('./dangerFileContent', __filename);
7+
tsx.require('./scripts/dangerFileContent', __filename);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"valelint": "pnpm vale sync && git ls-files | grep -h \".md$\" | xargs pnpm vale --filter='.Level==\"error\"'",
5151
"prettier": "pretty-quick --ignore-path .eslintignore --branch master",
5252
"prettier:all": "prettier --write . --ignore-path .eslintignore",
53-
"size:snapshot": "node --max-old-space-size=4096 ./scripts/sizeSnapshot/create",
54-
"size:why": "pnpm size:snapshot --analyze",
53+
"size:snapshot": "pnpm -F ./test/bundle-size check",
54+
"size:why": "pnpm size:snapshot --analyze --accurateBundles",
5555
"start": "pnpm install && pnpm docs:dev",
5656
"test": "node scripts/test.mjs",
5757
"tc": "nx run nx_test_tc",
@@ -122,6 +122,7 @@
122122
"@babel/register": "^7.27.1",
123123
"@mui-internal/api-docs-builder": "workspace:^",
124124
"@mui-internal/api-docs-builder-core": "workspace:^",
125+
"@mui/internal-bundle-size-checker": "^1.0.5",
125126
"@mui/internal-babel-plugin-resolve-imports": "^2.0.3",
126127
"@mui/internal-babel-plugin-minify-errors": "^2.0.4",
127128
"@mui/internal-docs-utils": "workspace:^",

0 commit comments

Comments
 (0)