Skip to content

Commit a3b520d

Browse files
authored
Merge pull request #9 from reactjs/master
Update from original
2 parents 8d47388 + 1f08793 commit a3b520d

File tree

141 files changed

+5498
-1138
lines changed

Some content is hidden

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

141 files changed

+5498
-1138
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**Если ваш пулреквест является исправлением бага, а не переводом, то сперва убедитесь, что проблема относится ТОЛЬКО к https://ru.reactjs.org, а не к https://reactjs.org.** Если это не так, то пулреквест следует открыть в родительском репозитории.
2+
13
<!--
24
Прежде чем создавать пулреквест, пожалуйста, прочтите полностью правила перевода по ссылке ниже и поправьте свой перевод:
35

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 3 deletions
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 <[email protected]>. 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

README.md

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,68 @@
11
# ru.reactjs.org
22

3-
This repo contains the source code and documentation powering [ru.reactjs.org](https://ru.reactjs.org/).
3+
Этот репозиторий содержит исходный код и содержимое сайта [ru.reactjs.org](https://ru.reactjs.org/).
44

5-
## Getting started
5+
## Начало
66

7-
### Prerequisites
7+
### Предварительные требования
88

99
1. Git
10-
1. Node: any 8.x version starting with 8.4.0 or greater
11-
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
12-
1. A fork of the repo (for any contributions)
13-
1. A clone of the [ru.reactjs.org repo](https://github.com/reactjs/ru.reactjs.org) on your local machine
10+
1. Node: любая версия 8.x, начиная с 8.4.0 или выше
11+
1. Yarn: Смотрите [сайт Yarn с инструкциями по установке](https://yarnpkg.com/lang/en/docs/install/)
12+
1. Сделать форк этого репозитория (для предложения изменений)
13+
1. Копия [репозитория ru.reactjs.org](https://github.com/reactjs/ru.reactjs.org) на вашем компьютере
1414

15-
### Installation
15+
### Установка
1616

17-
1. `cd ru.reactjs.org` to go into the project root
18-
1. `yarn` to install the website's npm dependencies
17+
1. `cd ru.reactjs.org` для перехода в директорию проекта
18+
1. `yarn` для установки npm-зависимостей проекта
1919

20-
### Running locally
20+
### Запуск проекта локально
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` для старта сервера в режиме разработки с поддержкой перезагрузки на лету (на основе [Gatsby](https://www.gatsbyjs.org))
23+
1. `open http://localhost:8000` откроет сайт в вашем браузере по умолчанию
2424

25-
## Contributing
25+
## Помощь проекту
2626

27-
### Guidelines
27+
### Рекомендации
2828

29-
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/ru.reactjs.org/blob/master/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.
29+
Документация разделена на несколько частей, с разными характером и целями. Если вы планируете написать больше, чем несколько фраз, вам может быть полезно ознакомиться с [рекомендациями для участия](https://github.com/reactjs/ru.reactjs.org/blob/master/CONTRIBUTING.md#guidelines-for-text) и его конкретными разделами.
3030

31-
### Create a branch
31+
### Создание ветки
3232

33-
1. `git checkout master` from any folder in your local `ru.reactjs.org` repository
34-
1. `git pull origin master` to ensure you have the latest main code
35-
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
33+
1. `git checkout master` из любой папки в вашей локальной копии репозитория `ru.reactjs.org`
34+
1. `git pull origin master`, чтобы убедиться, что у вас самая последняя версия кода
35+
1. `git checkout -b the-name-of-my-branch` (замените `the-name-of-my-branch` на подходящее имя) для создания ветки
3636

37-
### Make the change
37+
### Внесение изменений
3838

39-
1. Follow the "Running locally" instructions
40-
1. Save the files and check in the browser
41-
1. Changes to React components in `src` will hot-reload
42-
1. Changes to markdown files in `content` will hot-reload
43-
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
39+
1. Следуйте инструкциям из раздела «Запуск проекта локально»
40+
1. Сохраните файлы и проверьте в вашем браузере
41+
1. Изменения в React-компонентах внутри `src` применяются на лету
42+
1. Изменения в markdown-файлах внутри `content` применяются на лету
43+
1. При работе с плагинами может понадобится удаление папки `.cache` и перезапуск сервера
4444

45-
### Test the change
45+
### Проверка изменений
4646

47-
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
48-
1. Run `yarn check-all` from the project root. (This will run Prettier, ESLint, and Flow.)
47+
1. По возможности проверьте визуальные изменения во всех последних версиях распространённых браузеров: и настольных, и мобильных.
48+
1. Запустите `yarn check-all` из корня проекта. (Это запустит Prettier, ESLint и Flow.)
4949

50-
### Push it
50+
### Отправка изменений
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 "Мой текст"` (замените `Мой текст` на подходящее сообщение, например `Fix header logo on Android`) для сохранения ваших изменений
5353
1. `git push my-fork-name the-name-of-my-branch`
54-
1. Go to the [ru.reactjs.org repo](https://github.com/reactjs/ru.reactjs.org) and you should see recently pushed branches.
55-
1. Follow GitHub's instructions.
56-
1. If possible, include screenshots of visual changes. A Netlify build will also be automatically created once you make your PR so other people can see your change.
54+
1. Перейдите на [страницу репозитория ru.reactjs.org](https://github.com/reactjs/ru.reactjs.org) — вы должны увидеть вашу веткy.
55+
1. Следуйте инструкциям на GitHub.
56+
1. По возможности добавьте скриншот с наглядными изменениями. Как только вы сделаете PR, автоматически будет создан Netlify-билд, так что люди смогут посмотреть ваши изменения.
5757

58-
## Translation
58+
## Перевод
5959

60-
If you are interested in translating `ru.reactjs.org`, please see the current translation efforts at [isreacttranslatedyet.com](https://www.isreacttranslatedyet.com/).
60+
Если вы заинтересованы в переводе `reactjs.org`, ознакомьтесь с текущим прогрессом перевода на [isreacttranslatedyet.com](https://www.isreacttranslatedyet.com/).
6161

62-
If your language does not have a translation and you would like to create one, please follow the instructions at [reactjs.org Translations](https://github.com/reactjs/reactjs.org-translation#reactjsorg-translation).
62+
## Решение проблем
6363

64-
## Troubleshooting
64+
- `yarn reset` для очистки локального кеша
6565

66-
- `yarn reset` to clear the local cache
66+
## Лицензия
6767

68-
## License
69-
Content submitted to [ru.reactjs.org](https://ru.reactjs.org/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/open-source-explorer/reactjs.org/blob/master/LICENSE-DOCS.md) file.
68+
Контент на [ru.reactjs.org](https://ru.reactjs.org/) распространяется по лицензии CC-BY-4.0, как указано в файле [LICENSE-DOCS.md](https://github.com/open-source-explorer/reactjs.org/blob/master/LICENSE-DOCS.md).

TRANSLATION.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object).
235235
| props | пропсы *(мн. ч.)* |
236236
| production | продакшен |
237237
| production mode | продакшен-режим |
238+
| profiling | профилирование |
239+
| Profiler | Profiler *(если имеется в виду компонент Profiler)*; профилировщик *(если имеется в виду инструмент для профилирования)*
238240
| React | React |
239241
| React element | React-элемент, элемент React |
240242
| reconciliation | согласование |
@@ -247,8 +249,9 @@ React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object).
247249
| re-render(ing) | (по контексту) рендер, повторный рендер, последующий рендер, отрендерить снова |
248250
| render prop | рендер-проп *(ед. ч.)* |
249251
| render props | рендер-пропсы *(мн. ч.)* |
250-
| reuse | повторное использование, переиспользование |
252+
| reuse | повторное использование |
251253
| (previous/next) section | (предыдущая/следующая) глава *(только в разделе Основные понятия)* |
254+
| Set of interactions | Множество «взаимодействий»
252255
| shallow | поверхностное (сравнение, равенство), поверхностный (рендеринг) |
253256
| side effect | побочный эффект |
254257
| snapshot | снимок |

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

Lines changed: 1 addition & 1 deletion
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

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

Lines changed: 1 addition & 1 deletion
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

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

Lines changed: 1 addition & 1 deletion
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.

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

Lines changed: 10 additions & 1 deletion
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`.

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

Lines changed: 1 addition & 1 deletion
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.

0 commit comments

Comments
 (0)