Skip to content

Commit 36c6fe3

Browse files
authored
Merge branch 'main' into sacaling-up-with-reducer-and-context
2 parents 09378f8 + 0311a73 commit 36c6fe3

File tree

275 files changed

+28746
-7164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+28746
-7164
lines changed

README.md

Lines changed: 1 addition & 1 deletion

TRANSLATION.md

Lines changed: 58 additions & 4 deletions

beta/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SANDPACK_BARE_COMPONENTS=true

beta/.env.production

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
1+
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
2+
SANDPACK_BARE_COMPONENTS=true

beta/next.config.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
44

5-
const path = require('path');
65
const redirects = require('./src/redirects.json');
76

87
/**
@@ -17,6 +16,9 @@ const nextConfig = {
1716
legacyBrowsers: false,
1817
browsersListForSwc: true,
1918
},
19+
env: {
20+
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
21+
},
2022
async redirects() {
2123
return redirects.redirects;
2224
},
@@ -49,8 +51,16 @@ const nextConfig = {
4951
const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
5052
config.plugins.push(
5153
new NormalModuleReplacementPlugin(
52-
/@codemirror\/lang-markdown/,
53-
require.resolve('./src/utils/codemirrorMarkdownShim.js')
54+
/^@stitches\/core$/,
55+
require.resolve('./src/utils/emptyShim.js')
56+
),
57+
new NormalModuleReplacementPlugin(
58+
/^raf$/,
59+
require.resolve('./src/utils/rafShim.js')
60+
),
61+
new NormalModuleReplacementPlugin(
62+
/^process$/,
63+
require.resolve('./src/utils/processShim.js')
5464
),
5565
new IgnorePlugin({
5666
checkResource(resource, context) {

beta/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "1.7.2",
25+
"@codesandbox/sandpack-react": "1.15.5",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
2828
"@headlessui/react": "^1.7.0",
@@ -38,6 +38,7 @@
3838
"react": "0.0.0-experimental-cb5084d1c-20220924",
3939
"react-collapsed": "npm:@gaearon/[email protected]",
4040
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
41+
"remark-frontmatter": "^4.0.1",
4142
"remark-gfm": "^3.0.1"
4243
},
4344
"devDependencies": {
@@ -66,7 +67,7 @@
6667
"eslint-plugin-import": "2.x",
6768
"eslint-plugin-jsx-a11y": "6.x",
6869
"eslint-plugin-react": "7.x",
69-
"eslint-plugin-react-hooks": "experimental",
70+
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
7071
"fs-extra": "^9.0.1",
7172
"globby": "^11.0.1",
7273
"gray-matter": "^4.0.2",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/node_modules/@codemirror/lang-javascript/dist/index.cjs b/node_modules/@codemirror/lang-javascript/dist/index.cjs
2+
index 4475e4f..e1255c9 100644
3+
--- a/node_modules/@codemirror/lang-javascript/dist/index.cjs
4+
+++ b/node_modules/@codemirror/lang-javascript/dist/index.cjs
5+
@@ -135,7 +135,9 @@ const javascriptLanguage = language.LRLanguage.define({
6+
JSXText: highlight.tags.content,
7+
"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": highlight.tags.angleBracket,
8+
"JSXIdentifier JSXNameSpacedName": highlight.tags.tagName,
9+
- "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName
10+
+ "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName,
11+
+ "JSXAttribute/JSXLowerIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName,
12+
+ "JSXBuiltin/JSXIdentifier": highlight.tags.standard(highlight.tags.tagName)
13+
})
14+
]
15+
}),
16+
diff --git a/node_modules/@codemirror/lang-javascript/dist/index.js b/node_modules/@codemirror/lang-javascript/dist/index.js
17+
index d089f6b..db09ea6 100644
18+
--- a/node_modules/@codemirror/lang-javascript/dist/index.js
19+
+++ b/node_modules/@codemirror/lang-javascript/dist/index.js
20+
@@ -131,7 +131,9 @@ const javascriptLanguage = /*@__PURE__*/LRLanguage.define({
21+
JSXText: tags.content,
22+
"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags.angleBracket,
23+
"JSXIdentifier JSXNameSpacedName": tags.tagName,
24+
- "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName
25+
+ "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName,
26+
+ "JSXAttribute/JSXLowerIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName,
27+
+ "JSXBuiltin/JSXIdentifier": tags.standard(tags.tagName),
28+
})
29+
]
30+
}),

beta/patches/@codesandbox+sandpack-react+1.15.5.patch

Lines changed: 26 additions & 0 deletions
Large diffs are not rendered by default.

beta/patches/@lezer+javascript+0.15.2.patch

Lines changed: 345 additions & 0 deletions
Large diffs are not rendered by default.

beta/public/images/team/acdlite.jpg

-348 KB

beta/public/images/team/bvaughn.jpg

-388 KB
Binary file not shown.

beta/public/images/team/gaearon.jpg

-350 KB

beta/public/images/team/huxpro.jpg

-340 KB
Binary file not shown.
232 KB

beta/public/images/team/joe.jpg

90.2 KB

beta/public/images/team/josh.jpg

121 KB

beta/public/images/team/lauren.jpg

147 KB

beta/public/images/team/lunaruan.jpg

-256 KB
2.26 MB

beta/public/images/team/necolas.jpg

-378 KB
Binary file not shown.
-162 KB

beta/public/images/team/rnabors.jpg

-302 KB
Binary file not shown.

beta/public/images/team/salazarm.jpeg

-75.2 KB
Binary file not shown.

beta/public/images/team/sam.jpg

99.9 KB

beta/public/images/team/sathya.jpg

69.2 KB
-137 KB
160 KB
167 KB
-503 KB
Binary file not shown.

beta/public/images/team/tianyu.jpg

51.4 KB

beta/public/images/team/trueadm.jpg

-64.1 KB
Binary file not shown.
-23.4 KB
Binary file not shown.
3.96 KB
18.7 KB
-10.9 KB
Binary file not shown.
-16.4 KB
Binary file not shown.
2.53 KB

beta/src/components/Breadcrumbs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Breadcrumbs() {
1010
const {breadcrumbs} = useRouteMeta();
1111
if (!breadcrumbs) return null;
1212
return (
13-
<div className="flex">
13+
<div className="flex flex-wrap">
1414
{breadcrumbs.map(
1515
(crumb, i) =>
1616
crumb.path && (

beta/src/components/Icon/IconGitHub.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ export const IconGitHub = memo<JSX.IntrinsicElements['svg']>(
88
function IconGitHub(props) {
99
return (
1010
<svg
11-
width="1em"
11+
xmlns="http://www.w3.org/2000/svg"
12+
width="1.33em"
13+
height="1.33em"
14+
viewBox="0 -2 24 24"
1215
fill="currentColor"
13-
height="1em"
14-
viewBox="0 0 20 20"
1516
{...props}>
1617
<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>
1718
</svg>

beta/src/components/Icon/IconLink.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
import {memo} from 'react';
6+
7+
export const IconLink = memo<JSX.IntrinsicElements['svg']>(function IconLink(
8+
props
9+
) {
10+
return (
11+
<svg
12+
xmlns="http://www.w3.org/2000/svg"
13+
width="1.33em"
14+
height="1.33em"
15+
viewBox="0 -2 24 24"
16+
fill="currentColor"
17+
{...props}>
18+
<path
19+
strokeLinecap="round"
20+
strokeLinejoin="round"
21+
d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"
22+
/>
23+
</svg>
24+
);
25+
});

beta/src/components/Icon/IconGotcha.tsx renamed to beta/src/components/Icon/IconPitfall.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import {memo} from 'react';
66

7-
export const IconGotcha = memo<JSX.IntrinsicElements['svg']>(
8-
function IconGotcha({className}) {
7+
export const IconPitfall = memo<JSX.IntrinsicElements['svg']>(
8+
function IconPitfall({className}) {
99
return (
1010
<svg
1111
className={className}

beta/src/components/Layout/Footer.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import ButtonLink from 'components/ButtonLink';
99
import {ExternalLink} from 'components/ExternalLink';
1010
import {IconFacebookCircle} from 'components/Icon/IconFacebookCircle';
1111
import {IconTwitter} from 'components/Icon/IconTwitter';
12+
import {IconGitHub} from 'components/Icon/IconGitHub';
1213
import {IconNavArrow} from 'components/Icon/IconNavArrow';
1314

1415
export function Footer() {
@@ -111,11 +112,13 @@ export function Footer() {
111112
</FooterLink>
112113
</div>
113114
<div className="flex flex-col">
114-
<FooterLink href="/apis/react" isHeader={true}>
115+
<FooterLink href="/reference/react" isHeader={true}>
115116
API Reference
116117
</FooterLink>
117-
<FooterLink href="/apis/react">React APIs</FooterLink>
118-
<FooterLink href="/apis/react-dom">React DOM APIs</FooterLink>
118+
<FooterLink href="/reference/react">React APIs</FooterLink>
119+
<FooterLink href="/reference/react-dom">
120+
React DOM APIs
121+
</FooterLink>
119122
</div>
120123
<div className="flex flex-col sm:col-start-2 xl:col-start-4">
121124
<FooterLink href="/" isHeader={true}>
@@ -124,12 +127,13 @@ export function Footer() {
124127
<FooterLink href="https://github.com/facebook/react/blob/main/CODE_OF_CONDUCT.md">
125128
Code of Conduct
126129
</FooterLink>
127-
<FooterLink href="/community/acknowledgements">
130+
<FooterLink href="/learn/acknowledgements">
128131
Acknowledgements
129132
</FooterLink>
130-
<FooterLink href="/community/meet-the-team">
131-
Meet the Team
133+
<FooterLink href="/learn/docs-contributors">
134+
Docs Contributors
132135
</FooterLink>
136+
<FooterLink href="/learn/meet-the-team">Meet the Team</FooterLink>
133137
<FooterLink href="https://reactjs.org/blog">Blog</FooterLink>
134138
{/* <FooterLink href="/">Community Resources</FooterLink> */}
135139
</div>
@@ -160,6 +164,12 @@ export function Footer() {
160164
className={socialLinkClasses}>
161165
<IconTwitter />
162166
</ExternalLink>
167+
<ExternalLink
168+
aria-label="React on Github"
169+
href="https://github.com/facebook/react"
170+
className={socialLinkClasses}>
171+
<IconGitHub />
172+
</ExternalLink>
163173
</div>
164174
</div>
165175
</div>

beta/src/components/Layout/MarkdownPage.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
*/
44

55
import * as React from 'react';
6+
import {useRouter} from 'next/router';
67
import {DocsPageFooter} from 'components/DocsFooter';
78
import {Seo} from 'components/Seo';
89
import PageHeading from 'components/PageHeading';
910
import {useRouteMeta} from './useRouteMeta';
11+
import {useActiveSection} from '../../hooks/useActiveSection';
1012
import {TocContext} from '../MDX/TocContext';
1113

14+
import(/* webpackPrefetch: true */ '../MDX/CodeBlock/CodeBlock');
15+
1216
export interface MarkdownProps<Frontmatter> {
1317
meta: Frontmatter & {description?: string};
1418
children?: React.ReactNode;
@@ -23,13 +27,10 @@ export function MarkdownPage<
2327
T extends {title: string; status?: string} = {title: string; status?: string}
2428
>({children, meta, toc}: MarkdownProps<T>) {
2529
const {route, nextRoute, prevRoute} = useRouteMeta();
30+
const section = useActiveSection();
2631
const title = meta.title || route?.title || '';
2732
const description = meta.description || route?.description || '';
28-
29-
if (!route) {
30-
console.error('This page was not added to one of the sidebar JSON files.');
31-
}
32-
const isHomePage = route?.path === '/';
33+
const isHomePage = section === 'home';
3334
return (
3435
<>
3536
<div className="pl-0">

0 commit comments

Comments
 (0)