Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with react.dev @ a5aad0d5 #532

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"root": true,
"extends": "next/core-web-vitals",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
"react-hooks/exhaustive-deps": "error"
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
"react-hooks/exhaustive-deps": "error",
"react/no-unknown-property": ["error", {"ignore": ["meta"]}],
"react-compiler/react-compiler": "error"
},
"env": {
"node": true,
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/discord_notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ name: Discord Notify

on:
pull_request_target:
types: [ labeled ]
types: [labeled]

jobs:
check_maintainer:
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
with:
actor: ${{ github.event.pull_request.user.login }}
is_remote: true

notify:
if: ${{ github.event.label.name == 'React Core Team' }}
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
needs: check_maintainer
runs-on: ubuntu-latest
steps:
- name: Discord Webhook Action
Expand All @@ -18,4 +25,4 @@ jobs:
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
embed-description: ${{ github.event.pull_request.body }}
embed-url: ${{ github.event.pull_request.html_url }}
embed-url: ${{ github.event.pull_request.html_url }}
32 changes: 32 additions & 0 deletions .github/workflows/label_core_team_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Label Core Team PRs

on:
pull_request_target:

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

jobs:
check_maintainer:
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
with:
actor: ${{ github.event.pull_request.user.login }}
is_remote: true

label:
if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }}
runs-on: ubuntu-latest
needs: check_maintainer
steps:
- name: Label PR as React Core Team
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
labels: ['React Core Team']
});
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const nextConfig = {
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
reactStrictMode: true,
experimental: {
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
appDir: false,
scrollRestoration: true,
legacyBrowsers: false,
reactCompiler: true,
},
env: {},
webpack: (config, {dev, isServer, ...options}) => {
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss",
"tsc": "tsc --noEmit",
"start": "next start",
"postinstall": "patch-package && (is-ci || husky install .husky)",
"postinstall": "is-ci || husky install .husky",
"check-all": "npm-run-all prettier lint:fix tsc rss",
"rss": "node scripts/generateRss.js"
},
Expand All @@ -33,12 +33,12 @@
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"github-slugger": "^1.3.0",
"next": "^13.4.1",
"next": "15.1.0",
"next-remote-watch": "^1.0.0",
"parse-numeric-range": "^1.2.0",
"react": "^0.0.0-experimental-16d053d59-20230506",
"react": "^19.0.0",
"react-collapsed": "4.0.4",
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
"react-dom": "^19.0.0",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.1"
},
Expand All @@ -54,20 +54,22 @@
"@types/mdx-js__react": "^1.5.2",
"@types/node": "^14.6.4",
"@types/parse-numeric-range": "^0.0.1",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"asyncro": "^3.0.0",
"autoprefixer": "^10.4.2",
"babel-eslint": "10.x",
"babel-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
"eslint": "7.x",
"eslint-config-next": "12.0.3",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-flowtype": "4.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-react": "7.x",
"eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
"fs-extra": "^9.0.1",
"globby": "^11.0.1",
Expand All @@ -78,7 +80,6 @@
"mdast-util-to-string": "^1.1.0",
"metro-cache": "0.72.2",
"npm-run-all": "^4.1.5",
"patch-package": "^6.2.2",
"postcss": "^8.4.5",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-preset-env": "^6.7.0",
Expand All @@ -94,7 +95,7 @@
"retext-smartypants": "^4.0.0",
"rss": "^1.2.2",
"tailwindcss": "^3.4.1",
"typescript": "^4.0.2",
"typescript": "^5.7.2",
"unist-util-visit": "^2.0.3",
"webpack-bundle-analyzer": "^4.5.0"
},
Expand All @@ -109,5 +110,6 @@
"lint-staged": {
"*.{js,ts,jsx,tsx,css}": "yarn prettier",
"src/**/*.md": "yarn fix-headings"
}
},
"packageManager": "yarn@1.22.22"
}
22 changes: 0 additions & 22 deletions patches/next+13.4.1.patch

This file was deleted.

16 changes: 0 additions & 16 deletions patches/next-remote-watch+1.0.0.patch

This file was deleted.

6 changes: 5 additions & 1 deletion src/components/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
import type {DetailedHTMLProps, AnchorHTMLAttributes} from 'react';

export function ExternalLink({
href,
target,
children,
...props
}: JSX.IntrinsicElements['a']) {
}: DetailedHTMLProps<
AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement
>) {
return (
<a href={href} target={target ?? '_blank'} rel="noopener" {...props}>
{children}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/IconArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import {memo} from 'react';
import cn from 'classnames';
import type {SVGProps} from 'react';

export const IconArrow = memo<
JSX.IntrinsicElements['svg'] & {
SVGProps<SVGSVGElement> & {
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/IconArrowSmall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import {memo} from 'react';
import cn from 'classnames';
import type {SVGProps} from 'react';

export const IconArrowSmall = memo<
JSX.IntrinsicElements['svg'] & {
SVGProps<SVGSVGElement> & {
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
Expand Down
5 changes: 2 additions & 3 deletions src/components/Icon/IconBsky.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconBsky = memo<JSX.IntrinsicElements['svg']>(function IconBsky(
props
) {
export const IconBsky = memo<SVGProps<SVGSVGElement>>(function IconBsky(props) {
return (
<svg
aria-label="Bluesky"
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/IconClose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconClose = memo<JSX.IntrinsicElements['svg']>(function IconClose(
export const IconClose = memo<SVGProps<SVGSVGElement>>(function IconClose(
props
) {
return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/IconFacebookCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconFacebookCircle = memo<JSX.IntrinsicElements['svg']>(
export const IconFacebookCircle = memo<SVGProps<SVGSVGElement>>(
function IconFacebookCircle(props) {
return (
<svg
Expand Down
31 changes: 16 additions & 15 deletions src/components/Icon/IconGitHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconGitHub = memo<JSX.IntrinsicElements['svg']>(
function IconGitHub(props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1.5em"
height="1.5em"
viewBox="0 -2 24 24"
fill="currentColor"
{...props}>
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
</svg>
);
}
);
export const IconGitHub = memo<SVGProps<SVGSVGElement>>(function IconGitHub(
props
) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1.5em"
height="1.5em"
viewBox="0 -2 24 24"
fill="currentColor"
{...props}>
<path d="M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"></path>
</svg>
);
});
3 changes: 2 additions & 1 deletion src/components/Icon/IconHamburger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconHamburger = memo<JSX.IntrinsicElements['svg']>(
export const IconHamburger = memo<SVGProps<SVGSVGElement>>(
function IconHamburger(props) {
return (
<svg
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/IconInstagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconInstagram = memo<JSX.IntrinsicElements['svg']>(
export const IconInstagram = memo<SVGProps<SVGSVGElement>>(
function IconInstagram(props) {
return (
<svg
Expand Down
5 changes: 2 additions & 3 deletions src/components/Icon/IconLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
*/

import {memo} from 'react';
import type {SVGProps} from 'react';

export const IconLink = memo<JSX.IntrinsicElements['svg']>(function IconLink(
props
) {
export const IconLink = memo<SVGProps<SVGSVGElement>>(function IconLink(props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
Loading
Loading