Skip to content

Commit 5aa1713

Browse files
hg-pyunhg-pyun
and
hg-pyun
authored
fix: outdated repository (#562)
* fix: sync origin * fix: sync beta (without src) * fix: sync beta (with src) * fix: sync beta with upstream master --------- Co-authored-by: hg-pyun <haegul@gmail.com>
1 parent e3983be commit 5aa1713

File tree

471 files changed

+57128
-30489
lines changed

Some content is hidden

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

471 files changed

+57128
-30489
lines changed

beta/.env.development

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SANDPACK_BARE_COMPONENTS=true

beta/.env.production

+2-1
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/.eslintrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"root": true,
33
"extends": "next/core-web-vitals",
4+
"parser": "@typescript-eslint/parser",
5+
"plugins": ["@typescript-eslint"],
46
"rules": {
5-
"no-unused-vars": "warn"
7+
"no-unused-vars": "off",
8+
"@typescript-eslint/no-unused-vars": "warn"
69
},
710
"env": {
811
"node": true,

beta/.prettierignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
src/pages/docs/**/*.md
2-
src/pages/blog/**/*.md
1+
src/content/**/*.md

beta/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The documentation is divided into sections to cater to different learning styles
2020

2121
**[Learn React](https://beta.reactjs.org/learn)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Learn React also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them.
2222

23-
**[API Reference](https://reactjs.org/apis)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
23+
**[API Reference](https://reactjs.org/apis/react)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
2424

2525
**Try to follow your own instructions.**
2626

beta/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# reactjs.org
22

3-
This repo contains the source code and documentation powering [reactjs.org](https://reactjs.org/).
3+
This repo contains the source code and documentation powering [beta.reactjs.org](https://beta.reactjs.org/).
44

55

66
## Getting started

beta/next.config.js

+16-33
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,21 @@
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
44

5-
const path = require('path');
6-
const {remarkPlugins} = require('./plugins/markdownToHtml');
7-
const redirects = require('./src/redirects.json');
8-
95
/**
106
* @type {import('next').NextConfig}
117
**/
128
const nextConfig = {
139
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
10+
reactStrictMode: true,
1411
experimental: {
1512
plugins: true,
1613
scrollRestoration: true,
1714
legacyBrowsers: false,
1815
browsersListForSwc: true,
1916
},
20-
async redirects() {
21-
return redirects.redirects;
17+
env: {
18+
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
2219
},
23-
// TODO: this causes extra router.replace() on every page.
24-
// Let's disable until we figure out what's going on.
25-
// rewrites() {
26-
// return [
27-
// {
28-
// source: '/feed.xml',
29-
// destination: '/_next/static/feed.xml',
30-
// },
31-
// ];
32-
// },
3320
webpack: (config, {dev, isServer, ...options}) => {
3421
if (process.env.ANALYZE) {
3522
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@@ -46,8 +33,20 @@ const nextConfig = {
4633
// Don't bundle the shim unnecessarily.
4734
config.resolve.alias['use-sync-external-store/shim'] = 'react';
4835

49-
const {IgnorePlugin} = require('webpack');
36+
const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
5037
config.plugins.push(
38+
new NormalModuleReplacementPlugin(
39+
/^@stitches\/core$/,
40+
require.resolve('./src/utils/emptyShim.js')
41+
),
42+
new NormalModuleReplacementPlugin(
43+
/^raf$/,
44+
require.resolve('./src/utils/rafShim.js')
45+
),
46+
new NormalModuleReplacementPlugin(
47+
/^process$/,
48+
require.resolve('./src/utils/processShim.js')
49+
),
5150
new IgnorePlugin({
5251
checkResource(resource, context) {
5352
if (
@@ -64,22 +63,6 @@ const nextConfig = {
6463
})
6564
);
6665

67-
// Add our custom markdown loader in order to support frontmatter
68-
// and layout
69-
config.module.rules.push({
70-
test: /.mdx?$/, // load both .md and .mdx files
71-
use: [
72-
options.defaultLoaders.babel,
73-
{
74-
loader: '@mdx-js/loader',
75-
options: {
76-
remarkPlugins,
77-
},
78-
},
79-
path.join(__dirname, './plugins/md-layout-loader'),
80-
],
81-
});
82-
8366
return config;
8467
},
8568
};

beta/package.json

+20-15
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "CC",
66
"scripts": {
77
"analyze": "ANALYZE=true next build",
8-
"dev": "next",
9-
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js && node ./scripts/downloadFonts.js",
8+
"dev": "next-remote-watch ./src/content",
9+
"build": "next build && node ./scripts/downloadFonts.js",
1010
"lint": "next lint",
1111
"lint:fix": "next lint --fix",
1212
"format:source": "prettier --config .prettierrc --write \"{plugins,src}/**/*.{js,ts,jsx,tsx,css}\"",
@@ -22,26 +22,30 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "v0.19.8-experimental.4",
25+
"@codesandbox/sandpack-react": "1.15.5",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
28-
"@headlessui/react": "^1.3.0",
29-
"@mdx-js/react": "^1.6.16",
28+
"@headlessui/react": "^1.7.0",
3029
"body-scroll-lock": "^3.1.3",
3130
"classnames": "^2.2.6",
3231
"date-fns": "^2.16.1",
3332
"debounce": "^1.2.1",
3433
"ga-lite": "^2.1.4",
3534
"github-slugger": "^1.3.0",
36-
"next": "12.1.7-canary.11",
35+
"next": "12.3.2-canary.7",
36+
"next-remote-watch": "^1.0.0",
3737
"parse-numeric-range": "^1.2.0",
38-
"react": "0.0.0-experimental-82c64e1a4-20220520",
39-
"react-collapsed": "3.1.0",
40-
"react-dom": "0.0.0-experimental-82c64e1a4-20220520",
41-
"scroll-into-view-if-needed": "^2.2.25"
38+
"react": "0.0.0-experimental-cb5084d1c-20220924",
39+
"react-collapsed": "npm:@gaearon/react-collapsed@3.1.0-forked.1",
40+
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
41+
"remark-frontmatter": "^4.0.1",
42+
"remark-gfm": "^3.0.1"
4243
},
4344
"devDependencies": {
44-
"@mdx-js/loader": "^1.6.16",
45+
"@babel/core": "^7.12.9",
46+
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
47+
"@babel/preset-react": "^7.18.6",
48+
"@mdx-js/mdx": "^2.1.3",
4549
"@types/body-scroll-lock": "^2.6.1",
4650
"@types/classnames": "^2.2.10",
4751
"@types/debounce": "^1.2.1",
@@ -51,8 +55,8 @@
5155
"@types/parse-numeric-range": "^0.0.1",
5256
"@types/react": "^18.0.9",
5357
"@types/react-dom": "^18.0.5",
54-
"@typescript-eslint/eslint-plugin": "2.x",
55-
"@typescript-eslint/parser": "2.x",
58+
"@typescript-eslint/eslint-plugin": "^5.36.2",
59+
"@typescript-eslint/parser": "^5.36.2",
5660
"asyncro": "^3.0.0",
5761
"autoprefixer": "^10.4.2",
5862
"babel-eslint": "10.x",
@@ -63,14 +67,15 @@
6367
"eslint-plugin-import": "2.x",
6468
"eslint-plugin-jsx-a11y": "6.x",
6569
"eslint-plugin-react": "7.x",
66-
"eslint-plugin-react-hooks": "2.x",
70+
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
6771
"fs-extra": "^9.0.1",
6872
"globby": "^11.0.1",
6973
"gray-matter": "^4.0.2",
7074
"husky": "^7.0.4",
7175
"is-ci": "^3.0.1",
7276
"lint-staged": ">=10",
7377
"mdast-util-to-string": "^1.1.0",
78+
"metro-cache": "0.72.2",
7479
"npm-run-all": "^4.1.5",
7580
"patch-package": "^6.2.2",
7681
"postcss": "^8.4.5",
@@ -80,7 +85,7 @@
8085
"reading-time": "^1.2.0",
8186
"remark": "^12.0.1",
8287
"remark-external-links": "^7.0.0",
83-
"remark-html": "^13.0.2",
88+
"remark-html": "^12.0.0",
8489
"remark-images": "^2.0.0",
8590
"remark-slug": "^7.0.0",
8691
"remark-unwrap-images": "^2.0.0",
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+0.19.8-experimental.0.patch

-37
This file was deleted.

beta/patches/@codesandbox+sandpack-react+0.19.8-experimental.4.patch

-37
This file was deleted.

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

+26
Large diffs are not rendered by default.

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

+345
Large diffs are not rendered by default.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/node_modules/next/dist/server/render.js b/node_modules/next/dist/server/render.js
2+
index 3a141de..72a8749 100644
3+
--- a/node_modules/next/dist/server/render.js
4+
+++ b/node_modules/next/dist/server/render.js
5+
@@ -752,9 +752,14 @@ async function renderToHTML(req, res, pathname, query, renderOpts) {
6+
// Enabling react concurrent rendering mode: __NEXT_REACT_ROOT = true
7+
const renderShell = async (EnhancedApp, EnhancedComponent)=>{
8+
const content = renderContent(EnhancedApp, EnhancedComponent);
9+
- return await (0, _nodeWebStreamsHelper).renderToInitialStream({
10+
- ReactDOMServer,
11+
- element: content
12+
+ return new Promise((resolve, reject) => {
13+
+ (0, _nodeWebStreamsHelper).renderToInitialStream({
14+
+ ReactDOMServer,
15+
+ element: content,
16+
+ streamOptions: {
17+
+ onError: reject
18+
+ }
19+
+ }).then(resolve, reject);
20+
});
21+
};
22+
const createBodyResult = (initialStream, suffix)=>{
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/node_modules/next-remote-watch/bin/next-remote-watch b/node_modules/next-remote-watch/bin/next-remote-watch
2+
index c055b66..a2f749c 100755
3+
--- a/node_modules/next-remote-watch/bin/next-remote-watch
4+
+++ b/node_modules/next-remote-watch/bin/next-remote-watch
5+
@@ -66,7 +66,10 @@ app.prepare().then(() => {
6+
}
7+
}
8+
9+
- app.server.hotReloader.send('reloadPage')
10+
+ app.server.hotReloader.send({
11+
+ event: 'serverOnlyChanges',
12+
+ pages: ['/[[...markdownPath]]']
13+
+ });
14+
}
15+
)
16+
}

beta/plugins/md-layout-loader.js

-38
This file was deleted.

0 commit comments

Comments
 (0)