The React Platform
Published: 2020-03-04 19:46:52

I get a decent amount of questions that roughly resolve to “wtf is all this stuff in node_modules?” from friends and coworkers when they start learning React. Typically this is because they found a boilerplate like [Create React App](https://github.com/facebookincubator/create-react-app) or a tutorial that only gave “run this, run that” commands. This post is a collection of links that give more insight into the tools that are used in such boilerplates and why we use them.


If you are already wondering what goes on under the hood I hope this will point you in the right direction. It is not required reading for getting started with React and similar technologies.

# React

The first technology is less of a specific technology and more of a platform. React has become a style of thinking about a class of problems related to rendering. Notice that I didn’t say rendering UI because you can do some [really cool stuff](https://youtu.be/oPofnLZZTwQ?list=PLNBNS7NRGKMHxfm0CcYNuINLdRw7r4a9M&t=1238) with the Fiber reconciler.


-   [React Codebase](https://facebook.github.io/react/contributing/codebase-overview.html) The overview of the React codebase will touch on Renderers, [Reconcilers](https://facebook.github.io/react/docs/reconciliation.html), [the event system](https://www.youtube.com/watch?v=dRo_egw7tBc), colocating tests, development vs production builds, and how React handles warnings and invariants.

-   [React Implementation Notes](https://facebook.github.io/react/contributing/implementation-notes.html) The React implementation notes cover making [React from scratch](https://www.youtube.com/watch?v=_MAD4Oly9yg) along with linking to more documentation on [components, their instances, and elements](https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html). It goes over mounting and updating in more detail as well as a nice list of [what got left out](https://facebook.github.io/react/contributing/implementation-notes.html#what-we-left-out) of the document.

-   [Fiber Architecture](https://github.com/acdlite/react-fiber-architecture) Fiber is a new reconciler that many people are talking about.

-   [React Design Principles](https://facebook.github.io/react/contributing/design-principles.html) What matters to React as a project and what kinds of changes you can expect in the future.

-   [Thinking in React](https://facebook.github.io/react/docs/thinking-in-react.html) This doc is useful if you don’t have much experience with the React platform or similar component-based projects.


# Babel

Babel is a JavaScript compiler. It allows us to operate on an [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) to transform our code enabling powerful adaptations. The most common use of babel is to use it to compile newer versions of the [ECMAScript](https://github.com/tc39/ecma262#ecmascript) spec to older versions. For example, you can use babel to compile [ES6 JavaScript](https://github.com/lukehoban/es6features) to ES5 so that it can run in browsers. This is useful because we have a lot of platforms on which JavaScript can run ([node](https://nodejs.org/en/), browsers, [iOS/Android](https://facebook.github.io/react-native/), etc) and not all of them support the same language features.


-   [The Babel Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/README.md) The babel handbook is split into two sections. One for users of plugins and one for authors of plugins. Roughly these sections are “How to Use Babel” vs “How Babel Works Internally”.

-   [AST Explorer](http://astexplorer.net/) A tool that allows you to explore the AST for a given compiler.

-   [Babylon](https://github.com/babel/babylon) The JavaScript parser used in babel, it [produces a syntax tree](https://github.com/babel/babylon/blob/master/ast/spec.md) similar to [ESTree](https://github.com/estree/estree).

-   [Awesome Babel](https://github.com/babel/awesome-babel) An awesome list focused on babel. Check this out if want to see what’s possible with plugins.

-   [TC39 Proposals](https://github.com/tc39/proposals) This is a list of active proposals for inclusion in ECMAScript. Typically each of these proposals has a corresponding babel plugin and can be found in the [stage-n](http://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-) set of presets. Each year’s spec can be found in the [ESnnnn presets](http://babeljs.io/docs/plugins/#presets-official-presets).

-   [Learn ES2015](http://babeljs.io/learn-es2015/) If you haven’t been keeping up with recent ECMAScript advances, this will get you up to speed.

-   [Try Babel](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Creact%2Cstage-2&targets=&browsers=&builtIns=false&debug=false&code=const%20evens%20%3D%20%5B2%2C4%2C6%2C8%2C10%5D%3B%0Aconst%20odds%20%3D%20evens.map(v%20%3D%3E%20v%20%2B%201)%3B%0Aconst%20nums%20%3D%20evens.map((v%2C%20i)%20%3D%3E%20v%20%2B%20i)%3B) This is will let you type code on the left and see what babel transforms it to on the right. You can choose various plugins.


# Webpack

-   [Concepts](https://webpack.js.org/concepts/)


# Jest

Jest is a testing platform, developed as a monorepo of packages.

-   [Jest Snapshots and Beyond — Rogelio Guzman](https://www.youtube.com/watch?v=HAuXJVI_bUs) Covers Snapshots, Serializers and Jest’s platform/ecosystem.

-   [Building High-Quality JavaScript Tools](https://developers.facebook.com/videos/f8-2017/building-high-quality-javascript-tools/)


# Flow

-   [Flow Typing a React Codebase — Forbes Lindesay](https://www.youtube.com/watch?v=lk8o7ym29WM&index=9&list=PLNBNS7NRGKMHxfm0CcYNuINLdRw7r4a9M) A great introduction to static typing with Flow. Starts with basics, moves into Flow with React, and moves into advanced types with generics.

-   [The Flow Type System](https://flow.org/en/docs/lang/) Information about how Flow’s type system works. Covers soundness, completeness, and some more interesting comparisons to other language’s type systems.


# Prettier

[Prettier](https://github.com/prettier/prettier) is a pretty printer in the vein of [Wadler’s _\[pdf\]_](http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf). This effectively means being able to get rid of every _\[nit]_ in code review and lint rules relating to code layout and formatting. Code layout becomes something you never think about. If you’ve never worked in a language with a pretty printer like this before it’s sure to change your workflow for the better.


-   [A Prettier Printer](https://www.youtube.com/watch?v=hkfBvpEfWdA)

-   [JavaScript Code Formatting](https://www.youtube.com/watch?v=0Q4kUNx85_4)


# Yarn

Yarn is a newer package manager for JavaScript. The following links cover why yarn was created and what it’s useful for.

-   [Yarn: A new package manager for JavaScript](https://code.facebook.com/posts/1840075619545360)

-   [Building High-Quality JavaScript Tools](https://developers.facebook.com/videos/f8-2017/building-high-quality-javascript-tools/)

-   [The Yarn Workflow](https://yarnpkg.com/en/docs/yarn-workflow) Pay attention to the “additional reading” sections in this guide.