Skip to content

Commit 5f404d9

Browse files
rachelnaborsgaearonsylwiavargasleborazvangradinar
committed
Initial check-in of new React docs and website
Co-authored-by: Dan Abramov <dan.abramov@me.com> Co-authored-by: Sylwia Vargas <sylwia.vargas@gmail.com> Co-authored-by: Dan Lebowitz <dan.lebo@me.com> Co-authored-by: Razvan Gradinar <grazvan@fb.com> Co-authored-by: Jared Palmer <jared@palmer.net> Co-authored-by: Dane Grant <danecando@gmail.com> Co-authored-by: Dustin Goodman <dustin.s.goodman@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Maggie Appleton <maggie.fm.appleton@gmail.com> Co-authored-by: Alex Moldovan <alex.n.moldovan@gmail.com> Co-authored-by: Ives van Hoorne <ives.v.h@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com>
1 parent b62e447 commit 5f404d9

File tree

1,045 files changed

+65778
-62329
lines changed

Some content is hidden

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

1,045 files changed

+65778
-62329
lines changed

.babelrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_HJ_SITE_ID = 2411683
2+
NEXT_PUBLIC_HJ_SITE_V = 6

.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_HJ_SITE_ID = 2411651
2+
NEXT_PUBLIC_HJ_SITE_V = 6

.eslintignore

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
node_modules/*
2-
3-
# Ignore markdown files and examples
4-
content/*
5-
6-
# Ignore built files
7-
public/*
8-
9-
# Ignore examples
10-
examples/*
1+
scripts
2+
plugins
3+
next.config.js

.eslintrc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"extends": [
3-
"fbjs"
2+
"extends": ["react-app", "plugin:jsx-a11y/recommended"],
3+
"plugins": ["jsx-a11y"],
4+
"overrides": [
5+
{
6+
"files": ["**/*.ts?(x)"],
7+
"rules": {
8+
"jsx-a11y/anchor-is-valid": 0
9+
}
10+
}
411
],
5-
"plugins": [
6-
"prettier",
7-
"react"
8-
],
9-
"parser": "babel-eslint",
10-
"rules": {
11-
"relay/graphql-naming": 0,
12-
"max-len": 0
13-
},
1412
"env": {
1513
"node": true,
16-
"browser": true
14+
"commonjs": true,
15+
"browser": true,
16+
"es6": true
1717
}
1818
}

.flowconfig

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/nodejs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
11+
name: Lint on node 12.x and ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js 12.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12.x
19+
20+
- name: Install deps and build (with cache)
21+
uses: bahmutov/npm-install@v1
22+
23+
- name: Lint codebase
24+
run: yarn ci-check

.gitignore

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
1-
.cache
2-
.DS_STORE
3-
.idea
4-
node_modules
5-
public
6-
yarn-error.log
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/pages/docs/**/*.md
2+
src/pages/blog/**/*.md

.prettierrc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"bracketSpacing": false,
3-
"jsxBracketSameLine": true,
4-
"parser": "flow",
5-
"printWidth": 80,
63
"singleQuote": true,
7-
"trailingComma": "all"
8-
}
4+
"jsxBracketSameLine": true,
5+
"trailingComma": "es5",
6+
"printWidth": 80
7+
}

CONTRIBUTING.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,9 @@ This is a [good summary](https://medium.com/@kvosswinkel/coding-like-a-journalis
1818

1919
The documentation is divided into sections to cater to different learning styles and use cases. When editing an article, try to match the surrounding text in tone and style. When creating a new article, try to match the tone of the other articles in the same section. Learn about the motivation behind each section below.
2020

21-
**[Installation](https://reactjs.org/docs/getting-started.html)** gives an overview of the docs, and demonstrates two different ways to use it: either as a simple `<script>` tag on the page, or as part of a complex JavaScript toolchain.
21+
**[Learn React](https://beta.reactjs.org/learn)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Learn React also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them.
2222

23-
**[Tutorial](https://reactjs.org/tutorial/tutorial.html)** is relatively informal, and is designed for people who prefer a hands-on approach to learning, and can tolerate skipping theory in favor of practice. Its goal is to give the reader a feel for a typical React workflow rather than to explain fundamentals in detail. Here we focus on *what* to do and spend less time on *how* or *why* we did it. It is extremely important to do a lot of hand-holding and unambiguously describe every single change. It should be possible for a beginner to mechanically follow every instruction, and still get to a working tic-tac-toe game.
24-
25-
**[Main Concepts](https://reactjs.org/docs/hello-world.html)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Main Concepts builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Main Concepts article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Main Concepts also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them. This is, for example, why we introduce elements before components. Resist adding too much detail to Main Concepts articles. They intentionally don't cover all corner cases, and focus on establishing firm foundations.
26-
27-
**[Advanced Guides](https://reactjs.org/docs/jsx-in-depth.html)** are deep dives into topics that aren't essential for a beginner developer but that everyone bumps into sooner or later. They don't have a specific order, and target more experienced developers. If you have a set of recipes fitting a particular use case, and those recipes aren't opinionated (most React users would agree on them), this is the place to add them.
28-
29-
**[Reference](https://reactjs.org/docs/react-api.html)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Main Concepts or Advanced Guides should be mentioned in the reference documentation for the corresponding APIs.
30-
31-
**[Contributing](https://reactjs.org/docs/how-to-contribute.html)** should stay up-to-date and be friendly to relatively experienced developers.
32-
33-
**[FAQ](https://reactjs.org/docs/faq-ajax.html)** has a more conversational tone than the other sections. Here, it's fine to include some content that's not primarily concerned with React, as long as React users are overwhelmingly interested in it (e.g. recommendations on directory structure). It's also okay to show more than a single way to do something in the FAQ, and briefly discuss the tradeoffs. The FAQ prioritizes unblocking people with a working solution over explaining concepts in detail, and can be more opinionated than the rest of the docs, even providing popular library recommendations.
23+
**[API Reference](https://reactjs.org/reference)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
3424

3525
**Try to follow your own instructions.**
3626

@@ -106,7 +96,7 @@ They tell the website to highlight specific lines.
10696
You can highlight a single line:
10797

10898
````
109-
```js{2}
99+
```js {2}
110100
function hello() {
111101
// this line will get highlighted
112102
}
@@ -116,7 +106,7 @@ function hello() {
116106
A range of lines:
117107

118108
````
119-
```js{2-4}
109+
```js {2-4}
120110
function hello() {
121111
// these lines
122112
// will get
@@ -128,7 +118,7 @@ function hello() {
128118
Or even multiple ranges:
129119

130120
````
131-
```js{2-4,6}
121+
```js {2-4,6}
132122
function hello() {
133123
// these lines
134124
// will get

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ This repo contains the source code and documentation powering [reactjs.org](http
1919

2020
### Running locally
2121

22-
1. `yarn dev` to start the hot-reloading development server (powered by [Gatsby](https://www.gatsbyjs.org))
23-
1. `open http://localhost:8000` to open the site in your favorite browser
22+
1. `yarn dev` to start the development server (powered by [Next.js](https://nextjs.org/))
23+
1. `open http://localhost:3000` to open the site in your favorite browser
2424

2525
## Contributing
2626

colors.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
module.exports = {
6+
// Text colors
7+
primary: '#23272F', // gray-90
8+
'primary-dark': '#F6F7F9', // gray-5
9+
secondary: '#404756', // gray-70
10+
'secondary-dark': '#EBECF0', // gray-10
11+
link: '#087EA4', // blue-50
12+
'link-dark': '#149ECA', // blue-40
13+
syntax: '#EBECF0', // gray-10
14+
wash: '#FFFFFF',
15+
'wash-dark': '#23272F', // gray-90
16+
card: '#F6F7F9', // gray-05
17+
'card-dark': '#343A46', // gray-80
18+
highlight: '#E6F7FF', // blue-10
19+
'highlight-dark': 'rgba(88,175,223,.1)',
20+
border: '#EBECF0', // gray-10
21+
'border-dark': '#343A46', // gray-80
22+
'secondary-button': '#EBECF0', // gray-10
23+
'secondary-button-dark': '#404756', // gray-70
24+
25+
// Gray
26+
'gray-90': '#23272F',
27+
'gray-80': '#343A46',
28+
'gray-70': '#404756',
29+
'gray-60': '#4E5769',
30+
'gray-50': '#5E687E', // unused
31+
'gray-40': '#78839B',
32+
'gray-30': '#99A1B3',
33+
'gray-20': '#BCC1CD',
34+
'gray-10': '#EBECF0',
35+
'gray-5': '#F6F7F9',
36+
37+
// Blue
38+
'blue-60': '#045975',
39+
'blue-50': '#087EA4',
40+
'blue-40': '#149ECA', // Brand Blue
41+
'blue-30': '#58C4DC', // unused
42+
'blue-20': '#ABE2ED',
43+
'blue-10': '#E6F7FF', // todo: doesn't match illustrations
44+
'blue-5': '#E6F6FA',
45+
46+
// Yellow
47+
'yellow-60': '#B65700',
48+
'yellow-50': '#C76A15',
49+
'yellow-40': '#DB7D27', // unused
50+
'yellow-30': '#FABD62', // unused
51+
'yellow-20': '#FCDEB0', // unused
52+
'yellow-10': '#FDE7C7',
53+
'yellow-5': '#FEF5E7',
54+
55+
// Purple
56+
'purple-60': '#2B3491', // unused
57+
'purple-50': '#575FB7',
58+
'purple-40': '#6B75DB',
59+
'purple-30': '#8891EC',
60+
'purple-20': '#C3C8F5', // unused
61+
'purple-10': '#E7E9FB',
62+
'purple-5': '#F3F4FD',
63+
64+
// Green
65+
'green-60': '#2B6E62',
66+
'green-50': '#388F7F',
67+
'green-40': '#44AC99',
68+
'green-30': '#7FCCBF',
69+
'green-20': '#ABDED5',
70+
'green-10': '#E5F5F2',
71+
'green-5': '#F4FBF9',
72+
73+
// RED
74+
'red-60': '#712D28',
75+
'red-50': '#A6423A', // unused
76+
'red-40': '#C1554D',
77+
'red-30': '#D07D77',
78+
'red-20': '#E5B7B3', // unused
79+
'red-10': '#F2DBD9', // unused
80+
'red-5': '#FAF1F0',
81+
82+
// MISC
83+
'code-block': '#99a1b30f', // gray-30 @ 6%
84+
'gradient-blue': '#58C4DC', // Only used for the landing gradient for now.
85+
github: {
86+
highlight: '#fffbdd',
87+
},
88+
};

content/404.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)