Skip to content

Commit

Permalink
Merge pull request #143 from reactjs/sync-b22cbc3f
Browse files Browse the repository at this point in the history
Sync with react.dev @ b22cbc3
  • Loading branch information
srikanth-kandi authored Jan 20, 2025
2 parents bc9cd7f + 56eb707 commit 2115a2a
Show file tree
Hide file tree
Showing 61 changed files with 2,002 additions and 544 deletions.
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
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
45 changes: 23 additions & 22 deletions src/components/Icon/IconNewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
*/

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

export const IconNewPage = memo<JSX.IntrinsicElements['svg']>(
function IconNewPage(props) {
return (
<svg
width="1em"
height="1em"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<path
d="M20.5001 2H15.5001C15.3675 2 15.2403 2.05268 15.1465 2.14645C15.0528 2.24021 15.0001 2.36739 15.0001 2.5V3.5C15.0001 3.63261 15.0528 3.75979 15.1465 3.85355C15.2403 3.94732 15.3675 4 15.5001 4H18.5901L7.6501 14.94C7.60323 14.9865 7.56604 15.0418 7.54065 15.1027C7.51527 15.1636 7.5022 15.229 7.5022 15.295C7.5022 15.361 7.51527 15.4264 7.54065 15.4873C7.56604 15.5482 7.60323 15.6035 7.6501 15.65L8.3501 16.35C8.39658 16.3969 8.45188 16.4341 8.51281 16.4594C8.57374 16.4848 8.63909 16.4979 8.7051 16.4979C8.7711 16.4979 8.83646 16.4848 8.89738 16.4594C8.95831 16.4341 9.01362 16.3969 9.0601 16.35L20.0001 5.41V8.5C20.0001 8.63261 20.0528 8.75979 20.1465 8.85355C20.2403 8.94732 20.3675 9 20.5001 9H21.5001C21.6327 9 21.7599 8.94732 21.8537 8.85355C21.9474 8.75979 22.0001 8.63261 22.0001 8.5V3.5C22.0001 3.10218 21.8421 2.72064 21.5608 2.43934C21.2795 2.15804 20.8979 2 20.5001 2V2Z"
fill="currentColor"
/>
<path
d="M21.5 13H20.5C20.3674 13 20.2402 13.0527 20.1464 13.1464C20.0527 13.2402 20 13.3674 20 13.5V20H4V4H10.5C10.6326 4 10.7598 3.94732 10.8536 3.85355C10.9473 3.75979 11 3.63261 11 3.5V2.5C11 2.36739 10.9473 2.24021 10.8536 2.14645C10.7598 2.05268 10.6326 2 10.5 2H3.5C3.10218 2 2.72064 2.15804 2.43934 2.43934C2.15804 2.72064 2 3.10218 2 3.5V20.5C2 20.8978 2.15804 21.2794 2.43934 21.5607C2.72064 21.842 3.10218 22 3.5 22H20.5C20.8978 22 21.2794 21.842 21.5607 21.5607C21.842 21.2794 22 20.8978 22 20.5V13.5C22 13.3674 21.9473 13.2402 21.8536 13.1464C21.7598 13.0527 21.6326 13 21.5 13Z"
fill="currentColor"
/>
</svg>
);
}
);
export const IconNewPage = memo<SVGProps<SVGSVGElement>>(function IconNewPage(
props
) {
return (
<svg
width="1em"
height="1em"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<path
d="M20.5001 2H15.5001C15.3675 2 15.2403 2.05268 15.1465 2.14645C15.0528 2.24021 15.0001 2.36739 15.0001 2.5V3.5C15.0001 3.63261 15.0528 3.75979 15.1465 3.85355C15.2403 3.94732 15.3675 4 15.5001 4H18.5901L7.6501 14.94C7.60323 14.9865 7.56604 15.0418 7.54065 15.1027C7.51527 15.1636 7.5022 15.229 7.5022 15.295C7.5022 15.361 7.51527 15.4264 7.54065 15.4873C7.56604 15.5482 7.60323 15.6035 7.6501 15.65L8.3501 16.35C8.39658 16.3969 8.45188 16.4341 8.51281 16.4594C8.57374 16.4848 8.63909 16.4979 8.7051 16.4979C8.7711 16.4979 8.83646 16.4848 8.89738 16.4594C8.95831 16.4341 9.01362 16.3969 9.0601 16.35L20.0001 5.41V8.5C20.0001 8.63261 20.0528 8.75979 20.1465 8.85355C20.2403 8.94732 20.3675 9 20.5001 9H21.5001C21.6327 9 21.7599 8.94732 21.8537 8.85355C21.9474 8.75979 22.0001 8.63261 22.0001 8.5V3.5C22.0001 3.10218 21.8421 2.72064 21.5608 2.43934C21.2795 2.15804 20.8979 2 20.5001 2V2Z"
fill="currentColor"
/>
<path
d="M21.5 13H20.5C20.3674 13 20.2402 13.0527 20.1464 13.1464C20.0527 13.2402 20 13.3674 20 13.5V20H4V4H10.5C10.6326 4 10.7598 3.94732 10.8536 3.85355C10.9473 3.75979 11 3.63261 11 3.5V2.5C11 2.36739 10.9473 2.24021 10.8536 2.14645C10.7598 2.05268 10.6326 2 10.5 2H3.5C3.10218 2 2.72064 2.15804 2.43934 2.43934C2.15804 2.72064 2 3.10218 2 3.5V20.5C2 20.8978 2.15804 21.2794 2.43934 21.5607C2.72064 21.842 3.10218 22 3.5 22H20.5C20.8978 22 21.2794 21.842 21.5607 21.5607C21.842 21.2794 22 20.8978 22 20.5V13.5C22 13.3674 21.9473 13.2402 21.8536 13.1464C21.7598 13.0527 21.6326 13 21.5 13Z"
fill="currentColor"
/>
</svg>
);
});
5 changes: 2 additions & 3 deletions src/components/Icon/IconRss.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 IconRss = memo<JSX.IntrinsicElements['svg']>(function IconRss(
props
) {
export const IconRss = memo<SVGProps<SVGSVGElement>>(function IconRss(props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
33 changes: 17 additions & 16 deletions src/components/Icon/IconSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
*/

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

export const IconSearch = memo<JSX.IntrinsicElements['svg']>(
function IconSearch(props) {
return (
<svg width="1em" height="1em" viewBox="0 0 20 20" {...props}>
<path
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
stroke="currentColor"
fill="none"
strokeWidth="2"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"></path>
</svg>
);
}
);
export const IconSearch = memo<SVGProps<SVGSVGElement>>(function IconSearch(
props
) {
return (
<svg width="1em" height="1em" viewBox="0 0 20 20" {...props}>
<path
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
stroke="currentColor"
fill="none"
strokeWidth="2"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"></path>
</svg>
);
});
Loading

0 comments on commit 2115a2a

Please sign in to comment.