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 `