From c6328d6a317ed31fdabf6f5ea95f5cd7da856007 Mon Sep 17 00:00:00 2001 From: Kristofer Selbekk Date: Sun, 7 Oct 2018 19:45:27 +0200 Subject: [PATCH] Move adding flow to its own file --- docusaurus/docs/adding-flow.md | 21 +++++++++++++++++++++ docusaurus/docs/user-guide.md | 20 -------------------- docusaurus/website/sidebars.json | 3 ++- 3 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 docusaurus/docs/adding-flow.md diff --git a/docusaurus/docs/adding-flow.md b/docusaurus/docs/adding-flow.md new file mode 100644 index 00000000..a495a6cc --- /dev/null +++ b/docusaurus/docs/adding-flow.md @@ -0,0 +1,21 @@ +--- +id: adding-flow +title: Adding Flow +--- + +Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept. + +Recent versions of [Flow](https://flow.org/) work with Create React App projects out of the box. + +To add Flow to a Create React App project, follow these steps: + +1. Run `npm install --save flow-bin` (or `yarn add flow-bin`). +2. Add `"flow": "flow"` to the `scripts` section of your `package.json`. +3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flow.org/en/docs/config/) in the root directory. +4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`). + +Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors. +You can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience. +In the future we plan to integrate it into Create React App even more closely. + +To learn more about Flow, check out [its documentation](https://flow.org/). diff --git a/docusaurus/docs/user-guide.md b/docusaurus/docs/user-guide.md index fc74a95b..10573c70 100644 --- a/docusaurus/docs/user-guide.md +++ b/docusaurus/docs/user-guide.md @@ -11,7 +11,6 @@ You can find the most recent version of this guide [here](https://github.com/fac ## Table of Contents -- [Adding Flow](#adding-flow) - [Adding Relay](#adding-relay) - [Adding a Router](#adding-a-router) - [Adding Custom Environment Variables](#adding-custom-environment-variables) @@ -34,25 +33,6 @@ You can find the most recent version of this guide [here](https://github.com/fac - [Advanced Configuration](#advanced-configuration) - [Alternatives to Ejecting](#alternatives-to-ejecting) -## Adding Flow - -Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept. - -Recent versions of [Flow](https://flow.org/) work with Create React App projects out of the box. - -To add Flow to a Create React App project, follow these steps: - -1. Run `npm install --save flow-bin` (or `yarn add flow-bin`). -2. Add `"flow": "flow"` to the `scripts` section of your `package.json`. -3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flow.org/en/docs/config/) in the root directory. -4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`). - -Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors. -You can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience. -In the future we plan to integrate it into Create React App even more closely. - -To learn more about Flow, check out [its documentation](https://flow.org/). - ## Adding Relay Relay is a framework for building data-driven React applications powered by GraphQL. The current release candidate of Relay works with Create React App projects out of the box using Babel Macros. Simply set up your project as laid out in the [Relay documentation](https://facebook.github.io/relay/), then make sure you have a version of the babel plugin providing the macro. diff --git a/docusaurus/website/sidebars.json b/docusaurus/website/sidebars.json index ba60e573..f15b7622 100644 --- a/docusaurus/website/sidebars.json +++ b/docusaurus/website/sidebars.json @@ -28,7 +28,8 @@ "adding-images-fonts-and-files", "using-the-public-folder", "using-global-variables", - "adding-bootstrap" + "adding-bootstrap", + "adding-flow" ], "Testing": ["running-tests", "debugging-tests"], "Deployment": ["publishing-components-to-npm", "deployment"],