diff --git a/.eslintrc.js b/.eslintrc.js index ae108a37e3..49846c1f5e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -615,6 +615,8 @@ module.exports = { GetAnimationsOptions: 'readonly', Animatable: 'readonly', ScrollTimeline: 'readonly', + EventListenerOptionsOrUseCapture: 'readonly', + FocusOptions: 'readonly', spyOnDev: 'readonly', spyOnDevAndProd: 'readonly', diff --git a/.github/ISSUE_TEMPLATE/19.md b/.github/ISSUE_TEMPLATE/19.md deleted file mode 100644 index 6fa2dd8d8d..0000000000 --- a/.github/ISSUE_TEMPLATE/19.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: "⚛React 19 beta issue" -about: Report a issue with React 19 beta. -title: '[React 19]' -labels: 'React 19' - ---- - - -## Summary - - diff --git a/.github/workflows/compiler_discord_notify.yml b/.github/workflows/compiler_discord_notify.yml index 3840e3787b..71aea56e84 100644 --- a/.github/workflows/compiler_discord_notify.yml +++ b/.github/workflows/compiler_discord_notify.yml @@ -10,7 +10,19 @@ on: permissions: {} jobs: + check_access: + runs-on: ubuntu-latest + outputs: + is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }} + steps: + - name: Check is member or collaborator + id: check_is_member_or_collaborator + if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }} + run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT" + check_maintainer: + if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' || needs.check_access.outputs.is_member_or_collaborator == true }} + needs: [check_access] uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main permissions: # Used by check_maintainer diff --git a/.github/workflows/compiler_prereleases.yml b/.github/workflows/compiler_prereleases.yml index 2bb2c6ef16..bd6d003a4c 100644 --- a/.github/workflows/compiler_prereleases.yml +++ b/.github/workflows/compiler_prereleases.yml @@ -16,6 +16,9 @@ on: version_name: required: true type: string + tag_version: + required: false + type: string secrets: NPM_TOKEN: required: true @@ -55,4 +58,4 @@ jobs: - name: Publish packages to npm run: | cp ./scripts/release/ci-npmrc ~/.npmrc - scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag ${{ inputs.dist_tag }} + scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }} diff --git a/.github/workflows/compiler_prereleases_manual.yml b/.github/workflows/compiler_prereleases_manual.yml index 4960489590..268b8f24f4 100644 --- a/.github/workflows/compiler_prereleases_manual.yml +++ b/.github/workflows/compiler_prereleases_manual.yml @@ -14,6 +14,9 @@ on: version_name: required: true type: string + tag_version: + required: false + type: string permissions: {} @@ -29,5 +32,6 @@ jobs: release_channel: ${{ inputs.release_channel }} dist_tag: ${{ inputs.dist_tag }} version_name: ${{ inputs.version_name }} + tag_version: ${{ inputs.tag_version }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/compiler_prereleases_weekly.yml b/.github/workflows/compiler_prereleases_weekly.yml deleted file mode 100644 index 72af00d521..0000000000 --- a/.github/workflows/compiler_prereleases_weekly.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: (Compiler) Publish Prereleases Weekly - -on: - schedule: - # At 10 minutes past 9:00 on Mon - - cron: 10 9 * * 1 - -permissions: {} - -env: - TZ: /usr/share/zoneinfo/America/Los_Angeles - -jobs: - publish_prerelease_beta: - name: Publish to beta channel - uses: facebook/react/.github/workflows/compiler_prereleases.yml@main - with: - commit_sha: ${{ github.sha }} - release_channel: beta - dist_tag: beta - version_name: '19.0.0' - secrets: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/runtime_discord_notify.yml b/.github/workflows/runtime_discord_notify.yml index ad94e28054..44775fbe78 100644 --- a/.github/workflows/runtime_discord_notify.yml +++ b/.github/workflows/runtime_discord_notify.yml @@ -10,7 +10,19 @@ on: permissions: {} jobs: + check_access: + runs-on: ubuntu-latest + outputs: + is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }} + steps: + - name: Check is member or collaborator + id: check_is_member_or_collaborator + if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }} + run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT" + check_maintainer: + if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' || needs.check_access.outputs.is_member_or_collaborator == true }} + needs: [check_access] uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main permissions: # Used by check_maintainer diff --git a/.github/workflows/runtime_prereleases.yml b/.github/workflows/runtime_prereleases.yml index e3cd5bd1a2..ee8dd72ce9 100644 --- a/.github/workflows/runtime_prereleases.yml +++ b/.github/workflows/runtime_prereleases.yml @@ -13,7 +13,14 @@ on: dist_tag: required: true type: string + enableFailureNotification: + description: 'Whether to notify the team on Discord when the release fails. Useful if this workflow is called from an automation.' + required: false + type: boolean secrets: + DISCORD_WEBHOOK_URL: + description: 'Discord webhook URL to notify on failure. Only required if enableFailureNotification is true.' + required: false GH_TOKEN: required: true NPM_TOKEN: @@ -58,3 +65,11 @@ jobs: GH_TOKEN=${{ secrets.GH_TOKEN }} scripts/release/prepare-release-from-ci.js --skipTests -r ${{ inputs.release_channel }} --commit=${{ inputs.commit_sha }} cp ./scripts/release/ci-npmrc ~/.npmrc scripts/release/publish.js --ci --tags ${{ inputs.dist_tag }} + - name: Notify Discord on failure + if: failure() && inputs.enableFailureNotification == true + uses: tsickert/discord-webhook@86dc739f3f165f16dadc5666051c367efa1692f4 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + embed-author-name: "GitHub Actions" + embed-title: 'Publish of $${{ inputs.release_channel }} release failed' + embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }} diff --git a/.github/workflows/runtime_prereleases_nightly.yml b/.github/workflows/runtime_prereleases_nightly.yml index f89a0d2c91..a38e241d53 100644 --- a/.github/workflows/runtime_prereleases_nightly.yml +++ b/.github/workflows/runtime_prereleases_nightly.yml @@ -21,7 +21,9 @@ jobs: commit_sha: ${{ github.sha }} release_channel: stable dist_tag: canary,next + enableFailureNotification: true secrets: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,6 +42,8 @@ jobs: commit_sha: ${{ github.sha }} release_channel: experimental dist_tag: experimental + enableFailureNotification: true secrets: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/shared_label_core_team_prs.yml b/.github/workflows/shared_label_core_team_prs.yml index 2cd9f290e0..fd4aa9399e 100644 --- a/.github/workflows/shared_label_core_team_prs.yml +++ b/.github/workflows/shared_label_core_team_prs.yml @@ -2,6 +2,7 @@ name: (Shared) Label Core Team PRs on: pull_request_target: + types: [opened] permissions: {} @@ -11,7 +12,19 @@ env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 jobs: + check_access: + runs-on: ubuntu-latest + outputs: + is_member_or_collaborator: ${{ steps.check_is_member_or_collaborator.outputs.is_member_or_collaborator }} + steps: + - name: Check is member or collaborator + id: check_is_member_or_collaborator + if: ${{ github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' }} + run: echo "is_member_or_collaborator=true" >> "$GITHUB_OUTPUT" + check_maintainer: + if: ${{ needs.check_access.outputs.is_member_or_collaborator == 'true' || needs.check_access.outputs.is_member_or_collaborator == true }} + needs: [check_access] uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main permissions: # Used by check_maintainer diff --git a/.nvmrc b/.nvmrc index ef33d65101..5f53e875de 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.20.1 +v20.19.0 diff --git a/CHANGELOG-canary.md b/CHANGELOG-canary.md deleted file mode 100644 index 048f6a542e..0000000000 --- a/CHANGELOG-canary.md +++ /dev/null @@ -1,18 +0,0 @@ -## March 22, 2024 (18.3.0-canary-670811593-20240322) - -## React -- Added `useActionState` to replace `useFormState` and added `pending` value ([#28491](https://github.com/facebook/react/pull/28491)). - -## October 5, 2023 (18.3.0-canary-546178f91-20231005) - -### React - -- Added support for async functions to be passed to `startTransition`. -- `useTransition` now triggers the nearest error boundary instead of a global error. -- Added `useOptimistic`, a new Hook for handling optimistic UI updates. It optimistically updates the UI before receiving confirmation from a server or external source. - -### React DOM - -- Added support for passing async functions to the `action` prop on `
`. When the function passed to `action` is marked with [`'use server'`](https://react.dev/reference/react/use-server), the form is [progressively enhanced](https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement). -- Added `useFormStatus`, a new Hook for checking the submission state of a form. -- Added `useFormState`, a new Hook for updating state upon form submission. When the function passed to `useFormState` is marked with [`'use server'`](https://react.dev/reference/react/use-server), the update is [progressively enhanced](https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement). diff --git a/CHANGELOG.md b/CHANGELOG.md index 973d088c25..d5551df26c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,50 @@ +## 19.1.0 (March 28, 2025) + +### Owner Stack + +An Owner Stack is a string representing the components that are directly responsible for rendering a particular component. You can log Owner Stacks when debugging or use Owner Stacks to enhance error overlays or other development tools. Owner Stacks are only available in development builds. Component Stacks in production are unchanged. + +* An Owner Stack is a development-only stack trace that helps identify which components are responsible for rendering a particular component. An Owner Stack is distinct from a Component Stacks, which shows the hierarchy of components leading to an error. +* The [captureOwnerStack API](https://react.dev/reference/react/captureOwnerStack) is only available in development mode and returns a Owner Stack, if available. The API can be used to enhance error overlays or log component relationships when debugging. [#29923](https://github.com/facebook/react/pull/29923), [#32353](https://github.com/facebook/react/pull/32353), [#30306](https://github.com/facebook/react/pull/30306), +[#32538](https://github.com/facebook/react/pull/32538), [#32529](https://github.com/facebook/react/pull/32529), [#32538](https://github.com/facebook/react/pull/32538) + +### React +* Enhanced support for Suspense boundaries to be used anywhere, including the client, server, and during hydration. [#32069](https://github.com/facebook/react/pull/32069), [#32163](https://github.com/facebook/react/pull/32163), [#32224](https://github.com/facebook/react/pull/32224), [#32252](https://github.com/facebook/react/pull/32252) +* Reduced unnecessary client rendering through improved hydration scheduling [#31751](https://github.com/facebook/react/pull/31751) +* Increased priority of client rendered Suspense boundaries [#31776](https://github.com/facebook/react/pull/31776) +* Fixed frozen fallback states by rendering unfinished Suspense boundaries on the client. [#31620](https://github.com/facebook/react/pull/31620) +* Reduced garbage collection pressure by improving Suspense boundary retries. [#31667](https://github.com/facebook/react/pull/31667) +* Fixed erroneous “Waiting for Paint” log when the passive effect phase was not delayed [#31526](https://github.com/facebook/react/pull/31526) +* Fixed a regression causing key warnings for flattened positional children in development mode. [#32117](https://github.com/facebook/react/pull/32117) +* Updated `useId` to use valid CSS selectors, changing format from `:r123:` to `«r123»`. [#32001](https://github.com/facebook/react/pull/32001) +* Added a dev-only warning for null/undefined created in useEffect, useInsertionEffect, and useLayoutEffect. [#32355](https://github.com/facebook/react/pull/32355) +* Fixed a bug where dev-only methods were exported in production builds. React.act is no longer available in production builds. [#32200](https://github.com/facebook/react/pull/32200) +* Improved consistency across prod and dev to improve compatibility with Google Closure Complier and bindings [#31808](https://github.com/facebook/react/pull/31808) +* Improve passive effect scheduling for consistent task yielding. [#31785](https://github.com/facebook/react/pull/31785) +* Fixed asserts in React Native when passChildrenWhenCloningPersistedNodes is enabled for OffscreenComponent rendering. [#32528](https://github.com/facebook/react/pull/32528) +* Fixed component name resolution for Portal [#32640](https://github.com/facebook/react/pull/32640) +* Added support for beforetoggle and toggle events on the dialog element. #32479 [#32479](https://github.com/facebook/react/pull/32479) + +### React DOM +* Fixed double warning when the `href` attribute is an empty string [#31783](https://github.com/facebook/react/pull/31783) + * Fixed an edge case where `getHoistableRoot()` didn’t work properly when the container was a Document [#32321](https://github.com/facebook/react/pull/32321) +* Removed support for using HTML comments (e.g. ``) as a DOM container. [#32250](https://github.com/facebook/react/pull/32250) +* Added support for `