Skip to content

Translate "Virtual DOM" #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions content/docs/faq-internals.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
id: faq-internals
title: Virtual DOM and Internals
title: Виртуальный DOM
permalink: docs/faq-internals.html
layout: docs
category: FAQ
---

### What is the Virtual DOM? {#what-is-the-virtual-dom}
### Что такое виртуальный DOM? {#what-is-the-virtual-dom}

The virtual DOM (VDOM) is a programming concept where an ideal, or "virtual", representation of a UI is kept in memory and synced with the "real" DOM by a library such as ReactDOM. This process is called [reconciliation](/docs/reconciliation.html).
Виртуальный DOM (VDOM) – это концепция программирования, в которой идеальное или “виртуальное” представление пользовательского интерфейса хранится в памяти и синхронизируется с “реальной” DOM библиотекой, такой как ReactDOM. Этот процесс называется [согласованием](/docs/reconciliation.html).

This approach enables the declarative API of React: You tell React what state you want the UI to be in, and it makes sure the DOM matches that state. This abstracts out the attribute manipulation, event handling, and manual DOM updating that you would otherwise have to use to build your app.
Этот подход включает декларативный API React: вы указываете React, в каком состоянии должен находиться пользовательский интерфейс, и он проверяет, что DOM соответствует этому состоянию. Это абстрагирует манипуляции с атрибутами, обработку событий и ручное обновление DOM, которые, в противном случае, пришлось бы использовать для построения приложения.

Since "virtual DOM" is more of a pattern than a specific technology, people sometimes say it to mean different things. In React world, the term "virtual DOM" is usually associated with [React elements](/docs/rendering-elements.html) since they are the objects representing the user interface. React, however, also uses internal objects called "fibers" to hold additional information about the component tree. They may also be considered a part of "virtual DOM" implementation in React.
Поскольку виртуальный DOM – это скорее шаблон, чем конкретная технология, люди иногда говорят, что это означает разные вещи. В мире React термин “виртуальный DOM” обычно ассоциируется с [рендерингом элементов](/docs/rendering-elements.html), поскольку они являются объектами, представляющими пользовательский интерфейс. Однако React также использует внутренние объекты, называемые “файберами”, для хранения дополнительной информации о дереве компонентов. Их также можно считать частью реализации “виртуального DOM” в React.

### Is the Shadow DOM the same as the Virtual DOM? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
### Теневой DOM похож на виртуальный DOM? {#is-the-shadow-dom-the-same-as-the-virtual-dom}

No, they are different. The Shadow DOM is a browser technology designed primarily for scoping variables and CSS in web components. The virtual DOM is a concept implemented by libraries in JavaScript on top of browser APIs.
Нет, они совсем разные. Теневой DOM – это браузерная технология, предназначенная в основном для определения переменных и CSS в веб-компонентах. Виртуальный DOM – это концепция, реализованная библиотеками в JavaScript поверх API браузера.

### What is "React Fiber"? {#what-is-react-fiber}
### Что такое «React Fiber»? {#what-is-react-fiber}

Fiber is the new reconciliation engine in React 16. Its main goal is to enable incremental rendering of the virtual DOM. [Read more](https://github.com/acdlite/react-fiber-architecture).
Файбер – новый механизм согласования в React 16, основная цель которого использовать постепенный рендеринг виртуального DOM. [Узнать больше](https://github.com/acdlite/react-fiber-architecture).
6 changes: 4 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

module.exports = {
siteMetadata: {
title: 'React: JavaScript-библиотека для создания пользовательских интерфейсов',
title:
'React: JavaScript-библиотека для создания пользовательских интерфейсов',
siteUrl: 'https://reactjs.org',
rssFeedTitle: 'React',
rssFeedDescription: 'JavaScript-библиотека для создания пользовательских интерфейсов',
rssFeedDescription:
'JavaScript-библиотека для создания пользовательских интерфейсов',
},
mapping: {
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
Expand Down
5 changes: 3 additions & 2 deletions src/components/CodeEditor/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ class CodeEditor extends Component {
Не получилось загрузить Babel.
<br />
<br />
Это может быть связано с блокировщиком рекламы. Если вы используете один из них,
добавьте адрес reactjs.org в белый список, чтобы примеры кода заработали.
Это может быть связано с блокировщиком рекламы. Если вы используете
один из них, добавьте адрес reactjs.org в белый список, чтобы примеры
кода заработали.
</span>
);
} else if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ErrorDecoder/ErrorDecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function ErrorResult(props: {|code: ?string, msg: string|}) {
if (!code) {
return (
<p>
Когда происходит ошибка, вы получите ссылку на эту страницу.
На ней вы увидите полный текст конкретной ошибки.
Когда происходит ошибка, вы получите ссылку на эту страницу. На ней вы
увидите полный текст конкретной ошибки.
</p>
);
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/LayoutFooter/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
<MetaTitle onDark={true}>Дополнительно</MetaTitle>
<FooterLink to="/tutorial/tutorial.html">Введение</FooterLink>
<FooterLink to="/blog/">Блог</FooterLink>
<FooterLink to="/acknowledgements.html">
Благодарности
</FooterLink>
<FooterLink to="/acknowledgements.html">Благодарности</FooterLink>
<ExternalFooterLink
href="https://facebook.github.io/react-native/"
target="_blank"
Expand Down
3 changes: 2 additions & 1 deletion src/components/TitleAndMetaTags/TitleAndMetaTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import Helmet from 'react-helmet';
import React from 'react';

const defaultDescription = 'JavaScript-библиотека для создания пользовательских интерфейсов';
const defaultDescription =
'JavaScript-библиотека для создания пользовательских интерфейсов';

type Props = {
title: string,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class Home extends Component {
fontSize: 30,
},
}}>
JavaScript-библиотека для создания пользовательских интерфейсов
JavaScript-библиотека для создания пользовательских
интерфейсов
</p>
<Flex
valign="center"
Expand Down