Skip to content

Commit 3cca085

Browse files
authored
Merge branch 'facebook:main' into main
2 parents 9e5a58c + 5ed5db4 commit 3cca085

File tree

6 files changed

+423
-450
lines changed

6 files changed

+423
-450
lines changed

packages/babel-preset-react-app/create.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ module.exports = function (api, opts, env) {
164164
loose: true,
165165
},
166166
],
167+
[
168+
require('@babel/plugin-proposal-private-property-in-object').default,
169+
{
170+
loose: true,
171+
},
172+
],
167173
// Adds Numeric Separators
168174
require('@babel/plugin-proposal-numeric-separator').default,
169175
// Polyfills the runtime needed for async/await, generators, and friends

packages/create-react-app/yarn.lock.cached

Lines changed: 401 additions & 432 deletions
Large diffs are not rendered by default.

packages/react-scripts/config/webpackDevServer.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,27 @@ module.exports = function (proxy, allowedHost) {
101101
},
102102
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
103103
proxy,
104-
onBeforeSetupMiddleware(app, server) {
104+
onBeforeSetupMiddleware(devServer) {
105105
// Keep `evalSourceMapMiddleware`
106106
// middlewares before `redirectServedPath` otherwise will not have any effect
107107
// This lets us fetch source contents from webpack for the error overlay
108-
app.use(evalSourceMapMiddleware(server));
108+
devServer.app.use(evalSourceMapMiddleware(devServer));
109109

110110
if (fs.existsSync(paths.proxySetup)) {
111111
// This registers user provided middleware for proxy reasons
112-
require(paths.proxySetup)(app);
112+
require(paths.proxySetup)(devServer.app);
113113
}
114114
},
115-
onAfterSetupMiddleware(app) {
115+
onAfterSetupMiddleware(devServer) {
116116
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
117-
app.use(redirectServedPath(paths.publicUrlOrPath));
117+
devServer.app.use(redirectServedPath(paths.publicUrlOrPath));
118118

119119
// This service worker file is effectively a 'no-op' that will reset any
120120
// previous service worker registered for the same host:port combination.
121121
// We do this in development to avoid hitting the production cache if
122122
// it used the same host and port.
123123
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
124-
app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
124+
devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
125125
},
126126
};
127127
};

packages/react-scripts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
"source-map-loader": "^1.1.2",
7272
"style-loader": "3.0.0",
7373
"webpack": "5.41.1",
74-
"webpack-dev-server": "4.0.0-rc.0",
74+
"webpack-dev-server": "4.0.0",
7575
"webpack-manifest-plugin": "3.1.1",
76-
"workbox-webpack-plugin": "6.1.5"
76+
"workbox-webpack-plugin": "6.2.4"
7777
},
7878
"devDependencies": {
7979
"react": "^17.0.1",

packages/react-scripts/scripts/start.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ checkBrowsers(paths.appPath, isInteractive)
124124
paths.publicUrlOrPath
125125
);
126126
// Serve webpack assets generated by the compiler over a web server.
127-
const serverConfig = createDevServerConfig(
128-
proxyConfig,
129-
urls.lanUrlForConfig
130-
);
131-
const devServer = new WebpackDevServer(compiler, serverConfig);
127+
const serverConfig = {
128+
...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
129+
host: HOST,
130+
port,
131+
};
132+
const devServer = new WebpackDevServer(serverConfig, compiler);
132133
// Launch WebpackDevServer.
133-
devServer.listen(port, HOST, err => {
134-
if (err) {
135-
return console.log(err);
136-
}
134+
devServer.startCallback(() => {
137135
if (isInteractive) {
138136
clearConsole();
139137
}

tasks/local-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function print_help {
1818

1919
cd $(dirname $0)
2020

21-
node_version=12
21+
node_version=14
2222
current_git_branch=`git rev-parse --abbrev-ref HEAD`
2323
git_branch=${current_git_branch}
2424
test_suite=all

0 commit comments

Comments
 (0)