-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade to docusaurus 2 * address review
- Loading branch information
Showing
27 changed files
with
6,314 additions
and
3,568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,8 @@ import 'bootstrap/dist/css/bootstrap.css'; | |
|
||
> Note: this feature is available with `[email protected]` and higher. | ||
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package).<br> | ||
Sometimes you might need to tweak the visual styles of Bootstrap (or equivalent package). | ||
|
||
As of `[email protected]` you can import `.scss` files. This makes it possible to use a package's built-in Sass variables for global style preferences. | ||
|
||
To enable `scss` in Create React App you will need to install `node-sass`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ sidebar_label: Proxying in Development | |
|
||
> Note: this feature is available with `[email protected]` and higher. | ||
People often serve the front-end React app from the same host and port as their backend implementation.<br> | ||
People often serve the front-end React app from the same host and port as their backend implementation. | ||
|
||
For example, a production setup might look like this after the app is deployed: | ||
|
||
/ - static server returns index.html with React app | ||
|
@@ -31,7 +32,8 @@ Fetch API cannot load http://localhost:4000/api/todos. No 'Access-Control-Allow- | |
|
||
Keep in mind that `proxy` only has effect in development (with `npm start`), and it is up to you to ensure that URLs like `/api/todos` point to the right thing in production. You don’t have to use the `/api` prefix. Any unrecognized request without a `text/html` accept header will be redirected to the specified `proxy`. | ||
|
||
The `proxy` option supports HTTP, HTTPS and WebSocket connections.<br> | ||
The `proxy` option supports HTTP, HTTPS and WebSocket connections. | ||
|
||
If the `proxy` option is **not** flexible enough for you, alternatively you can: | ||
|
||
- [Configure the proxy yourself](#configuring-the-proxy-manually) | ||
|
@@ -96,10 +98,13 @@ You can now register proxies as you wish! Here's an example using the above `htt | |
const proxy = require('http-proxy-middleware'); | ||
|
||
module.exports = function(app) { | ||
app.use('/api', proxy({ | ||
target: 'http://localhost:5000', | ||
changeOrigin: true, | ||
})); | ||
app.use( | ||
'/api', | ||
proxy({ | ||
target: 'http://localhost:5000', | ||
changeOrigin: true, | ||
}) | ||
); | ||
}; | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ id: running-tests | |
title: Running Tests | ||
--- | ||
|
||
> Note: this feature is available with `[email protected]` and higher.<br> | ||
> Note: this feature is available with `[email protected]` and higher. | ||
> [Read the migration guide to learn how to enable it in older projects!](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-0.x.md#migrating-from-023-to-030) | ||
|
@@ -60,7 +60,8 @@ it('sums numbers', () => { | |
}); | ||
``` | ||
|
||
All `expect()` matchers supported by Jest are [extensively documented here](https://jestjs.io/docs/en/expect.html#content).<br> | ||
All `expect()` matchers supported by Jest are [extensively documented here](https://jestjs.io/docs/en/expect.html#content). | ||
|
||
You can also use [`jest.fn()` and `expect(fn).toBeCalled()`](https://jestjs.io/docs/en/expect.html#tohavebeencalled) to create “spies” or mock functions. | ||
|
||
## Testing Components | ||
|
@@ -144,7 +145,8 @@ it('renders welcome message', () => { | |
}); | ||
``` | ||
|
||
All Jest matchers are [extensively documented here](https://jestjs.io/docs/en/expect.html).<br> | ||
All Jest matchers are [extensively documented here](https://jestjs.io/docs/en/expect.html). | ||
|
||
Nevertheless you can use a third-party assertion library like [Chai](https://chaijs.com/) if you want to, as described below. | ||
|
||
Additionally, you might find [jest-enzyme](https://github.com/blainekasten/enzyme-matchers) helpful to simplify your tests with readable matchers. The above `contains` code can be written more simply with jest-enzyme. | ||
|
@@ -254,12 +256,14 @@ global.localStorage = localStorageMock; | |
## Focusing and Excluding Tests | ||
You can replace `it()` with `xit()` to temporarily exclude a test from being executed.<br> | ||
You can replace `it()` with `xit()` to temporarily exclude a test from being executed. | ||
Similarly, `fit()` lets you focus on a specific test without running any other tests. | ||
## Coverage Reporting | ||
Jest has an integrated coverage reporter that works well with ES6 and requires no configuration.<br> | ||
Jest has an integrated coverage reporter that works well with ES6 and requires no configuration. | ||
Run `npm test -- --coverage` (note extra `--` in the middle) to include a coverage report like this: | ||
 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,10 @@ To configure the syntax highlighting in your favorite text editor, head to the [ | |
|
||
## Displaying Lint Output in the Editor | ||
|
||
> Note: this feature is available with `[email protected]` and higher.<br> | ||
> It works out of the box for newly created projects with `[email protected]` and higher.<br> | ||
> Note: this feature is available with `[email protected]` and higher. | ||
> It works out of the box for newly created projects with `[email protected]` and higher. | ||
> It also only works with npm 3 or higher. | ||
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# production | ||
/build | ||
|
||
# generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Oops, something went wrong.
decorators