Skip to content

Commit f0a837c

Browse files
Morten N.O. Nørgaard HenriksenianschmitzjasonwilliamsSpacerate-w-h
authored
Webpack 5 (#11201)
Co-authored-by: Ian Schmitz <ianschmitz@gmail.com> Co-authored-by: jasonwilliams <jase.williams@gmail.com> Co-authored-by: Joseph Atkins-Turkish <spacerat3004@gmail.com> Co-authored-by: e-w-h <46170930+e-w-h@users.noreply.github.com> Co-authored-by: Shamprasad RH <shamprasad.rh@mail.weir> Co-authored-by: James George <jamesgeorge998001@gmail.com>
1 parent a179b05 commit f0a837c

Some content is hidden

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

48 files changed

+2999
-5350
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
17-
node: ['10', '12', '14']
17+
node: ['14', '16']
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Setup node

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Create a project, and you’re good to go.
3939

4040
## Creating an App
4141

42-
**You’ll need to have Node 10.16.0 or later version on your local development machine** (but it’s not required on the server). We recommend using the latest LTS version. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
42+
**You’ll need to have Node 14.0.0 or later version on your local development machine** (but it’s not required on the server). We recommend using the latest LTS version. You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
4343

4444
To create a new app, you may choose one of the following methods:
4545

azure-pipelines-test-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ parameters:
66
name: ''
77
testScript: ''
88
configurations:
9-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
10-
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
9+
LinuxNode14: { vmImage: 'ubuntu-latest', nodeVersion: 14.x }
10+
LinuxNode16: { vmImage: 'ubuntu-latest', nodeVersion: 16.x }
1111

1212
jobs:
1313
- job: ${{ parameters.name }}

azure-pipelines.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
# ******************************************************************************
2727
# Installs test suite
2828
# ******************************************************************************
29-
- template: azure-pipelines-test-job.yml
30-
parameters:
31-
name: Installs
32-
testScript: tasks/e2e-installs.sh
29+
# - template: azure-pipelines-test-job.yml
30+
# parameters:
31+
# name: Installs
32+
# testScript: tasks/e2e-installs.sh
3333

3434
# ******************************************************************************
3535
# Kitchensink test suite
@@ -42,25 +42,25 @@ jobs:
4242
# ******************************************************************************
4343
# Kitchensink Eject test suite
4444
# ******************************************************************************
45-
- template: azure-pipelines-test-job.yml
46-
parameters:
47-
name: KitchensinkEject
48-
testScript: tasks/e2e-kitchensink-eject.sh
45+
# - template: azure-pipelines-test-job.yml
46+
# parameters:
47+
# name: KitchensinkEject
48+
# testScript: tasks/e2e-kitchensink-eject.sh
4949

5050
# ******************************************************************************
5151
# Behavior test suite
5252
# ******************************************************************************
53-
- template: azure-pipelines-test-job.yml
54-
parameters:
55-
name: Behavior
56-
testScript: tasks/e2e-behavior.sh
57-
configurations:
58-
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
59-
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
60-
WindowsNode10: { vmImage: 'windows-2019', nodeVersion: 10.x }
61-
WindowsNode12: { vmImage: 'windows-2019', nodeVersion: 12.x }
62-
MacNode10: { vmImage: 'macOS-10.15', nodeVersion: 10.x }
63-
MacNode12: { vmImage: 'macOS-10.15', nodeVersion: 12.x }
53+
# - template: azure-pipelines-test-job.yml
54+
# parameters:
55+
# name: Behavior
56+
# testScript: tasks/e2e-behavior.sh
57+
# configurations:
58+
# LinuxNode14: { vmImage: 'ubuntu-latest', nodeVersion: 14.x }
59+
# LinuxNode16: { vmImage: 'ubuntu-latest', nodeVersion: 16.x }
60+
# WindowsNode14: { vmImage: 'windows-2019', nodeVersion: 14.x }
61+
# WindowsNode16: { vmImage: 'windows-2019', nodeVersion: 16.x }
62+
# MacNode14: { vmImage: 'macOS-10.15', nodeVersion: 14.x }
63+
# MacNode16: { vmImage: 'macOS-10.15', nodeVersion: 16.x }
6464

6565
# ******************************************************************************
6666
# Old Node test suite

docusaurus/docs/advanced-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can adjust various development and production settings by setting environmen
1515
| PORT | ✅ Used | 🚫 Ignored | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port. |
1616
| HTTPS | ✅ Used | 🚫 Ignored | When set to `true`, Create React App will run the development server in `https` mode. |
1717
| WDS_SOCKET_HOST | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket hostname for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.hostname` for the SockJS hostname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockhost) for more details. |
18-
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/sockjs-node` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
18+
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/ws` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
1919
| WDS_SOCKET_PORT | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket port for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.port` for the SockJS port. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockport) for more details. |
2020
| PUBLIC_URL | ✅ Used | ✅ Used | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](deployment#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application. |
2121
| BUILD_PATH | 🚫 Ignored | ✅ Used | By default, Create React App will output compiled assets to a `/build` directory adjacent to your `/src`. You may use this variable to specify a new path for Create React App to output assets. BUILD_PATH should be specified as a path relative to the root of your project. |

docusaurus/docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Create a project, and you’re good to go.
3434

3535
## Creating an App
3636

37-
**You’ll need to have Node >= 10 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
37+
**You’ll need to have Node >= 14 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
3838

3939
To create a new app, you may choose one of the following methods:
4040

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@testing-library/react": "^11.1.0",
2626
"@testing-library/user-event": "^12.1.10",
2727
"alex": "^8.2.0",
28-
"eslint": "^7.11.0",
28+
"eslint": "^7.30.0",
2929
"execa": "1.0.0",
3030
"fs-extra": "^9.0.1",
3131
"get-port": "^5.1.1",

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,24 @@ module.exports = function (api, opts, env) {
146146
// class { handleClick = () => { } }
147147
// Enable loose mode to use assignment instead of defineProperty
148148
// See discussion in https://github.com/facebook/create-react-app/issues/4263
149+
// Note:
150+
// 'loose' mode configuration must be the same for
151+
// * @babel/plugin-proposal-class-properties
152+
// * @babel/plugin-proposal-private-methods
153+
// * @babel/plugin-proposal-private-property-in-object
154+
// (when they are enabled)
149155
[
150156
require('@babel/plugin-proposal-class-properties').default,
151157
{
152158
loose: true,
153159
},
154160
],
161+
[
162+
require('@babel/plugin-proposal-private-methods').default,
163+
{
164+
loose: true,
165+
},
166+
],
155167
// Adds Numeric Separators
156168
require('@babel/plugin-proposal-numeric-separator').default,
157169
// Polyfills the runtime needed for async/await, generators, and friends

packages/babel-preset-react-app/package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
"test.js"
2222
],
2323
"dependencies": {
24-
"@babel/core": "^7.12.3",
25-
"@babel/plugin-proposal-class-properties": "^7.12.1",
26-
"@babel/plugin-proposal-decorators": "^7.12.1",
27-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
28-
"@babel/plugin-proposal-numeric-separator": "^7.12.1",
29-
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
30-
"@babel/plugin-transform-flow-strip-types": "^7.12.1",
31-
"@babel/plugin-transform-react-display-name": "^7.12.1",
32-
"@babel/plugin-transform-runtime": "^7.12.1",
33-
"@babel/preset-env": "^7.12.1",
34-
"@babel/preset-react": "^7.12.1",
35-
"@babel/preset-typescript": "^7.12.1",
36-
"@babel/runtime": "^7.12.1",
37-
"babel-plugin-macros": "^2.8.0",
24+
"@babel/core": "^7.14.6",
25+
"@babel/plugin-proposal-class-properties": "^7.14.5",
26+
"@babel/plugin-proposal-decorators": "^7.14.5",
27+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
28+
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
29+
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
30+
"@babel/plugin-proposal-private-methods": "^7.14.5",
31+
"@babel/plugin-transform-flow-strip-types": "^7.14.5",
32+
"@babel/plugin-transform-react-display-name": "^7.14.5",
33+
"@babel/plugin-transform-runtime": "^7.14.5",
34+
"@babel/preset-env": "^7.14.5",
35+
"@babel/preset-react": "^7.14.5",
36+
"@babel/preset-typescript": "^7.14.5",
37+
"@babel/runtime": "^7.14.5",
38+
"babel-plugin-macros": "^3.1.0",
3839
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
3940
}
4041
}

packages/cra-template-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"license": "MIT",
1717
"engines": {
18-
"node": ">=10"
18+
"node": ">=14"
1919
},
2020
"bugs": {
2121
"url": "https://github.com/facebook/create-react-app/issues"

packages/cra-template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"license": "MIT",
1616
"engines": {
17-
"node": ">=10"
17+
"node": ">=14"
1818
},
1919
"bugs": {
2020
"url": "https://github.com/facebook/create-react-app/issues"

packages/create-react-app/__tests__/getTemplateInstallPackage.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ describe('getTemplateInstallPackage', () => {
2121
});
2222

2323
it('cra-template-typescript gives cra-template-typescript', async () => {
24-
await expect(getTemplateInstallPackage('cra-template-typescript')).resolves.toBe(
25-
'cra-template-typescript'
26-
);
24+
await expect(
25+
getTemplateInstallPackage('cra-template-typescript')
26+
).resolves.toBe('cra-template-typescript');
2727
});
2828

2929
it('typescript gives cra-template-typescript', async () => {
@@ -45,9 +45,9 @@ describe('getTemplateInstallPackage', () => {
4545
});
4646

4747
it('cra-template-typescript@next gives cra-template-typescript@next', async () => {
48-
await expect(getTemplateInstallPackage('cra-template-typescript@next')).resolves.toBe(
49-
'cra-template-typescript@next'
50-
);
48+
await expect(
49+
getTemplateInstallPackage('cra-template-typescript@next')
50+
).resolves.toBe('cra-template-typescript@next');
5151
});
5252

5353
it('@iansu gives @iansu/cra-template', async () => {
@@ -69,9 +69,9 @@ describe('getTemplateInstallPackage', () => {
6969
});
7070

7171
it('@iansu/cra-template-typescript@next gives @iansu/cra-template-typescript@next', async () => {
72-
await expect(getTemplateInstallPackage('@iansu/cra-template-typescript@next')).resolves.toBe(
73-
'@iansu/cra-template-typescript@next'
74-
);
72+
await expect(
73+
getTemplateInstallPackage('@iansu/cra-template-typescript@next')
74+
).resolves.toBe('@iansu/cra-template-typescript@next');
7575
});
7676

7777
it('http://example.com/cra-template.tar.gz gives http://example.com/cra-template.tar.gz', async () => {

packages/create-react-app/createReactApp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,14 @@ function createApp(name, verbose, version, template, useNpm, usePnp) {
239239
const unsupportedNodeVersion = !semver.satisfies(
240240
// Coerce strings with metadata (i.e. `15.0.0-nightly`).
241241
semver.coerce(process.version),
242-
'>=10'
242+
'>=14'
243243
);
244244

245245
if (unsupportedNodeVersion) {
246246
console.log(
247247
chalk.yellow(
248248
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
249-
`Please update to Node 10 or higher for a better, fully supported experience.\n`
249+
`Please update to Node 14 or higher for a better, fully supported experience.\n`
250250
)
251251
);
252252
// Fall back to latest supported react-scripts on Node 4
@@ -527,7 +527,7 @@ function run(
527527
console.log(
528528
chalk.yellow(
529529
`\nNote: the project was bootstrapped with an old unsupported version of tools.\n` +
530-
`Please update to Node >=10 and npm >=6 to get supported tools in new projects.\n`
530+
`Please update to Node >=14 and npm >=6 to get supported tools in new projects.\n`
531531
)
532532
);
533533
}

packages/create-react-app/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ var currentNodeVersion = process.versions.node;
4040
var semver = currentNodeVersion.split('.');
4141
var major = semver[0];
4242

43-
if (major < 10) {
43+
if (major < 14) {
4444
console.error(
4545
'You are running Node ' +
4646
currentNodeVersion +
4747
'.\n' +
48-
'Create React App requires Node 10 or higher. \n' +
48+
'Create React App requires Node 14 or higher. \n' +
4949
'Please update your version of Node.'
5050
);
5151
process.exit(1);

packages/create-react-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"license": "MIT",
1414
"engines": {
15-
"node": ">=10"
15+
"node": ">=14"
1616
},
1717
"bugs": {
1818
"url": "https://github.com/facebook/create-react-app/issues"

0 commit comments

Comments
 (0)