diff --git a/.circleci/comment.js b/.circleci/comment.js index 3fe410e9f4d..c2af610eb7d 100644 --- a/.circleci/comment.js +++ b/.circleci/comment.js @@ -79,9 +79,6 @@ async function run() { body: `Build successful! 🎉 * [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html) - * [View the storybook-19](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-19/index.html) - * [View the storybook-17](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-17/index.html) - * [View the storybook-16](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-16/index.html) * [View the S2 storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html) * [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)` }); diff --git a/.circleci/config.yml b/.circleci/config.yml index d3c4b269317..95442fd2782 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,7 +104,7 @@ jobs: - ~/react-spectrum key: react-spectrum17-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - install-19: + install-18: executor: rsp-large steps: - checkout @@ -119,12 +119,34 @@ jobs: - run: name: build command: | - yarn install --immutable && yarn install-19 + yarn install --immutable && yarn install-18 - save_cache: paths: - ~/react-spectrum - key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + key: react-spectrum-18-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + + install-canary: + executor: rsp-large + steps: + - checkout + + - run: + name: Write npmrc + command: | + if [ $NPM_PASSWORD ]; then + cp .circleci/.npmrc .npmrc + fi + + - run: + name: build + command: | + yarn install --immutable && yarn install-canary + + - save_cache: + paths: + - ~/react-spectrum + key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} test-ssr: executor: rsp-xlarge @@ -184,11 +206,22 @@ jobs: command: | yarn test:ssr - test-ssr-19: + test-ssr-18: + executor: rsp-xlarge + steps: + - restore_cache: + key: react-spectrum-18-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + + - run: + name: test ssr + command: | + yarn test:ssr + + test-ssr-canary: executor: rsp-xlarge steps: - restore_cache: - key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - run: name: test ssr @@ -243,12 +276,12 @@ jobs: - store_artifacts: path: ~/junit - test-19: + test-18: parallelism: 3 executor: rsp-xlarge steps: - restore_cache: - key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + key: react-spectrum-18-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - run: mkdir ~/junit @@ -257,10 +290,34 @@ jobs: command: | shopt -s globstar TESTFILES=$(circleci tests glob "packages/**/*.test.[tj]{s,sx}" | circleci tests split --split-by=timings) - JEST_JUNIT_OUTPUT_NAME="junit-19.xml" yarn test ${TESTFILES} + JEST_JUNIT_OUTPUT_NAME="junit-18.xml" yarn test ${TESTFILES} - run: - command: cp junit-19.xml ~/junit/ + command: cp junit-18.xml ~/junit/ + when: always + - store_test_results: + path: ~/junit + - store_artifacts: + path: ~/junit + + test-canary: + parallelism: 3 + executor: rsp-xlarge + steps: + - restore_cache: + key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + + - run: mkdir ~/junit + + - run: + name: test + command: | + shopt -s globstar + TESTFILES=$(circleci tests glob "packages/**/*.test.[tj]{s,sx}" | circleci tests split --split-by=timings) + JEST_JUNIT_OUTPUT_NAME="junit-canary.xml" yarn test ${TESTFILES} + + - run: + command: cp junit-canary.xml ~/junit/ when: always - store_test_results: path: ~/junit @@ -368,51 +425,6 @@ jobs: paths: - '*/storybook/' - storybook-16: - executor: rsp-large - steps: - - restore_cache: - key: react-spectrum16-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - - - run: - name: build storybook-16 - command: make storybook-16 - - - persist_to_workspace: - root: dist - paths: - - '*/storybook-16/' - - storybook-17: - executor: rsp-large - steps: - - restore_cache: - key: react-spectrum17-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - - - run: - name: build storybook-17 - command: make storybook-17 - - - persist_to_workspace: - root: dist - paths: - - '*/storybook-17/' - - storybook-19: - executor: rsp-large - steps: - - restore_cache: - key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} - - - run: - name: build storybook-19 - command: make storybook-19 - - - persist_to_workspace: - root: dist - paths: - - '*/storybook-19/' - storybook-s2: executor: rsp-large steps: @@ -788,7 +800,8 @@ workflows: - install - install-16 - install-17 - - install-19 + - install-18 + - install-canary - test-ssr: requires: - install @@ -807,12 +820,18 @@ workflows: - test-17: requires: - install-17 - - test-19: + - test-18: + requires: + - install-18 + - test-ssr-18: + requires: + - install-18 + - test-canary: requires: - - install-19 - - test-ssr-19: + - install-canary + - test-ssr-canary: requires: - - install-19 + - install-canary - test-esm: requires: - install @@ -844,15 +863,6 @@ workflows: - storybook: requires: - install - - storybook-16: - requires: - - install-16 - - storybook-17: - requires: - - install-17 - - storybook-19: - requires: - - install-19 - storybook-s2: requires: - install @@ -907,11 +917,10 @@ workflows: - test-16 - test-ssr-17 - test-17 + - test-ssr-18 + - test-18 - test-esm - storybook - - storybook-16 - - storybook-17 - - storybook-19 - storybook-s2 - docs - deploy-verdaccio: diff --git a/Makefile b/Makefile index 5d807472d98..9bb9485d250 100644 --- a/Makefile +++ b/Makefile @@ -81,15 +81,6 @@ icons: packages/@spectrum-icons/workflow/src packages/@spectrum-icons/color/src storybook: NODE_ENV=production yarn build:storybook -storybook-16: - yarn build:storybook-16 - -storybook-17: - yarn build:storybook-17 - -storybook-19: - yarn build:storybook-19 - # for now doesn't have deploy since v3 doesn't have a place for docs and stuff yet ci: $(MAKE) publish diff --git a/package.json b/package.json index 800bf981ed2..ef3c35dfa9b 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,10 @@ "check-types": "tsc", "install-16": "node scripts/react-16-install-prep.mjs && yarn add react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs", "install-17": "node scripts/react-17-install-prep.mjs && yarn add react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 react-test-renderer@^16.9.0 && node scripts/oldReactSupport.mjs", - "install-19": "node scripts/react-19-install-prep.mjs && yarn add react@next react-dom@next", + "install-18": "node scripts/react-18-install-prep.mjs && yarn add react@^18 react-dom@^18", + "install-canary": "node scripts/react-canary-install-prep.mjs && yarn add react@canary react-dom@canary", "start": "cross-env NODE_ENV=storybook storybook dev -p 9003 --ci -c '.storybook'", "build:storybook": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook", - "build:storybook-16": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-16", - "build:storybook-17": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-17", - "build:storybook-19": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-19", "start:chromatic": "CHROMATIC=1 NODE_ENV=storybook storybook dev -p 9004 --ci -c '.chromatic'", "build:chromatic": "CHROMATIC=1 storybook build -c .chromatic -o dist/$(git rev-parse HEAD)/chromatic", "start:chromatic-fc": "CHROMATIC=1 NODE_ENV=storybook storybook dev -p 9005 --ci -c '.chromatic-fc'", @@ -189,9 +187,9 @@ "postcss-import": "^15.1.0", "prop-types": "^15.6.0", "raf": "^3.4.0", - "react": "^18.2.0", + "react": "^19.1.0", "react-axe": "^3.0.2", - "react-dom": "^18.2.0", + "react-dom": "^19.1.0", "react-frame-component": "^5.0.0", "react-test-renderer": "^18.3.1", "recast": "^0.23", diff --git a/scripts/react-18-install-prep.mjs b/scripts/react-18-install-prep.mjs new file mode 100644 index 00000000000..c081c96713a --- /dev/null +++ b/scripts/react-18-install-prep.mjs @@ -0,0 +1,12 @@ + +import fs from 'node:fs'; + +try { + let content = fs.readFileSync('./package.json', 'utf8'); + let pkg = JSON.parse(content); + pkg.resolutions['react'] = '^18'; + pkg.resolutions['react-dom'] = '^18'; + fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2)); +} catch (e) { + console.error('Error:', e); +} diff --git a/scripts/react-19-install-prep.mjs b/scripts/react-canary-install-prep.mjs similarity index 88% rename from scripts/react-19-install-prep.mjs rename to scripts/react-canary-install-prep.mjs index 1d576aeb762..76f60474251 100644 --- a/scripts/react-19-install-prep.mjs +++ b/scripts/react-canary-install-prep.mjs @@ -1,9 +1,9 @@ import fs from 'node:fs'; import spawn from 'cross-spawn'; -// setting the version to 'next' won't work due to a yarn 1 bug -let results = JSON.parse(await run('npm', ['view', 'react@next', '--json'])); -let version = results['dist-tags']['next']; +// setting the version to 'canary' won't work due to a yarn 1 bug +let results = JSON.parse(await run('npm', ['view', 'react@canary', '--json'])); +let version = results['dist-tags']['canary']; let data = fs.readFileSync('./packages/dev/docs/package.json'); let pkg = JSON.parse(data); pkg.dependencies['react'] = version; diff --git a/yarn.lock b/yarn.lock index 4ef455f53d1..39bf4251b68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27567,15 +27567,14 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0, react-dom@npm:^18.2.0": - version: 18.3.1 - resolution: "react-dom@npm:18.3.1" +"react-dom@npm:^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0, react-dom@npm:^19.1.0": + version: 19.1.0 + resolution: "react-dom@npm:19.1.0" dependencies: - loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.2" + scheduler: "npm:^0.26.0" peerDependencies: - react: ^18.3.1 - checksum: 10c0/a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85 + react: ^19.1.0 + checksum: 10c0/3e26e89bb6c67c9a6aa86cb888c7a7f8258f2e347a6d2a15299c17eb16e04c19194e3452bc3255bd34000a61e45e2cb51e46292392340432f133e5a5d2dfb5fc languageName: node linkType: hard @@ -27825,9 +27824,9 @@ __metadata: postcss-import: "npm:^15.1.0" prop-types: "npm:^15.6.0" raf: "npm:^3.4.0" - react: "npm:^18.2.0" + react: "npm:^19.1.0" react-axe: "npm:^3.0.2" - react-dom: "npm:^18.2.0" + react-dom: "npm:^19.1.0" react-frame-component: "npm:^5.0.0" react-test-renderer: "npm:^18.3.1" recast: "npm:^0.23" @@ -27935,12 +27934,10 @@ __metadata: languageName: node linkType: hard -"react@npm:^18.2.0": - version: 18.3.1 - resolution: "react@npm:18.3.1" - dependencies: - loose-envify: "npm:^1.1.0" - checksum: 10c0/283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3 +"react@npm:^19.1.0": + version: 19.1.0 + resolution: "react@npm:19.1.0" + checksum: 10c0/530fb9a62237d54137a13d2cfb67a7db6a2156faed43eecc423f4713d9b20c6f2728b026b45e28fcd72e8eadb9e9ed4b089e99f5e295d2f0ad3134251bdd3698 languageName: node linkType: hard @@ -28977,6 +28974,13 @@ __metadata: languageName: node linkType: hard +"scheduler@npm:^0.26.0": + version: 0.26.0 + resolution: "scheduler@npm:0.26.0" + checksum: 10c0/5b8d5bfddaae3513410eda54f2268e98a376a429931921a81b5c3a2873aab7ca4d775a8caac5498f8cbc7d0daeab947cf923dbd8e215d61671f9f4e392d34356 + languageName: node + linkType: hard + "semver-diff@npm:^2.0.0": version: 2.1.0 resolution: "semver-diff@npm:2.1.0"