Skip to content

Commit da267f7

Browse files
authored
Merge branch 'master' into web-components
2 parents e440d91 + a5f3ccd commit da267f7

File tree

105 files changed

+3101
-1604
lines changed

Some content is hidden

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

105 files changed

+3101
-1604
lines changed

Diff for: CODE_OF_CONDUCT.md

+74-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
11
# Code of Conduct
22

3-
Facebook has adopted a Code of Conduct that we expect project participants to adhere to.
4-
Please read the [full text](https://code.fb.com/codeofconduct/)
5-
so that you can understand what actions will and will not be tolerated.
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <opensource-conduct@fb.com>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The documentation is divided into several sections with a different tone and pur
4949

5050
### Push it
5151

52-
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fixed header logo on Android`) to stage and commit your changes
52+
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
5353
1. `git push my-fork-name the-name-of-my-branch`
5454
1. Go to the [id.reactjs.org repo](https://github.com/reactjs/id.reactjs.org) and you should see recently pushed branches.
5555
1. Follow GitHub's instructions.

Diff for: TRANSLATION.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Referensi panduan penulisan Bahasa Indonesia lainnya yang dapat digunakan adalah
2828

2929
* [Pedoman Umum Ejaan Bahasa Indonesia (PUEBI)](https://puebi.readthedocs.io/en/latest/)
3030
* [Kamus Besar Bahasa Indonesia (KBBI)](https://kbbi.kemdikbud.go.id/)
31+
* [RSNI3 8527:2018 - Glosarium Istilah Teknologi Informasi](https://github.com/jk8s/sig-docs-id/raw/master/resources/RSNI-glossarium.pdf)
3132

3233
### *Heading ID*
3334

Diff for: content/blog/2014-09-24-testing-flux-applications.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The first steps toward working with Jest are as follows:
1717

1818
1. Get the module dependencies for the application installed by running `npm install`.
1919
2. Create a directory `__tests__/` with a test file, in this case TodoStore-test.js
20-
3. Run `npm install jest-cli save-dev`
20+
3. Run `npm install jest-cli --save-dev`
2121
4. Add the following to your package.json
2222

2323
```javascript

Diff for: content/blog/2015-09-02-new-react-developer-tools.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It contains a handful of new features, including:
2020

2121
## Installation {#installation}
2222

23-
Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Mozilla Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.
23+
Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.
2424

2525
If you already have the Chrome extension installed, it should autoupdate within the next week. You can also head to `chrome://extensions` and click "Update extensions now" if you'd like to get the new version today. If you installed the devtools beta, please remove it and switch back to the version from the store to make sure you always get the latest updates and bug fixes.
2626

Diff for: content/blog/2017-07-26-error-handling-in-react-16.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ Error boundaries preserve the declarative nature of React, and behave as you wou
111111

112112
React 15 included a very limited support for error boundaries under a different method name: `unstable_handleError`. This method no longer works, and you will need to change it to `componentDidCatch` in your code starting from the first 16 beta release.
113113

114-
For this change, we’ve provided [a codemod](https://github.com/reactjs/react-codemod#error-boundaries) to automatically migrate your code.
114+
For this change, we’ve provided a [codemod](https://github.com/reactjs/react-codemod#error-boundaries) to automatically migrate your code.

Diff for: content/blog/2018-03-27-update-on-async-rendering.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ These lifecycle methods have often been misunderstood and subtly misused; furthe
2525

2626
We maintain over 50,000 React components at Facebook, and we don't plan to rewrite them all immediately. We understand that migrations take time. We will take the gradual migration path along with everyone in the React community.
2727

28+
If you don't have the time to migrate or test these components, we recommend running a ["codemod"](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) script that renames them automatically:
29+
30+
```bash
31+
cd your_project
32+
npx react-codemod rename-unsafe-lifecycles
33+
```
34+
35+
Learn more about this codemod on the [16.9.0 release post.](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#renaming-unsafe-lifecycle-methods)
36+
2837
---
2938

3039
## Migrating from Legacy Lifecycles {#migrating-from-legacy-lifecycles}
@@ -134,7 +143,7 @@ Here is an example of a component that uses the legacy `componentWillReceiveProp
134143

135144
Although the above code is not problematic in itself, the `componentWillReceiveProps` lifecycle is often mis-used in ways that _do_ present problems. Because of this, the method will be deprecated.
136145

137-
As of version 16.3, the recommended way to update `state` in response to `props` changes is with the new `static getDerivedStateFromProps` lifecycle. (That lifecycle is called when a component is created and each time it receives new props):
146+
As of version 16.3, the recommended way to update `state` in response to `props` changes is with the new `static getDerivedStateFromProps` lifecycle. It is called when a component is created and each time it re-renders due to changes to props or state:
138147
`embed:update-on-async-rendering/updating-state-from-props-after.js`
139148

140149
You may notice in the example above that `props.currentRow` is mirrored in state (as `state.lastRow`). This enables `getDerivedStateFromProps` to access the previous props value in the same way as is done in `componentWillReceiveProps`.

Diff for: content/blog/2018-10-01-create-react-app-v2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Here's a short summary of what's new in this release:
2525
* 🃏 We updated to [Jest 23](https://jestjs.io/blog/2018/05/29/jest-23-blazing-fast-delightful-testing.html), which includes an [interactive mode](https://jestjs.io/blog/2018/05/29/jest-23-blazing-fast-delightful-testing#interactive-snapshot-mode) for reviewing snapshots.
2626
* 💄 We added [PostCSS](https://preset-env.cssdb.org/features#stage-3) so you can use new CSS features in old browsers.
2727
* 💎 You can use [Apollo](https://github.com/leoasis/graphql-tag.macro#usage), [Relay Modern](https://github.com/facebook/relay/pull/2171#issuecomment-411459604), [MDX](https://github.com/facebook/create-react-app/issues/5149#issuecomment-425396995), and other third-party [Babel Macros](https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros) transforms.
28-
* 🌠 You can now [import an SVG as a React component](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-svgs), and use it in JSX.
28+
* 🌠 You can now [import an SVG as a React component](https://facebook.github.io/create-react-app/docs/adding-images-fonts-and-files#adding-svgs), and use it in JSX.
2929
* 🐈 You can try the experimental [Yarn Plug'n'Play mode](https://github.com/yarnpkg/rfcs/pull/101) that removes `node_modules`.
3030
* 🕸 You can now [plug your own proxy implementation](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#configuring-the-proxy-manually) in development to match your backend API.
3131
* 🚀 You can now use [packages written for latest Node versions](https://github.com/sindresorhus/ama/issues/446#issuecomment-281014491) without breaking the build.

Diff for: content/blog/2018-11-27-react-16-roadmap.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ author: [gaearon]
44
---
55

66
You might have heard about features like "Hooks", "Suspense", and "Concurrent Rendering" in the previous blog posts and talks. In this post, we'll look at how they fit together and the expected timeline for their availability in a stable release of React.
7+
8+
> An Update from August, 2019
9+
>
10+
> You can find an update to this roadmap in the [React 16.9 release blog post](/blog/2019/08/08/react-v16.9.0.html#an-update-to-the-roadmap).
11+
712

813
## tl;dr {#tldr}
914

Diff for: content/blog/2019-02-06-react-v16.8.0.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Even while Hooks were in alpha, the React community created many interesting [ex
5050

5151
## Testing Hooks {#testing-hooks}
5252

53-
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)'s `render` and `fireEvent` utilities do this).
53+
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://testing-library.com/react)'s `render` and `fireEvent` utilities do this).
5454

5555
For example, the counter example from [this page](/docs/hooks-effect.html) can be tested like this:
5656

@@ -95,7 +95,7 @@ The calls to `act()` will also flush the effects inside of them.
9595

9696
If you need to test a custom Hook, you can do so by creating a component in your test, and using your Hook from it. Then you can test the component you wrote.
9797

98-
To reduce the boilerplate, we recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to encourage writing tests that use your components as the end users do.
98+
To reduce the boilerplate, we recommend using [`react-testing-library`](https://testing-library.com/react) which is designed to encourage writing tests that use your components as the end users do.
9999

100100
## Thanks {#thanks}
101101

@@ -140,10 +140,10 @@ Assuming you already have ESLint installed, run:
140140

141141
```sh
142142
# npm
143-
npm install eslint-plugin-react-hooks@next --save-dev
143+
npm install eslint-plugin-react-hooks --save-dev
144144

145145
# yarn
146-
yarn add eslint-plugin-react-hooks@next --dev
146+
yarn add eslint-plugin-react-hooks --dev
147147
```
148148

149149
Then add it to your ESLint configuration:

Diff for: content/blog/2019-02-23-is-react-translated-yet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In the past, React community members have created unofficial translations for [C
2323

2424
If you would like to help out on a current translation, check out the [Languages](/languages) page and click on the "Contribute" link for your language.
2525

26-
Can't find your language? If you'd like to maintain your langauge's translation fork, follow the instructions in the [translation repo](https://github.com/reactjs/reactjs.org-translation#starting-a-new-translation)!
26+
Can't find your language? If you'd like to maintain your language's translation fork, follow the instructions in the [translation repo](https://github.com/reactjs/reactjs.org-translation#starting-a-new-translation)!
2727

2828
## Backstory {#backstory}
2929

@@ -39,7 +39,7 @@ This approach appealed to us for several reasons:
3939
* It encouraged active maintainers for each repo to ensure quality.
4040
* Contributors already understand GitHub as a platform and are motivated to contribute directly to the React organization.
4141

42-
We started of with an initial trial period of three languages: Spanish, Japanese, and Simplified Chinese. This allowed us to work out any kinks in our process and make sure future translations are set up for success. I wanted to give the translation teams freedom to choose whatever tools they felt comfortable with. The only requirement is a [checklist](https://github.com/reactjs/reactjs.org-translation/blob/master/PROGRESS.template.md) that outlines the order of importance for translating pages.
42+
We started off with an initial trial period of three languages: Spanish, Japanese, and Simplified Chinese. This allowed us to work out any kinks in our process and make sure future translations are set up for success. I wanted to give the translation teams freedom to choose whatever tools they felt comfortable with. The only requirement is a [checklist](https://github.com/reactjs/reactjs.org-translation/blob/master/PROGRESS.template.md) that outlines the order of importance for translating pages.
4343

4444
After the trial period, we were ready to accept more languages. I created [a script](https://github.com/reactjs/reactjs.org-translation/blob/master/scripts/create.js) to automate the creation of the new language repo, and a site, [Is React Translated Yet?](https://isreacttranslatedyet.com), to track progress on the different translations. We started *10* new translations on our first day alone!
4545

0 commit comments

Comments
 (0)