Skip to content

Commit b1d6c52

Browse files
Merge pull request #361 from reactjs/sync-47adefd3
2 parents 8e7d80a + 1824442 commit b1d6c52

File tree

522 files changed

+35634
-23236
lines changed

Some content is hidden

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

522 files changed

+35634
-23236
lines changed

README.md

Lines changed: 1 addition & 1 deletion

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/.prettierignore

Lines changed: 1 addition & 2 deletions
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/next.config.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
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
**/
@@ -18,19 +14,9 @@ const nextConfig = {
1814
legacyBrowsers: false,
1915
browsersListForSwc: true,
2016
},
21-
async redirects() {
22-
return redirects.redirects;
17+
env: {
18+
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
2319
},
24-
// TODO: this causes extra router.replace() on every page.
25-
// Let's disable until we figure out what's going on.
26-
// rewrites() {
27-
// return [
28-
// {
29-
// source: '/feed.xml',
30-
// destination: '/_next/static/feed.xml',
31-
// },
32-
// ];
33-
// },
3420
webpack: (config, {dev, isServer, ...options}) => {
3521
if (process.env.ANALYZE) {
3622
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@@ -47,8 +33,20 @@ const nextConfig = {
4733
// Don't bundle the shim unnecessarily.
4834
config.resolve.alias['use-sync-external-store/shim'] = 'react';
4935

50-
const {IgnorePlugin} = require('webpack');
36+
const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
5137
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+
),
5250
new IgnorePlugin({
5351
checkResource(resource, context) {
5452
if (

beta/package.json

Lines changed: 9 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-remote-watch ./src/content",
9-
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js && node ./scripts/downloadFonts.js",
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,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",
@@ -32,18 +32,20 @@
3232
"debounce": "^1.2.1",
3333
"ga-lite": "^2.1.4",
3434
"github-slugger": "^1.3.0",
35-
"next": "12.1.7-canary.11",
35+
"next": "12.3.2-canary.7",
3636
"next-remote-watch": "^1.0.0",
3737
"parse-numeric-range": "^1.2.0",
38-
"react": "0.0.0-experimental-82c64e1a4-20220520",
38+
"react": "0.0.0-experimental-cb5084d1c-20220924",
3939
"react-collapsed": "npm:@gaearon/[email protected]",
40-
"react-dom": "0.0.0-experimental-82c64e1a4-20220520"
40+
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
41+
"remark-frontmatter": "^4.0.1",
42+
"remark-gfm": "^3.0.1"
4143
},
4244
"devDependencies": {
4345
"@babel/core": "^7.12.9",
4446
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
4547
"@babel/preset-react": "^7.18.6",
46-
"@mdx-js/mdx": "^1.6.22",
48+
"@mdx-js/mdx": "^2.1.3",
4749
"@types/body-scroll-lock": "^2.6.1",
4850
"@types/classnames": "^2.2.10",
4951
"@types/debounce": "^1.2.1",
@@ -65,7 +67,7 @@
6567
"eslint-plugin-import": "2.x",
6668
"eslint-plugin-jsx-a11y": "6.x",
6769
"eslint-plugin-react": "7.x",
68-
"eslint-plugin-react-hooks": "2.x",
70+
"eslint-plugin-react-hooks": "^0.0.0-experimental-fabef7a6b-20221215",
6971
"fs-extra": "^9.0.1",
7072
"globby": "^11.0.1",
7173
"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.
Lines changed: 22 additions & 0 deletions
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)=>{

0 commit comments

Comments
 (0)