Skip to content

Commit 5598b52

Browse files
authored
Merge pull request #759 from reactjs/sync-26caa649
Sync with reactjs.org @ 26caa64
2 parents a1e7eed + 35a22c7 commit 5598b52

File tree

292 files changed

+6031
-11474
lines changed

Some content is hidden

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

292 files changed

+6031
-11474
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.16.1
1+
12.22.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
1. Git
1010
1. Node: любая версия 12.x, начиная с 12.0.0 или выше
11-
1. Yarn: Посмотрите [сайт Yarn с инструкциями по установке](https://yarnpkg.com/lang/en/docs/install/)
11+
1. Yarn v1: Посмотрите [сайт Yarn с инструкциями по установке](https://yarnpkg.com/lang/en/docs/install/)
1212
1. Сделать форк этого репозитория (для предложения изменений)
1313
1. Копия [репозитория ru.reactjs.org](https://github.com/reactjs/ru.reactjs.org) на вашем компьютере
1414

beta/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ yarn-error.log*
3333

3434
# vercel
3535
.vercel
36+
37+
# external fonts
38+
public/fonts/Optimistic_Display_W_Lt.woff2
39+
public/fonts/Optimistic_Display_W_Md.woff2
40+
public/fonts/Optimistic_Display_W_Bd.woff2

beta/illustrations/import-export.ai

Lines changed: 0 additions & 4950 deletions
This file was deleted.

beta/illustrations/jsx.ai

Lines changed: 0 additions & 1564 deletions
This file was deleted.

beta/next.config.js

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,30 @@ const path = require('path');
66
const {remarkPlugins} = require('./plugins/markdownToHtml');
77
const redirects = require('./src/redirects.json');
88

9-
module.exports = {
9+
/**
10+
* @type {import('next').NextConfig}
11+
**/
12+
const nextConfig = {
1013
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
1114
experimental: {
1215
plugins: true,
13-
// TODO: this doesn't work because https://github.com/vercel/next.js/issues/30714
14-
concurrentFeatures: false,
1516
scrollRestoration: true,
17+
legacyBrowsers: false,
18+
browsersListForSwc: true,
1619
},
1720
async redirects() {
1821
return redirects.redirects;
1922
},
20-
rewrites() {
21-
return [
22-
{
23-
source: '/feed.xml',
24-
destination: '/_next/static/feed.xml',
25-
},
26-
];
27-
},
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+
// },
2833
webpack: (config, {dev, isServer, ...options}) => {
2934
if (process.env.ANALYZE) {
3035
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@@ -38,6 +43,27 @@ module.exports = {
3843
);
3944
}
4045

46+
// Don't bundle the shim unnecessarily.
47+
config.resolve.alias['use-sync-external-store/shim'] = 'react';
48+
49+
const {IgnorePlugin} = require('webpack');
50+
config.plugins.push(
51+
new IgnorePlugin({
52+
checkResource(resource, context) {
53+
if (
54+
/\/eslint\/lib\/rules$/.test(context) &&
55+
/\.\/[\w-]+(\.js)?$/.test(resource)
56+
) {
57+
// Skips imports of built-in rules that ESLint
58+
// tries to carry into the bundle by default.
59+
// We only want the engine and the React rules.
60+
return true;
61+
}
62+
return false;
63+
},
64+
})
65+
);
66+
4167
// Add our custom markdown loader in order to support frontmatter
4268
// and layout
4369
config.module.rules.push({
@@ -57,3 +83,5 @@ module.exports = {
5783
return config;
5884
},
5985
};
86+
87+
module.exports = nextConfig;

beta/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"analyze": "ANALYZE=true next build",
88
"dev": "next",
9-
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js",
9+
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js && 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,7 +22,7 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "v0.14.3-experimental.1",
25+
"@codesandbox/sandpack-react": "v0.19.8-experimental.4",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
2828
"@headlessui/react": "^1.3.0",
@@ -33,23 +33,24 @@
3333
"debounce": "^1.2.1",
3434
"ga-lite": "^2.1.4",
3535
"github-slugger": "^1.3.0",
36-
"next": "^12.0.10",
36+
"next": "12.1.7-canary.11",
3737
"parse-numeric-range": "^1.2.0",
38-
"react": "experimental",
38+
"react": "0.0.0-experimental-82c64e1a4-20220520",
3939
"react-collapsed": "3.1.0",
40-
"react-dom": "experimental",
40+
"react-dom": "0.0.0-experimental-82c64e1a4-20220520",
4141
"scroll-into-view-if-needed": "^2.2.25"
4242
},
4343
"devDependencies": {
4444
"@mdx-js/loader": "^1.6.16",
4545
"@types/body-scroll-lock": "^2.6.1",
4646
"@types/classnames": "^2.2.10",
47+
"@types/debounce": "^1.2.1",
4748
"@types/github-slugger": "^1.3.0",
4849
"@types/mdx-js__react": "^1.5.2",
4950
"@types/node": "^14.6.4",
5051
"@types/parse-numeric-range": "^0.0.1",
51-
"@types/react": "^16.9.46",
52-
"@types/react-dom": "^16.9.8",
52+
"@types/react": "^18.0.9",
53+
"@types/react-dom": "^18.0.5",
5354
"@typescript-eslint/eslint-plugin": "2.x",
5455
"@typescript-eslint/parser": "2.x",
5556
"asyncro": "^3.0.0",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/node_modules/@codesandbox/sandpack-react/dist/esm/index.js b/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
2+
index ced9bd3..7e5e366 100644
3+
--- a/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
4+
+++ b/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
5+
@@ -566,17 +566,16 @@ var REACT_TEMPLATE = {
6+
},
7+
"/index.js": {
8+
code: `import React, { StrictMode } from "react";
9+
-import ReactDOM from "react-dom";
10+
+import { createRoot } from "react-dom/client";
11+
import "./styles.css";
12+
13+
import App from "./App";
14+
15+
-const rootElement = document.getElementById("root");
16+
-ReactDOM.render(
17+
+const root = createRoot(document.getElementById("root"));
18+
+root.render(
19+
<StrictMode>
20+
<App />
21+
- </StrictMode>,
22+
- rootElement
23+
+ </StrictMode>
24+
);`
25+
},
26+
"/styles.css": {
27+
@@ -611,8 +610,8 @@ h1 {
28+
}
29+
},
30+
dependencies: {
31+
- react: "^17.0.0",
32+
- "react-dom": "^17.0.0",
33+
+ react: "^18.0.0",
34+
+ "react-dom": "^18.0.0",
35+
"react-scripts": "^4.0.0"
36+
},
37+
entry: "/index.js",

beta/plugins/sandbox-templates/cra/package.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

beta/plugins/sandbox-templates/cra/public/index.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)