Skip to content

Commit 9d5c029

Browse files
authored
Merge pull request #28 from vuejs/2.0
2.0
2 parents 91f0686 + d7b0e2d commit 9d5c029

35 files changed

+775
-2441
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ all: update deploy
33
deploy:
44
rm -f db.json
55
hexo generate
6-
cp -R ./todomvc public/examples
76
hexo deploy
87

98
update:
109
cd ../vue && \
1110
git checkout -- dist && \
12-
git checkout next && \
11+
git checkout dev && \
1312
npm run build
1413
cp ../vue/dist/vue.min.js themes/vue/source/js/vue.min.js
1514
cp ../vue/dist/vue.js themes/vue/source/js/vue.js

src/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,8 +1780,8 @@ type: api
17801780

17811781
## VNode Interface
17821782

1783-
- Please refer to the [VNode class declaration](https://github.com/vuejs/vue/blob/next/src/core/vdom/vnode.js).
1783+
- Please refer to the [VNode class declaration](https://github.com/vuejs/vue/blob/dev/src/core/vdom/vnode.js).
17841784

17851785
## Server-Side Rendering
17861786

1787-
- Please refer to the [vue-server-renderer package documentation](https://github.com/vuejs/vue/tree/next/packages/vue-server-renderer).
1787+
- Please refer to the [vue-server-renderer package documentation](https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer).

src/blog/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/guide/comparison.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ React is renowned for its steep learning curve. Before you can really get starte
213213
While Vue scales up just as well as, if not better than React, it also scales down just as well as jQuery. That's right - all you have to do is drop a single script tag into a page:
214214

215215
``` html
216-
<script src="https://unpkg.com/vue@next/dist/vue.js"></script>
216+
<script src="https://unpkg.com/vue/dist/vue.js"></script>
217217
```
218218

219219
Then you can start writing Vue code and even ship the minified version to production without feeling guilty or having to worry about performance problems.
@@ -268,7 +268,7 @@ We have a separate section for Angular 2 because it really is a completely new f
268268

269269
While Angular 1 could be used for smaller applications, Angular 2 has shifted focus to best facilitate large enterprise applications. As part of this, it almost requires TypeScript, which can be very useful for developers that desire the type safety of languages such as Java and C#.
270270

271-
Vue is also well-suited to [enterprise environments](https://github.com/vuejs/awesome-vue#enterprise-usage) and can even be used with TypeScript via our [official typings](https://github.com/vuejs/vue/tree/next/types) and [user-contributed decorators](https://github.com/itsFrank/vue-typescript), though it's definitely optional in our case.
271+
Vue is also well-suited to [enterprise environments](https://github.com/vuejs/awesome-vue#enterprise-usage) and can even be used with TypeScript via our [official typings](https://github.com/vuejs/vue/tree/dev/types) and [user-contributed decorators](https://github.com/itsFrank/vue-typescript), though it's definitely optional in our case.
272272

273273
### Size and Performance
274274

src/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ You may have noticed that Vue components are very similar to **Custom Elements**
332332

333333
1. The Web Components Spec is still in draft status, and is not natively implemented in every browser. In comparison, Vue components don't require any polyfills and work consistently in all supported browsers (IE9 and above). When needed, Vue components can also be wrapped inside a native custom element.
334334

335-
2. Vue components provide important features that are not available in plain custom elements, most notably cross-component data flow, custom event communication and built tool integrations.
335+
2. Vue components provide important features that are not available in plain custom elements, most notably cross-component data flow, custom event communication and build tool integrations.
336336

337337
## Ready for More?
338338

src/guide/installation.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Installation
33
type: guide
44
order: 1
5-
vue_version: 2.0.0-rc.6
6-
dev_size: "184"
7-
min_size: "64"
8-
gz_size: "22"
5+
vue_version: 2.0.0-rc.8
6+
dev_size: "183.80"
7+
min_size: "61.54"
8+
gz_size: "22.53"
99
---
1010

1111
### Compatibility Note
@@ -30,42 +30,46 @@ Simply download and include with a script tag. `Vue` will be registered as a glo
3030

3131
### CDN
3232

33-
Available on [jsdelivr](//cdn.jsdelivr.net/vue/{{vue_version}}/vue.min.js) or [cdnjs](//cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.min.js) (takes some time to sync so the latest version might not be available yet).
33+
Recommended: [unpkg](https://unpkg.com/vue), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [unpkg.com/vue/](https://unpkg.com/vue/).
3434

35-
Also available on [unpkg](https://unpkg.com/vue/dist/vue.min.js), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [unpkg.com/vue/](https://unpkg.com/vue/).
36-
37-
### CSP environments
38-
39-
Some environments, such as Google Chrome Apps, enforce Content Security Policy (CSP), which prohibits the use of `new Function()` for evaluating expressions. The standalone build depends on this feature to compile templates, so is unusable in these environments.
40-
41-
There _is_ a solution however. When using Vue in a build system with [Webpack + vue-loader](https://github.com/vuejs-templates/webpack-simple-2.0) or [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple-2.0), your templates will be precompiled into `render` functions which work perfectly in CSP environments.
35+
Also available on [jsdelivr](//cdn.jsdelivr.net/vue/{{vue_version}}/vue.js) or [cdnjs](//cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js), but these two services take some time to sync so the latest release may not be available yet.
4236

4337
## NPM
4438

4539
NPM is the recommended installation method when building large scale applications with Vue. It pairs nicely with module bundlers such as [Webpack](http://webpack.github.io/) or [Browserify](http://browserify.org/). Vue also provides accompanying tools for authoring [Single File Components](application.html#Single-File-Components).
4640

4741
``` bash
4842
# latest stable
49-
$ npm install vue@next
43+
$ npm install vue
5044
```
5145

52-
### Note on NPM Builds
46+
### Standalone vs. Runtime-only Build
47+
48+
There are two builds available, the standalone build and the runtime-only build.
5349

54-
Because Single File Components pre-compile the templates into render functions at build time, the default export of the `vue` NPM package is the **runtime-only build**, which does not support the `template` option. If you still wish to use the `template` option, you will need to configure your bundler to alias `vue` to the standalone build.
50+
- The standalone build includes the compiler and supports the `template` option.
5551

56-
With webpack, add the following alias to your webpack config:
52+
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
53+
54+
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
5755

5856
``` js
5957
resolve: {
6058
alias: {
61-
vue: 'vue/dist/vue.js'
59+
vue: 'vue/dist/vue.common.js'
6260
}
6361
}
6462
```
6563

66-
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) for the same effect.
64+
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.
65+
66+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>
67+
68+
### CSP environments
69+
70+
Some environments, such as Google Chrome Apps, enforce Content Security Policy (CSP), which prohibits the use of `new Function()` for evaluating expressions. The standalone build depends on this feature to compile templates, so is unusable in these environments.
6771

68-
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>
72+
On the other hand, the runtime-only build is fully CSP-compliant. When using the runtime-only build with [Webpack + vue-loader](https://github.com/vuejs-templates/webpack-simple-2.0) or [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple-2.0), your templates will be precompiled into `render` functions which work perfectly in CSP environments.
6973

7074
## CLI
7175

@@ -84,12 +88,11 @@ $ npm run dev
8488

8589
## Dev Build
8690

87-
**Important**: the CommonJS bundle distributed on NPM (`vue.common.js`) is only checked in during releases on the `next` branch. To use Vue from the latest source code on GitHub, you will have to build it yourself!
91+
**Important**: the built files in GitHub's `/dist` folder are only checked-in during releases. To use Vue from the latest source code on GitHub, you will have to build it yourself!
8892

8993
``` bash
9094
git clone https://github.com/vuejs/vue.git node_modules/vue
9195
cd node_modules/vue
92-
git checkout next
9396
npm install
9497
npm run build
9598
```
@@ -98,7 +101,7 @@ npm run build
98101

99102
``` bash
100103
# latest stable
101-
$ bower install vue#next
104+
$ bower install vue
102105
```
103106

104107
## AMD Module Loaders

src/guide/single-file-components.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,25 @@ NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
9999
``` bash
100100
NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o build.css ] -e main.js | uglifyjs -c -m > build.js
101101
```
102+
103+
### Use the Runtime-Only Build
104+
105+
There are two builds available, the standalone build and the runtime-only build.
106+
107+
- The standalone build includes the compiler and supports the `template` option.
108+
109+
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
110+
111+
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
112+
113+
``` js
114+
resolve: {
115+
alias: {
116+
vue: 'vue/dist/vue.common.js'
117+
}
118+
}
119+
```
120+
121+
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.
122+
123+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>

src/guide/state-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 21
66

77
## Official Flux-Like Implementation
88

9-
Large applications can often grow in complexity, due to multiple pieces of state scattered across many components and the interactions between them. To solve this problem, Vue offers [vuex](https://github.com/vuejs/vuex/tree/next): our own Elm-inspired state management library. It even integrates into [vue-devtools](https://github.com/vuejs/vue-devtools), providing zero-setup access to time travel.
9+
Large applications can often grow in complexity, due to multiple pieces of state scattered across many components and the interactions between them. To solve this problem, Vue offers [vuex](https://github.com/vuejs/vuex): our own Elm-inspired state management library. It even integrates into [vue-devtools](https://github.com/vuejs/vue-devtools), providing zero-setup access to time travel.
1010

1111
### Information for React Developers
1212

@@ -75,4 +75,4 @@ var vmB = new Vue({
7575

7676
As we continue developing the convention where components are never allowed to directly mutate state that belongs to a store, but should instead dispatch events that notify the store to perform actions, we eventually arrive at the [Flux](https://facebook.github.io/flux/) architecture. The benefit of this convention is we can record all state mutations happening to the store and implement advanced debugging helpers such as mutation logs, snapshots, and history re-rolls / time travel.
7777

78-
This brings us full circle back to [vuex](https://github.com/vuejs/vuex/tree/next), so if you've read this far it's probably time to try it out!
78+
This brings us full circle back to [vuex](https://github.com/vuejs/vuex), so if you've read this far it's probably time to try it out!

src/support-vuejs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<img src="/images/monterail.png">
3232
</a><a href="https://www.trisoft.ro/" target="_blank">
3333
<img src="/images/trisoft.png">
34+
</a><a href="http://actualize.co" target="_blank" style="width:180px">
35+
<img src="/images/actualize.png" style="width:180px">
3436
</a>
3537
</p>
3638

themes/vue/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google_analytics: UA-46852172-1
22
root_domain: vuejs.org
3-
vue_version: 2.0.0-rc.6
3+
vue_version: 2.0.0-rc.8

0 commit comments

Comments
 (0)