diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b222f2b64153..32e8324a879ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,40 +7,11 @@ aliases: - &environment TZ: /usr/share/zoneinfo/America/Los_Angeles - - &restore_yarn_cache - restore_cache: - name: Restore yarn cache - keys: - - v1-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }} - - v1-yarn_cache-{{ arch }}- - - v1-yarn_cache- - - - &yarn_install - run: - name: Install dependencies - command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn - - - &yarn_install_retry - run: - name: Install dependencies (retry) - when: on_fail - command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn - - - &save_yarn_cache - save_cache: - name: Save yarn cache - key: v1-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }} - paths: - - ~/.cache/yarn - - &restore_yarn_cache_fixtures_dom restore_cache: name: Restore yarn cache for fixtures/dom keys: - - v1-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}-fixtures/dom - - v1-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }} - - v1-yarn_cache-{{ arch }}- - - v1-yarn_cache- + - v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}-fixtures/dom - &yarn_install_fixtures_dom run: @@ -58,51 +29,36 @@ aliases: - &save_yarn_cache_fixtures_dom save_cache: name: Save yarn cache for fixtures/dom - key: v1-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}-fixtures/dom + key: v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}-fixtures/dom paths: - ~/.cache/yarn - - &save_node_modules - save_cache: - name: Save node_modules cache - # Cache only for the current revision to prevent cache injections from - # malicious PRs. - key: v1-node_modules-{{ arch }}-{{ .Revision }} - paths: - - node_modules - - packages/eslint-plugin-react-hooks/node_modules - - packages/react-art/node_modules - - packages/react-client/node_modules - - packages/react-devtools-core/node_modules - - packages/react-devtools-extensions/node_modules - - packages/react-devtools-inline/node_modules - - packages/react-devtools-shared/node_modules - - packages/react-devtools-shell/node_modules - - packages/react-devtools-timeline/node_modules - - packages/react-devtools/node_modules - - packages/react-dom/node_modules - - packages/react-interactions/node_modules - - packages/react-native-renderer/node_modules - - packages/react-reconciler/node_modules - - packages/react-server-dom-relay/node_modules - - packages/react-server-dom-webpack/node_modules - - packages/react-server-native-relay/node_modules - - packages/react-server/node_modules - - packages/react-test-renderer/node_modules - - packages/react/node_modules - - packages/scheduler/node_modules - - - &restore_node_modules - restore_cache: - name: Restore node_modules cache - keys: - - v1-node_modules-{{ arch }}-{{ .Revision }} - - &TEST_PARALLELISM 20 - &attach_workspace at: build +commands: + setup_node_modules: + description: "Restore node_modules" + steps: + - restore_cache: + name: Restore yarn cache + keys: + - v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }} + - run: + name: Install dependencies + command: | + yarn install --frozen-lockfile --cache-folder ~/.cache/yarn + if [ $? -ne 0 ]; then + yarn install --frozen-lockfile --cache-folder ~/.cache/yarn + fi + - save_cache: + name: Save yarn cache + key: v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }} + paths: + - ~/.cache/yarn + # The CircleCI API doesn't yet support triggering a specific workflow, but it # does support triggering a pipeline. So as a workaround you can triggger the # entire pipeline and use parameters to disable everything except the workflow @@ -115,28 +71,13 @@ parameters: default: '' jobs: - setup: - docker: *docker - environment: *environment - steps: - - checkout - - run: - name: NodeJS Version - command: node --version - - *restore_yarn_cache - - *restore_node_modules - - *yarn_install - - *yarn_install_retry - - *save_yarn_cache - - *save_node_modules - yarn_lint: docker: *docker environment: *environment steps: - checkout - - *restore_node_modules + - setup_node_modules - run: node ./scripts/prettier/index - run: node ./scripts/tasks/eslint - run: ./scripts/circleci/check_license.sh @@ -150,7 +91,7 @@ jobs: steps: - checkout - - *restore_node_modules + - setup_node_modules - run: node ./scripts/tasks/flow-ci scrape_warning_messages: @@ -159,7 +100,7 @@ jobs: steps: - checkout - - *restore_node_modules + - setup_node_modules - run: command: | mkdir -p ./build @@ -175,7 +116,7 @@ jobs: parallelism: 40 steps: - checkout - - *restore_node_modules + - setup_node_modules - run: yarn build-combined - persist_to_workspace: root: . @@ -190,7 +131,7 @@ jobs: type: string steps: - checkout - - *restore_node_modules + - setup_node_modules - run: name: Download artifacts for revision command: | @@ -207,7 +148,7 @@ jobs: environment: *environment steps: - checkout - - *restore_node_modules + - setup_node_modules - run: name: Download artifacts for base revision command: | @@ -235,7 +176,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: echo "<< pipeline.git.revision >>" >> build/COMMIT_SHA # Compress build directory into a single tarball for easy download - run: tar -zcvf ./build.tgz ./build @@ -254,7 +195,7 @@ jobs: - attach_workspace: at: . - run: echo "<< pipeline.git.revision >>" >> build/COMMIT_SHA - - *restore_node_modules + - setup_node_modules - run: command: node ./scripts/tasks/danger @@ -265,7 +206,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: environment: RELEASE_CHANNEL: experimental @@ -280,7 +221,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: name: Playwright install deps command: | @@ -302,7 +243,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: ./scripts/circleci/download_devtools_regression_build.js << parameters.version >> --replaceBuild - run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion << parameters.version >> --ci @@ -317,7 +258,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: name: Playwright install deps command: | @@ -341,7 +282,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: yarn lint-build yarn_check_release_dependencies: @@ -351,7 +292,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: yarn check-release-dependencies @@ -361,7 +302,7 @@ jobs: steps: - checkout - attach_workspace: *attach_workspace - - *restore_node_modules + - setup_node_modules - run: name: Search build artifacts for unminified errors command: | @@ -374,7 +315,7 @@ jobs: steps: - checkout - attach_workspace: *attach_workspace - - *restore_node_modules + - setup_node_modules - run: name: Confirm generated inline Fizz runtime is up to date command: | @@ -390,7 +331,7 @@ jobs: type: string steps: - checkout - - *restore_node_modules + - setup_node_modules - run: yarn test <> --ci yarn_test_build: @@ -404,7 +345,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - run: yarn test --build <> --ci RELEASE_CHANNEL_stable_yarn_test_dom_fixtures: @@ -414,7 +355,7 @@ jobs: - checkout - attach_workspace: at: . - - *restore_node_modules + - setup_node_modules - *restore_yarn_cache_fixtures_dom - *yarn_install_fixtures_dom - *yarn_install_fixtures_dom_retry @@ -433,7 +374,7 @@ jobs: environment: *environment steps: - checkout - - *restore_node_modules + - setup_node_modules - run: name: Run fuzz tests command: | @@ -452,7 +393,7 @@ jobs: environment: *environment steps: - checkout - - *restore_node_modules + - setup_node_modules - run: name: Run publish script command: | @@ -465,27 +406,29 @@ jobs: workflows: version: 2 - # New workflow that will replace "stable" and "experimental" build_and_test: unless: << pipeline.parameters.prerelease_commit_sha >> jobs: - - setup: + - yarn_flow: filters: branches: ignore: - builds/facebook-www - - yarn_flow: - requires: - - setup - check_generated_fizz_runtime: - requires: - - setup + filters: + branches: + ignore: + - builds/facebook-www - yarn_lint: - requires: - - setup + filters: + branches: + ignore: + - builds/facebook-www - yarn_test: - requires: - - setup + filters: + branches: + ignore: + - builds/facebook-www matrix: parameters: args: @@ -509,11 +452,15 @@ workflows: - '-r=stable --env=development --persistent' - '-r=experimental --env=development --persistent' - yarn_build_combined: - requires: - - setup + filters: + branches: + ignore: + - builds/facebook-www - scrape_warning_messages: - requires: - - setup + filters: + branches: + ignore: + - builds/facebook-www - process_artifacts_combined: requires: - scrape_warning_messages @@ -551,8 +498,7 @@ workflows: branches: ignore: - main - requires: - - setup + - builds/facebook-www - sizebot: filters: branches: @@ -591,10 +537,7 @@ workflows: only: - main jobs: - - setup - - test_fuzz: - requires: - - setup + - test_fuzz devtools_regression_tests: unless: << pipeline.parameters.prerelease_commit_sha >> @@ -607,10 +550,7 @@ workflows: only: - main jobs: - - setup - download_build: - requires: - - setup revision: << pipeline.git.revision >> - build_devtools_and_process_artifacts: requires: @@ -642,11 +582,8 @@ workflows: publish_preleases: when: << pipeline.parameters.prerelease_commit_sha >> jobs: - - setup - publish_prerelease: name: Publish to Next channel - requires: - - setup commit_sha: << pipeline.parameters.prerelease_commit_sha >> release_channel: stable dist_tag: "next" @@ -674,11 +611,8 @@ workflows: only: - main jobs: - - setup - publish_prerelease: name: Publish to Next channel - requires: - - setup commit_sha: << pipeline.git.revision >> release_channel: stable dist_tag: "next" diff --git a/.eslintrc.js b/.eslintrc.js index b5205817a4c92..13746fb3c672d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -434,7 +434,6 @@ module.exports = { es6: true, node: true, jest: true, - jasmine: true, }, globals: { diff --git a/.prettierrc.js b/.prettierrc.js index 6e5dcb710f0f0..4f7ef193130c9 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -8,8 +8,8 @@ module.exports = { jsxBracketSameLine: true, trailingComma: 'es5', printWidth: 80, - parser: 'babel', - + parser: 'flow', + arrowParens: 'avoid', overrides: [ { files: esNextPaths, diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d319384e44a..8f6df415e32a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,10 @@ The existing `renderToString` method keeps working but is discouraged. * **Layout Effects with Suspense**: When a tree re-suspends and reverts to a fallback, React will now clean up layout effects, and then re-create them when the content inside the boundary is shown again. This fixes an issue which prevented component libraries from correctly measuring layout when used with Suspense. * **New JS Environment Requirements**: React now depends on modern browsers features including `Promise`, `Symbol`, and `Object.assign`. If you support older browsers and devices such as Internet Explorer which do not provide modern browser features natively or have non-compliant implementations, consider including a global polyfill in your bundled application. +### Scheduler (Experimental) + +* Remove unstable `scheduler/tracing` API + ## Notable Changes ### React @@ -193,6 +197,10 @@ The existing `renderToString` method keeps working but is discouraged. * Fix a mistake in the Node loader. ([#22537](https://github.com/facebook/react/pull/22537) by [@btea](https://github.com/btea)) * Use `globalThis` instead of `window` for edge environments. ([#22777](https://github.com/facebook/react/pull/22777) by [@huozhi](https://github.com/huozhi)) +### Scheduler (Experimental) + +* Remove unstable `scheduler/tracing` API ([#20037](https://github.com/facebook/react/pull/20037) by [@bvaughn](https://github.com/bvaughn)) + ## 17.0.2 (March 22, 2021) ### React DOM diff --git a/dangerfile.js b/dangerfile.js index 2322e85654474..e29426afda7a9 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -97,7 +97,7 @@ function row(result, baseSha, headSha) { return rowArr.join(' | '); } -(async function() { +(async function () { // Use git locally to grab the commit which represents the place // where the branches differ @@ -241,8 +241,9 @@ Comparing: ${baseSha}...${headSha} ## Critical size changes -Includes critical production bundles, as well as any change greater than ${CRITICAL_THRESHOLD * - 100}%: +Includes critical production bundles, as well as any change greater than ${ + CRITICAL_THRESHOLD * 100 + }%: ${header} ${criticalResults.join('\n')} diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index 93ae5b010bc90..89e126ba234cf 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -1998,7 +1998,7 @@ | `colSpan=(null)`| (initial, ssr error, ssr mismatch)| `` | | `colSpan=(undefined)`| (initial, ssr error, ssr mismatch)| `` | -## `content` (on `` inside `
`) +## `content` (on `` inside ``) | Test Case | Flags | Result | | --- | --- | --- | | `content=(string)`| (changed)| `"a string"` | @@ -5123,7 +5123,7 @@ | `htmlFor=(null)`| (initial)| `` | | `htmlFor=(undefined)`| (initial)| `` | -## `http-equiv` (on `` inside `
`) +## `http-equiv` (on `` inside ``) | Test Case | Flags | Result | | --- | --- | --- | | `http-equiv=(string)`| (changed, warning)| `"a string"` | @@ -5148,7 +5148,7 @@ | `http-equiv=(null)`| (initial, warning)| `` | | `http-equiv=(undefined)`| (initial, warning)| `` | -## `httpEquiv` (on `` inside `
`) +## `httpEquiv` (on `` inside ``) | Test Case | Flags | Result | | --- | --- | --- | | `httpEquiv=(string)`| (changed)| `"a string"` | @@ -6198,6 +6198,31 @@ | `lang=(null)`| (initial)| `` | | `lang=(undefined)`| (initial)| `` | +## `lang` (on `` inside ``) +| Test Case | Flags | Result | +| --- | --- | --- | +| `lang=(string)`| (changed, ssr mismatch)| `"a string"` | +| `lang=(empty string)`| (initial)| `` | +| `lang=(array with string)`| (changed, ssr mismatch)| `"string"` | +| `lang=(empty array)`| (initial)| `` | +| `lang=(object)`| (changed, ssr mismatch)| `"result of toString()"` | +| `lang=(numeric string)`| (changed, ssr mismatch)| `"42"` | +| `lang=(-1)`| (changed, ssr mismatch)| `"-1"` | +| `lang=(0)`| (changed, ssr mismatch)| `"0"` | +| `lang=(integer)`| (changed, ssr mismatch)| `"1"` | +| `lang=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` | +| `lang=(float)`| (changed, ssr mismatch)| `"99.99"` | +| `lang=(true)`| (initial, warning)| `` | +| `lang=(false)`| (initial, warning)| `` | +| `lang=(string 'true')`| (changed, ssr mismatch)| `"true"` | +| `lang=(string 'false')`| (changed, ssr mismatch)| `"false"` | +| `lang=(string 'on')`| (changed, ssr mismatch)| `"on"` | +| `lang=(string 'off')`| (changed, ssr mismatch)| `"off"` | +| `lang=(symbol)`| (initial, warning)| `` | +| `lang=(function)`| (initial, warning)| `` | +| `lang=(null)`| (initial)| `` | +| `lang=(undefined)`| (initial)| `` | + ## `length` (on `
` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | @@ -11373,6 +11398,56 @@ | `transform=(null)`| (initial)| `[]` | | `transform=(undefined)`| (initial)| `[]` | +## `transform-origin` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `transform-origin=(string)`| (changed, warning)| `"a string"` | +| `transform-origin=(empty string)`| (changed, warning)| `` | +| `transform-origin=(array with string)`| (changed, warning)| `"string"` | +| `transform-origin=(empty array)`| (changed, warning)| `` | +| `transform-origin=(object)`| (changed, warning)| `"result of toString()"` | +| `transform-origin=(numeric string)`| (changed, warning)| `"42"` | +| `transform-origin=(-1)`| (changed, warning)| `"-1"` | +| `transform-origin=(0)`| (changed, warning)| `"0"` | +| `transform-origin=(integer)`| (changed, warning)| `"1"` | +| `transform-origin=(NaN)`| (changed, warning)| `"NaN"` | +| `transform-origin=(float)`| (changed, warning)| `"99.99"` | +| `transform-origin=(true)`| (initial, warning)| `` | +| `transform-origin=(false)`| (initial, warning)| `` | +| `transform-origin=(string 'true')`| (changed, warning)| `"true"` | +| `transform-origin=(string 'false')`| (changed, warning)| `"false"` | +| `transform-origin=(string 'on')`| (changed, warning)| `"on"` | +| `transform-origin=(string 'off')`| (changed, warning)| `"off"` | +| `transform-origin=(symbol)`| (initial, warning)| `` | +| `transform-origin=(function)`| (initial, warning)| `` | +| `transform-origin=(null)`| (initial, warning)| `` | +| `transform-origin=(undefined)`| (initial, warning)| `` | + +## `transformOrigin` (on `` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `transformOrigin=(string)`| (changed)| `"a string"` | +| `transformOrigin=(empty string)`| (changed)| `` | +| `transformOrigin=(array with string)`| (changed)| `"string"` | +| `transformOrigin=(empty array)`| (changed)| `` | +| `transformOrigin=(object)`| (changed)| `"result of toString()"` | +| `transformOrigin=(numeric string)`| (changed)| `"42"` | +| `transformOrigin=(-1)`| (changed)| `"-1"` | +| `transformOrigin=(0)`| (changed)| `"0"` | +| `transformOrigin=(integer)`| (changed)| `"1"` | +| `transformOrigin=(NaN)`| (changed, warning)| `"NaN"` | +| `transformOrigin=(float)`| (changed)| `"99.99"` | +| `transformOrigin=(true)`| (initial, warning)| `` | +| `transformOrigin=(false)`| (initial, warning)| `` | +| `transformOrigin=(string 'true')`| (changed)| `"true"` | +| `transformOrigin=(string 'false')`| (changed)| `"false"` | +| `transformOrigin=(string 'on')`| (changed)| `"on"` | +| `transformOrigin=(string 'off')`| (changed)| `"off"` | +| `transformOrigin=(symbol)`| (initial, warning)| `` | +| `transformOrigin=(function)`| (initial, warning)| `` | +| `transformOrigin=(null)`| (initial)| `` | +| `transformOrigin=(undefined)`| (initial)| `` | + ## `type` (on `