Skip to content

Commit 8c8bc64

Browse files
authored
Merge pull request #337 from yugako/master
From the orbital height
2 parents cc01a6a + 95fdc85 commit 8c8bc64

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed
Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
# From the orbital height
1+
# З висоти орбітального польоту
22

3-
This section describes a set of modern standards for "web components".
3+
Ця секція описує набір сучасних стандартів для "веб компонентів".
44

5-
As of now, these standards are under development. Some features are well-supported and integrated into the modern HTML/DOM standard, while others are yet in draft stage. You can try examples in any browser, Google Chrome is probably the most up to date with these features. Guess, that's because Google fellows are behind many of the related specifications.
5+
Наразі, ці стандарти знаходяться в розробці. Деякі особливості зараз добре підтримуються та інтегровані у сучасний HTML/DOM стандарт, але деякі все ще у стадії чернетки. Ви можете погратись з прикладами у будь-якому браузері, але Google Chrome, мабуть, має найкращу підтримку. Скоріш за все це пов’язано з тим, що саме компанія Google стоїть за багатьма специфікаціями до веб компонентів.
66

7-
## What's common between...
7+
## Що спільного між...
88

9-
The whole component idea is nothing new. It's used in many frameworks and elsewhere.
9+
Загалом, компонентний підхід не є чимось новим. Це використовується у багатьох фреймворках.
1010

11-
Before we move to implementation details, take a look at this great achievement of humanity:
11+
Перед тим, як ми перейдемо до деталей реалізації, погляньмо на одне з найбільших досягнень людства:
1212

1313
![](satellite.jpg)
1414

15-
That's the International Space Station (ISS).
15+
Це Міжнародна космічна станція (МКС).
1616

17-
And this is how it's made inside (approximately):
17+
І це як вона зроблена всередині (приблизно):
1818

1919
![](satellite-expanded.jpg)
2020

21-
The International Space Station:
22-
- Consists of many components.
23-
- Each component, in its turn, has many smaller details inside.
24-
- The components are very complex, much more complicated than most websites.
25-
- Components are developed internationally, by teams from different countries, speaking different languages.
21+
Міжнародна космічна станція:
22+
- Складається з багатьох компонентів.
23+
- Кожен компонент своєю чергою складається з менших деталей всередині.
24+
- Компоненти є дуже складними, і набагато складніші ніж більшість вебсайтів.
25+
- Складові розроблялись командами з різних країн
2626

27-
...And this thing flies, keeps humans alive in space!
27+
...І ця штука літає, зберігаючи життя людей у космосі!
2828

29-
How are such complex devices created?
29+
Як саме було створено такі комплексні і складні пристрої?
3030

31-
Which principles could we borrow to make our development same-level reliable and scalable? Or, at least, close to it?
31+
Які принципи ми можемо запозичити, щоб зробити нашу розробку такою ж надійною та масштабованою? Або, принаймні, близькою до такої?
3232

33-
## Component architecture
33+
## Архітектура компонентів
3434

35-
The well known rule for developing complex software is: don't make complex software.
35+
Добре відоме правило розробки складного програмного забезпечення: не створюйте складне програмне забезпечення.
3636

37-
If something becomes complex -- split it into simpler parts and connect in the most obvious way.
37+
Якщо щось стає складним -- розділіть його на простіші частини й з'єднайте найбільш очевидним способом.
3838

39-
**A good architect is the one who can make the complex simple.**
39+
**Хороший архітектор - це той, хто може зробити складне простим**
4040

41-
We can split user interface into visual components: each of them has own place on the page, can "do" a well-described task, and is separate from the others.
41+
Ми можемо розділити інтерфейс користувача на візуальні компоненти: кожен з них має своє місце на сторінці, може "виконувати" своє призначення та існувати окремо від інших.
4242

43-
Let's take a look at a website, for example Twitter.
43+
Давайте поглянемо на веб-сайт, наприклад, Twitter.
4444

45-
It naturally splits into components:
45+
Він природним чином розбивається на компоненти:
4646

4747
![](web-components-twitter.svg)
4848

49-
1. Top navigation.
50-
2. User info.
51-
3. Follow suggestions.
52-
4. Submit form.
53-
5. (and also 6, 7) -- messages.
49+
1. Верхня навігація.
50+
2. Інформація про користувача.
51+
3. Список пропозицій.
52+
4. Поле для нового твіту.
53+
5. (а також 6, 7) -- твіти.
5454

55-
Components may have subcomponents, e.g. messages may be parts of a higher-level "message list" component. A clickable user picture itself may be a component, and so on.
55+
Компоненти можуть містити в собі інші компоненти, наприклад, повідомлення можуть бути частинами компоненти "списку повідомлень" вищого рівня. Зображення користувача, яке можна натиснути, може бути також компонентом.
5656

57-
How do we decide, what is a component? That comes from intuition, experience and common sense. Usually it's a separate visual entity that we can describe in terms of what it does and how it interacts with the page. In the case above, the page has blocks, each of them plays its own role, it's logical to make these components.
57+
Як ми визначаємо, що таке компонент? Все залежить від інтуїції, досвіду та здорового глузду. Зазвичай, це окрема візуальна сутність, яку ми можемо описати з точки зору того, що вона робить і як вона взаємодіє зі сторінкою. У наведеному вище випадку на сторінці є блоки, які відіграють свою роль. Отже, було б логічно розділити цю сторінку на компоненти.
5858

59-
A component has:
60-
- Its own JavaScript class.
61-
- DOM structure, managed solely by its class, outside code doesn't access it ("encapsulation" principle).
62-
- CSS styles, applied to the component.
63-
- API: events, class methods etc, to interact with other components.
59+
Компонент має:
60+
- Власний JavaScript клас.
61+
- Структуру DOM, яка керована виключно її класом, зовнішній код не має доступу до неї (принцип "інкапсуляції").
62+
- Стилі CSS, застосовані до компонента.
63+
- API: події, методи класу тощо для взаємодії з іншими компонентами.
6464

65-
Once again, the whole "component" thing is nothing special.
65+
Знову ж таки, весь "компонентний" підхід річ не нова і в ньому немає нічого особливого.
6666

67-
There exist many frameworks and development methodologies to build them, each with its own bells and whistles. Usually, special CSS classes and conventions are used to provide "component feel" -- CSS scoping and DOM encapsulation.
67+
Існує багато фреймворків і методологій розробки для їх побудови, кожна зі своїми "фічами". Зазвичай для забезпечення "відчуття компонентів" використовуються спеціальні класи та конвенції CSS -- область визначення CSS та інкапсуляція DOM.
6868

69-
"Web components" provide built-in browser capabilities for that, so we don't have to emulate them any more.
69+
"Веб компоненти" надають для цього вбудовані можливості браузера, тому нам більше не потрібно їх емулювати.
7070

71-
- [Custom elements](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements) -- to define custom HTML elements.
72-
- [Shadow DOM](https://dom.spec.whatwg.org/#shadow-trees) -- to create an internal DOM for the component, hidden from the others.
73-
- [CSS Scoping](https://drafts.csswg.org/css-scoping/) -- to declare styles that only apply inside the Shadow DOM of the component.
74-
- [Event retargeting](https://dom.spec.whatwg.org/#retarget) and other minor stuff to make custom components better fit the development.
71+
- [Custom elements](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements) -- для визначення власних HTML елементів.
72+
- [Shadow DOM](https://dom.spec.whatwg.org/#shadow-trees) -- для створення внутрішнього DOM для компонента, прихованого від інших.
73+
- [CSS Scoping](https://drafts.csswg.org/css-scoping/) -- щоб оголошувати стилі, які застосовуються лише всередині Shadow DOM компонента.
74+
- [Event retargeting](https://dom.spec.whatwg.org/#retarget) та інші незначні речі, щоб нестандартні компоненти краще відповідали розробці.
7575

76-
In the next chapter we'll go into details of "Custom Elements" -- the fundamental and well-supported feature of web components, good on its own.
76+
У наступному розділі ми детально розглянемо "нестандартні елементи" -- фундаментальну і добре підтримувану функцію веб компонентів, яка сама по собі хороша.

8-web-components/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Web components
1+
# Веб компоненти
2+
3+
Веб компоненти -- це набір стандартів для створення нестандартних HTML-елементів зі своїми властивостями й методами, інкапсульованим DOM і стилями.
24

3-
Web components is a set of standards to make self-contained components: custom HTML-elements with their own properties and methods, encapsulated DOM and styles.

0 commit comments

Comments
 (0)