Skip to content

[READY TO MERGE] Russian translation #13

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 55 commits into from
May 6, 2017
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1f3bc44
Merge pull request #1 from vuejs/master
Alex-Sokolov Apr 30, 2017
df74007
[RU] init commit
Alex-Sokolov Apr 30, 2017
576b55f
langs.md add russian
Alex-Sokolov Apr 30, 2017
390a68f
Merge pull request #2 from Alex-Sokolov/master
Alex-Sokolov Apr 30, 2017
3e1fe7f
basic.md переведён
Alex-Sokolov Apr 30, 2017
351fe05
basic.md тире и переведены примеры
Alex-Sokolov Apr 30, 2017
fd4d4b2
universal.md переведён
Alex-Sokolov Apr 30, 2017
cdfa2d3
structure.md переведён
Alex-Sokolov Apr 30, 2017
949bb2e
routing.md переведён
Alex-Sokolov Apr 30, 2017
ea2f121
data.md переведён
Alex-Sokolov Apr 30, 2017
89c7236
hydration.md переведён
Alex-Sokolov Apr 30, 2017
20d8815
bundle-renderer.md переведён
Alex-Sokolov Apr 30, 2017
444c685
build-config.md в процессе
Alex-Sokolov Apr 30, 2017
b009eab
Merge pull request #4 from vuejs/master
Alex-Sokolov Apr 30, 2017
58eac4b
Merge remote-tracking branch 'upstream/master'
Alex-Sokolov Apr 30, 2017
cc8abba
bundle-renderer.md исправлена ссылка
Alex-Sokolov Apr 30, 2017
9c46545
build-config.md переведён
Alex-Sokolov Apr 30, 2017
acacb2b
css.md переведён
Alex-Sokolov Apr 30, 2017
ce48c91
head.md переведён
Alex-Sokolov Apr 30, 2017
7ab8c11
cache.md переведён
Alex-Sokolov Apr 30, 2017
169144d
streaming.md переведён
Alex-Sokolov Apr 30, 2017
7825051
SUMMARY.md допереведён
Alex-Sokolov Apr 30, 2017
924e1f8
api.md начат перевод
Alex-Sokolov Apr 30, 2017
61828fc
build-config.md доработки
Alex-Sokolov May 1, 2017
2ec9e03
bundle-rendered.md доработки
Alex-Sokolov May 1, 2017
37e3712
api.md допереведён
Alex-Sokolov May 1, 2017
ebdec18
Merge pull request #5 from vuejs/master
Alex-Sokolov May 1, 2017
018b10d
api.md исправлены опечатки
Alex-Sokolov May 1, 2017
a9a3b79
basic.md исправлены опечатки
Alex-Sokolov May 1, 2017
d63a695
build-config.md исправлены опечатки
Alex-Sokolov May 1, 2017
5885df8
bundle-renderer.md исправлены опечатки
Alex-Sokolov May 1, 2017
4db01fb
caching.md исправлены опечатки
Alex-Sokolov May 1, 2017
eae6ee2
css.md исправлены опечатки
Alex-Sokolov May 1, 2017
38a3681
data.md исправлены опечатки
Alex-Sokolov May 1, 2017
a4cd8bc
head.md исправлены опечатки
Alex-Sokolov May 1, 2017
be1b2d8
hydration.md исправлены опечатки
Alex-Sokolov May 1, 2017
b12e70f
routing.md исправлены опечатки
Alex-Sokolov May 1, 2017
02a1fc0
streaming.md исправлены опечатки
Alex-Sokolov May 1, 2017
89f91f4
structure.md исправлены опечатки
Alex-Sokolov May 1, 2017
b096bb4
universal.md исправлены опечатки
Alex-Sokolov May 1, 2017
031dc62
Merge pull request #3 from Alex-Sokolov/master
Alex-Sokolov May 1, 2017
90e8ff6
Merge pull request #6 from vuejs/master
Alex-Sokolov May 2, 2017
03fd580
api.md доработки к 2.3.1
Alex-Sokolov May 2, 2017
0a7d4fe
build-config.md доработки к 2.3.1
Alex-Sokolov May 2, 2017
58dee17
bundle-renderer.md доработки к 2.3.1
Alex-Sokolov May 2, 2017
b7fc492
Merge pull request #7 from Alex-Sokolov/master
Alex-Sokolov May 2, 2017
f3f8407
head.md доработки
Alex-Sokolov May 2, 2017
8713a38
Merge pull request #8 from Alex-Sokolov/master
Alex-Sokolov May 2, 2017
db6859d
routing.md исправлен пример
Alex-Sokolov May 3, 2017
10b3c10
Merge pull request #9 from Alex-Sokolov/master
Alex-Sokolov May 3, 2017
6a50a75
README.md переведён
Alex-Sokolov May 6, 2017
511820a
Merge pull request #10 from Alex-Sokolov/master
Alex-Sokolov May 6, 2017
e924c00
Исправления очепяток
simplesmiler May 6, 2017
1e68710
Стилистические исправления
simplesmiler May 6, 2017
ea5db24
Merge pull request #11 from simplesmiler/master
Alex-Sokolov May 6, 2017
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
1 change: 1 addition & 0 deletions LANGS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* [English](en/)
* [Русский](ru/)
50 changes: 50 additions & 0 deletions ru/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Vue.js Server-Side Rendering Guide

> **Note:** this guide requires the following minimum versions of Vue and supporting libraries:
> - vue & vue-server-renderer >= 2.3.0
> - vue-router >= 2.5.0
> - vue-loader >= 12.0.0 & vue-style-loader >= 3.0.0

> If you have previously used Vue 2.2 with SSR, you will notice that the recommended code structure is now [a bit different](./structure.md) (with the new [runInNewContext](./api.md#runinnewcontext) option set to `false`). Your existing app should continue to work, but it's recommended to migrate to the new recommendations.

## What is Server-Side Rendering (SSR)?

Vue.js is a framework for building client-side applications. By default, Vue components produce and manipulate DOM in the browser as output. However, it is also possible to render the same components into HTML strings on the server, send them directly to the browser, and finally "hydrate" the static markup into a fully interactive app on the client.

A server-rendered Vue.js app can also be considered "isomorphic" or "universal", in the sense that the majority of your app's code runs on both the server **and** the client.

## Why SSR?

Compared to a traditional SPA (Single-Page Application), the advantage of SSR primarily lies in:

- Better SEO, as the search engine crawlers will directly see the fully rendered page.

Note that as of now, Google and Bing can index synchronous JavaScript applications just fine. Synchronous being the key word there. If your app starts with a loading spinner, then fetches content via Ajax, the crawler will not wait for you to finish. This means if you have content fetched asynchronously on pages where SEO is important, SSR might be necessary.

- Faster time-to-content, especially on slow internet or slow devices. Server-rendered markup doesn't need to wait until all JavaScript has been downloaded and executed to be displayed, so your user will see a fully-rendered page sooner. This generally results in better user experience, and can be critical for applications where time-to-content is directly associated with conversion rate.

There are also some trade-offs to consider when using SSR:

- Development constraints. Browser-specific code can only be used inside certain lifecycle hooks; some external libraries may need special treatment to be able to run in a server-rendered app.

- More involved build setup and deployment requirements. Unlike a fully static SPA that can be deployed on any static file server, a server-rendered app requires an environment where a Node.js server can run.

- More server-side load. Rendering a full app in Node.js is obviously going to be more CPU-intensive than just serving static files, so if you expect high traffic, be prepared for corresponding server load and wisely employ caching strategies.

Before using SSR for your app, the first question you should ask it whether you actually need it. It mostly depends on how important time-to-content is for your app. For example, if you are building an internal dashboard where an extra few hundred milliseconds on initial load doesn't matter that much, SSR would be an overkill. However, in cases where time-to-content is absolutely critical, SSR can help you achieve the best possible initial load performance.

## SSR vs Prerendering

If you're only investigating SSR to improve the SEO of a handful of marketing pages (e.g. `/`, `/about`, `/contact`, etc), then you probably want __prerendering__ instead. Rather than using a web server to compile HTML on-the-fly, prerendering simply generates static HTML files for specific routes at build time. The advantage is setting up prerendering is much simpler and allows you to keep your frontend as a fully static site.

If you're using Webpack, you can easily add prerendering with the [prerender-spa-plugin](https://github.com/chrisvfritz/prerender-spa-plugin). It's been extensively tested with Vue apps - and in fact, [the creator](https://github.com/chrisvfritz) is a member of the Vue core team.

## About This Guide

This guide is focused on server-rendered Single-Page Applications using Node.js as the server. Mixing Vue SSR with other backend setups is a topic of its own and is not covered in this guide.

This guide will be very in-depth and assumes you are already familiar with Vue.js itself, and have decent working knowledge of Node.js and webpack. If you prefer a higher-level solution that provides a smooth out-of-the-box experience, you should probably give [Nuxt.js](http://nuxtjs.org/) a try. It's built upon the same Vue stack but abstracts away a lot of the boilerplate, and provides some extra features such as static site generation. However, it may not suit your use case if you need more direct control of your app's structure. Regardless, it would still be beneficial to read through this guide to better understand how things work together.

As you read along, it would be helpful to refer to the official [HackerNews Demo](https://github.com/vuejs/vue-hackernews-2.0/), which makes use of most of the techniques covered in this guide.

Finally, note that the solutions in this guide are not definitive - we've found them to be working well for us, but that doesn't mean they cannot be improved. They might get revised in the future - and feel free to contribute by submitting pull requests!
27 changes: 27 additions & 0 deletions ru/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- [Использование](basic.md)
- [Написание универсального кода](universal.md)
- [Структура исходного кода](structure.md)
- [Маршрутизация и разделение кода](routing.md)
- [Предзагрузка данных и состояния](data.md)
- [Гидратация клиентской части](hydration.md)
- [Представляем Bundle Renderer](bundle-renderer.md)
- [Конфигурация сборки](build-config.md)
- [Управление CSS](css.md)
- [Управление заголовочными тегами (head)](head.md)
- [Кэширование](caching.md)
- [Стриминг](streaming.md)
- [Справочник API](api.md)
- [createRenderer](api.md#createrendereroptions)
- [createBundleRenderer](api.md#createbundlerendererbundle-options)
- [Класс: Renderer](api.md#class-renderer)
- [Класс: BundleRenderer](api.md#class-bundlerenderer)
- [Опции рендерера](api.md#renderer-options)
- [template](api.md#template)
- [clientManifest](api.md#clientmanifest)
- [inject](api.md#inject)
- [shouldPreload](api.md#shouldpreload)
- [runInNewContext](api.md#runinnewcontext)
- [basedir](api.md#basedir)
- [cache](api.md#cache)
- [directives](api.md#directives)
- [Webpack плагины](api.md#webpack-plugins)
Loading