Skip to content

Commit d4b74f3

Browse files
authored
Merge pull request #23 from Babylonpartners/CW-1110-upgrade-cra-v2.1.5
[CW-1110] upgrade CRA to v2.1.5
2 parents d467c80 + 772daaf commit d4b74f3

Some content is hidden

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

63 files changed

+2841
-2164
lines changed

.github/lock.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Number of days of inactivity before a closed issue or pull request is locked
44
daysUntilLock: 5
55

6+
# Issues and pull requests with these labels will not be locked. Set to `[]` to disable
7+
exemptLabels: []
8+
69
# Do not comment when locking
710
setLockReason: false
811
lockComment: false

.github/stale.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ daysUntilClose: 5
99

1010
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
1111
exemptLabels:
12-
- "issue: proposal"
12+
- "contributions: claimed"
13+
- "contributions: up for grabs!"
14+
- "good first issue"
1315
- "issue: announcement"
16+
- "issue: bug"
17+
- "issue: proposal"
18+
- "tag: bug fix"
19+
- "tag: needs investigation"
1420

1521
# Set to true to ignore issues in a project (defaults to false)
1622
exemptProjects: true

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cache:
1010
directories:
1111
- .npm
1212
before_install:
13-
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly
13+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s
1414
- export PATH="$HOME/.yarn/bin:$PATH"
1515
install: true
1616
script:

CHANGELOG.md

Lines changed: 321 additions & 0 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ By default git would use `CRLF` line endings which would cause the scripts to fa
142142
9. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
143143
10. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
144144

145-
Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --npm-tag=next` instead of `npm run publish`.
146-
147-
Optionally, you can cut a prerelease instead by running `npm run publish -- --canary=next --exact --cd-version patch --npm-tag=next`.
145+
Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --canary=next --exact --cd-version patch --npm-tag=next` instead of `npm run publish`.
148146

149147
---
150148

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Create React App is a great fit for:
163163
- **Starting new single-page React applications.**
164164
- **Creating examples** with React for your libraries and components.
165165

166-
Here are few common cases where you might want to try something else:
166+
Here are a few common cases where you might want to try something else:
167167

168168
- If you want to **try React** without hundreds of transitive build tool dependencies, consider [using a single HTML file or an online sandbox instead](https://reactjs.org/docs/try-react.html).
169169

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ platform:
3737
install:
3838
- ps: Install-Product node $env:nodejs_version $env:platform
3939
- ps: |
40-
(New-Object Net.WebClient).DownloadFile("https://nightly.yarnpkg.com/latest.msi", "$env:temp\yarn.msi")
40+
(New-Object Net.WebClient).DownloadFile("https://yarnpkg.com/latest.msi", "$env:temp\yarn.msi")
4141
cmd /c start /wait msiexec.exe /i $env:temp\yarn.msi /quiet /qn /norestart
4242
4343
build: off

docusaurus/docs/adding-a-css-modules-stylesheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ No clashes from other `.error` class names
4949

5050
```html
5151
<!-- This button has red background but not red text -->
52-
<button class="Button_error_ax7yz"></div>
52+
<button class="Button_error_ax7yz">Error Button</button>
5353
```
5454

5555
**This is an optional feature.** Regular `<link>` stylesheets and CSS files are fully supported. CSS Modules are turned on for files ending with the `.module.css` extension.

docusaurus/docs/adding-bootstrap.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ id: adding-bootstrap
33
title: Adding Bootstrap
44
---
55

6-
You don’t have to use [reactstrap](https://reactstrap.github.io/) together with React but it is a popular library for integrating Bootstrap with React apps. If you need it, you can integrate it with Create React App by following these steps:
6+
While you don’t have to use any specific library to integrate Bootstrap with React apps, it's often easier than trying to wrap the Bootstrap jQuery plugins. [React Bootstrap](https://react-bootstrap.netlify.com/) is the most popular option, that strives for complete parity with bootstrap. [reactstrap](https://reactstrap.github.io/) is also a good choice for projects looking for smaller builds at the expense of some features.
77

8-
Install reactstrap and Bootstrap from npm. reactstrap does not include Bootstrap CSS so this needs to be installed as well:
8+
Each project's respective documentation site has detailed instructions for installing and using them. Both depend on the Bootstrap css file so install that as well:
99

1010
```sh
11-
npm install --save reactstrap bootstrap@4
11+
npm install --save bootstrap
1212
```
1313

1414
Alternatively you may use `yarn`:
1515

1616
```sh
17-
yarn add bootstrap@4 reactstrap
17+
yarn add bootstrap
1818
```
1919

2020
Import Bootstrap CSS and optionally Bootstrap theme CSS in the beginning of your `src/index.js` file:
@@ -25,22 +25,14 @@ import 'bootstrap/dist/css/bootstrap.css';
2525
// components takes precedence over default styles.
2626
```
2727

28-
Import required reactstrap components within `src/App.js` file or your custom component files:
29-
30-
```js
31-
import { Button } from 'reactstrap';
32-
```
33-
34-
Now you are ready to use the imported reactstrap components within your component hierarchy defined in the render method. Here is an example [`App.js`](https://gist.githubusercontent.com/zx6658/d9f128cd57ca69e583ea2b5fea074238/raw/a56701c142d0c622eb6c20a457fbc01d708cb485/App.js) redone using reactstrap.
35-
3628
## Using a Custom Theme
3729

3830
> Note: this feature is available with `react-scripts@2.0.0` and higher.
3931
4032
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).<br>
4133
As of `react-scripts@2.0.0` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences.
4234

43-
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](http://getbootstrap.com/docs/4.1/getting-started/theming/#css-variables) for the names of the available variables.
35+
To customize Bootstrap, create a file called `src/custom.scss` (or similar) and import the Bootstrap source stylesheet. Add any overrides _before_ the imported file(s). You can reference [Bootstrap's documentation](https://getbootstrap.com/docs/4.1/getting-started/theming/#css-variables) for the names of the available variables.
4436

4537
```scss
4638
// Override default variables before the import

docusaurus/docs/adding-custom-environment-variables.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,49 @@ sidebar_label: Environment Variables
66

77
> Note: this feature is available with `react-scripts@0.2.3` and higher.
88
9-
Your project can consume variables declared in your environment as if they were declared locally in your JS files. By
10-
default you will have `NODE_ENV` defined for you, and any other environment variables starting with
11-
`REACT_APP_`.
9+
Your project can consume variables declared in your environment as if they were declared locally in your JS files. By default you will have `NODE_ENV` defined for you, and any other environment variables starting with `REACT_APP_`.
10+
11+
> WARNING: Do not store any secrets (such as private API keys) in your React app!
12+
>
13+
> Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files.
1214
1315
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, just like [described here](title-and-meta-tags.md#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
1416

1517
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid accidentally [exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.
1618
17-
These environment variables will be defined for you on `process.env`. For example, having an environment
18-
variable named `REACT_APP_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_SECRET_CODE`.
19+
These environment variables will be defined for you on `process.env`. For example, having an environment variable named `REACT_APP_NOT_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_NOT_SECRET_CODE`.
1920

2021
There is also a special built-in environment variable called `NODE_ENV`. You can read it from `process.env.NODE_ENV`. When you run `npm start`, it is always equal to `'development'`, when you run `npm test` it is always equal to `'test'`, and when you run `npm run build` to make a production bundle, it is always equal to `'production'`. **You cannot override `NODE_ENV` manually.** This prevents developers from accidentally deploying a slow development build to production.
2122

22-
These environment variables can be useful for displaying information conditionally based on where the project is
23-
deployed or consuming sensitive data that lives outside of version control.
23+
These environment variables can be useful for displaying information conditionally based on where the project is deployed or consuming sensitive data that lives outside of version control.
2424

25-
First, you need to have environment variables defined. For example, let’s say you wanted to consume a secret defined
26-
in the environment inside a `<form>`:
25+
First, you need to have environment variables defined. For example, let’s say you wanted to consume an environment variable inside a `<form>`:
2726

2827
```jsx
2928
render() {
3029
return (
3130
<div>
3231
<small>You are running this application in <b>{process.env.NODE_ENV}</b> mode.</small>
3332
<form>
34-
<input type="hidden" defaultValue={process.env.REACT_APP_SECRET_CODE} />
33+
<input type="hidden" defaultValue={process.env.REACT_APP_NOT_SECRET_CODE} />
3534
</form>
3635
</div>
3736
);
3837
}
3938
```
4039

41-
During the build, `process.env.REACT_APP_SECRET_CODE` will be replaced with the current value of the `REACT_APP_SECRET_CODE` environment variable. Remember that the `NODE_ENV` variable will be set for you automatically.
40+
During the build, `process.env.REACT_APP_NOT_SECRET_CODE` will be replaced with the current value of the `REACT_APP_NOT_SECRET_CODE` environment variable. Remember that the `NODE_ENV` variable will be set for you automatically.
4241

4342
When you load the app in the browser and inspect the `<input>`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:
4443

4544
```html
4645
<div>
4746
<small>You are running this application in <b>development</b> mode.</small>
48-
<form>
49-
<input type="hidden" value="abcdef" />
50-
</form>
47+
<form><input type="hidden" value="abcdef" /></form>
5148
</div>
5249
```
5350

54-
The above form is looking for a variable called `REACT_APP_SECRET_CODE` from the environment. In order to consume this
55-
value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in
56-
a `.env` file. Both of these ways are described in the next few sections.
51+
The above form is looking for a variable called `REACT_APP_NOT_SECRET_CODE` from the environment. In order to consume this value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in a `.env` file. Both of these ways are described in the next few sections.
5752

5853
Having access to the `NODE_ENV` is also useful for performing actions conditionally:
5954

@@ -82,27 +77,26 @@ Note that the caveats from the above section apply:
8277

8378
## Adding Temporary Environment Variables In Your Shell
8479

85-
Defining environment variables can vary between OSes. It’s also important to know that this manner is temporary for the
86-
life of the shell session.
80+
Defining environment variables can vary between OSes. It’s also important to know that this manner is temporary for the life of the shell session.
8781

8882
### Windows (cmd.exe)
8983

9084
```cmd
91-
set "REACT_APP_SECRET_CODE=abcdef" && npm start
85+
set "REACT_APP_NOT_SECRET_CODE=abcdef" && npm start
9286
```
9387

9488
(Note: Quotes around the variable assignment are required to avoid a trailing whitespace.)
9589

9690
### Windows (Powershell)
9791

9892
```Powershell
99-
($env:REACT_APP_SECRET_CODE = "abcdef") -and (npm start)
93+
($env:REACT_APP_NOT_SECRET_CODE = "abcdef") -and (npm start)
10094
```
10195

10296
### Linux, macOS (Bash)
10397

10498
```bash
105-
REACT_APP_SECRET_CODE=abcdef npm start
99+
REACT_APP_NOT_SECRET_CODE=abcdef npm start
106100
```
107101

108102
## Adding Development Environment Variables In `.env`
@@ -112,7 +106,7 @@ REACT_APP_SECRET_CODE=abcdef npm start
112106
To define permanent environment variables, create a file called `.env` in the root of your project:
113107

114108
```
115-
REACT_APP_SECRET_CODE=abcdef
109+
REACT_APP_NOT_SECRET_CODE=abcdef
116110
```
117111

118112
> Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid [accidentally exposing a private key on the machine that could have the same name](https://github.com/facebook/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running.

0 commit comments

Comments
 (0)