Skip to content

Commit 3342ce3

Browse files
committed
[BPK-4282]: Rebase CRA 4 to BRS
1 parent 7ba8154 commit 3342ce3

File tree

12 files changed

+353
-181
lines changed

12 files changed

+353
-181
lines changed

packages/react-scripts/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# `backpack-react-scripts` Change Log
22

3+
## 9.0.1
4+
5+
- Fixed an issue where eslint was being shipped, which is not required due to our own linting package.
6+
7+
## 9.0.0
8+
9+
With this change its is only breaking due to the requirement of needing `Jest` to be upgraded to `26.6.0`, nothing else should affect from a consumer perspective.
10+
11+
### Breaking
12+
13+
- Rebased onto `upstream/master` v4.0.0 (ed958938f642007645dd5ac3466db36202f8754e).
14+
- This release rebases `backpack-react-scripts` on top of `create-react-app` v4! The major changes have been summarised in the following blog post:
15+
[Create React App 4.0](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#400-2020-10-23)
16+
17+
- **The only breaking change is the requirement of Jest to be upgraded. Please follow [this guide](./docs/migrating-from-v8-to-v9.md) when upgrading.**
18+
319
## 8.0.5
420

521
- Updated `bpk-mixins` to latest version

packages/react-scripts/README.md

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# backpack-react-scripts
22

3-
### **Important:** The currently supported version of **CRA** by `backpack-react-scripts` is up to `v3.4.1`. Versions above this will not work.
3+
### **Important:** The currently supported version of **CRA** by `backpack-react-scripts` is up to `v4.0.0`. Versions above this will not work.
44

55
This package is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) (specifically the
66
`react-scripts` package). It's intended to be used in conjuction with `create-react-app` like so:
77

88
```sh
9-
npx create-react-app@3.4.1 my-app --scripts-version=@skyscanner/backpack-react-scripts --template @skyscanner/backpack --use-npm
9+
npx create-react-app@4.0.0 my-app --scripts-version=@skyscanner/backpack-react-scripts --template @skyscanner/backpack --use-npm
1010

1111
# start your app development like you normally would with `create-react-app`
1212
cd my-app
@@ -32,63 +32,3 @@ npm start
3232
- `cssModules`: Boolean, true by default.
3333
- `sriEnabled`: Sets if SRI is to be used during build to add integrity hash for files, see [docs](https://github.com/waysact/webpack-subresource-integrity/blob/master/README.md).
3434
- **Note** if this is enabled, `crossOriginLoading` value is overriden with `anonymous` in order for it to output with the integrity value.
35-
36-
## Releasing a new version of `backpack-react-scripts`
37-
38-
1. To publish a new version of `backpack-react-scripts`, run the following command:
39-
40-
```
41-
npm run publish
42-
```
43-
44-
2. You will be prompted to select a new semver version (MAJOR, MINOR, PATCH). Use the [CHANGELOG.md](./CHANGELOG.md) to decide on the nature of the changes since the last release.
45-
46-
- If you want to be extra careful, you can publish a prerelease by running this instead:
47-
48-
```
49-
npm run publish -- --canary
50-
```
51-
52-
3. Update the [CHANGELOG.md](./CHANGELOG.md) with the new version, taking care to follow the format of previous releases.
53-
54-
## Keeping this fork updated
55-
56-
We wish to keep this fork updated with the upstream repo to benefit from the ongoing open source development
57-
of `create-react-app`. To keep this fork up to date, please follow the steps below:
58-
59-
1. Ensure `master` is in sync with `upstream/master`:
60-
61-
```sh
62-
git checkout master
63-
git remote add upstream git@github.com:facebook/create-react-app.git
64-
git fetch upstream
65-
git reset --hard upstream/master
66-
git push --force-with-lease
67-
```
68-
69-
1. Rebase `fork` on top of a **tagged release** on `master`:
70-
71-
```sh
72-
git checkout fork
73-
git rebase <commit>
74-
```
75-
76-
> **Note:** `<commit>` should be the SHA-1 of the latest upstream release - _not_ the latest commit i.e. `upstream/master`
77-
78-
1. Pair with someone else to fix any conflicts and cross examine changes in upstream with changes in our fork.
79-
80-
> This is the most time consuming part. Take care to make sure you are not regressing any functionality that we have added in our fork.
81-
82-
1. Re-name your local, rebased `fork` branch to something else and push it to origin. This will ensure it runs through CI and you can verify your changes.
83-
84-
```sh
85-
git branch -m <branch>
86-
git push origin <branch>
87-
```
88-
89-
1. Finally, when we are confident that the rebase has been successful, re-name your branch back to `fork` and push it to origin:
90-
91-
```sh
92-
git branch -m fork
93-
git push --force-with-lease
94-
```

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
2727
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
2828
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2929
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
30-
const ESLintPlugin = require('eslint-webpack-plugin');
30+
// const ESLintPlugin = require('eslint-webpack-plugin');
3131
const paths = require('./paths');
3232
const modules = require('./modules');
3333
const getClientEnvironment = require('./env');
@@ -863,24 +863,25 @@ module.exports = function (webpackEnv) {
863863
// The formatter is invoked directly in WebpackDevServerUtils during development
864864
formatter: isEnvProduction ? typescriptFormatter : undefined,
865865
}),
866-
new ESLintPlugin({
867-
// Plugin options
868-
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
869-
formatter: require.resolve('react-dev-utils/eslintFormatter'),
870-
eslintPath: require.resolve('eslint'),
871-
context: paths.appSrc,
872-
// ESLint class options
873-
cwd: paths.appPath,
874-
resolvePluginsRelativeTo: __dirname,
875-
baseConfig: {
876-
extends: [require.resolve('eslint-config-react-app/base')],
877-
rules: {
878-
...(!hasJsxRuntime && {
879-
'react/react-in-jsx-scope': 'error',
880-
}),
881-
},
882-
},
883-
}),
866+
// As we have our own linters we don't wish to use linting
867+
// new ESLintPlugin({
868+
// // Plugin options
869+
// extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
870+
// formatter: require.resolve('react-dev-utils/eslintFormatter'),
871+
// eslintPath: require.resolve('eslint'),
872+
// context: paths.appSrc,
873+
// // ESLint class options
874+
// cwd: paths.appPath,
875+
// resolvePluginsRelativeTo: __dirname,
876+
// baseConfig: {
877+
// extends: [require.resolve('eslint-config-react-app/base')],
878+
// rules: {
879+
// ...(!hasJsxRuntime && {
880+
// 'react/react-in-jsx-scope': 'error',
881+
// }),
882+
// },
883+
// },
884+
// }),
884885
].filter(Boolean),
885886
// Some libraries import Node modules but don't use them in the browser.
886887
// Tell webpack to provide empty mocks for them so importing them works.

0 commit comments

Comments
 (0)