Skip to content

Commit 9f236af

Browse files
jbedardalexeagle
authored andcommitted
example(cra): add intro about incrementality
1 parent e205c14 commit 9f236af

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

react-cra/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and
2-
then Bazelified.
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and then Bazelified.
2+
3+
## Initial setup
4+
5+
When you run `create-react-app`, it installs a build system called `react-scripts`. As a first step into Bazel, this example simply wraps the existing build system. This guarantees compatibility with your current code, and if your objective is just to include a frontend app into a bigger full-stack Bazel build, this might be the final step in the migration. However it will run `react-scripts` as a single Bazel action, which means that you gain no incrementality benefit. So we expect for most applications this is just a first step.
6+
37
## Available Scripts
48

59
Just like with stock create-react-app, we have the same developer workflow. In the project directory, you can run:
@@ -29,3 +33,6 @@ Your app is ready to be deployed!
2933

3034
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
3135

36+
## Next steps
37+
38+
The next step beyond this example would be making the build more incremental and performant. The `react-scripts` build system would be split into multiple Bazel actions that could be independently run and cached by Bazel. This would allow for incremental builds, and would be the next step in the migration. We continue to transpile TS to JS using Babel, for example, but we do it in a build step before invoking Webpack, just using the Babel CLI.

0 commit comments

Comments
 (0)