Skip to content

Commit c6121dd

Browse files
authored
fix: should pin major version in CDN links (#2717)
Otherwise, the link would point to a different major version after Vue 3 moves to the `latest` dist-tag, which breaks examples; and some of the links would be broken.
1 parent 7eb3af2 commit c6121dd

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/v2/guide/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ React is renowned for its steep learning curve. Before you can really get starte
111111
While Vue scales up just as well as React, it also scales down just as well as jQuery. That's right - to get started, all you have to do is drop a single script tag into the page:
112112

113113
``` html
114-
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
114+
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
115115
```
116116

117117
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.

src/v2/guide/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The easiest way to try out Vue.js is using the [Hello World example](https://cod
2424

2525
``` html
2626
<!-- development version, includes helpful console warnings -->
27-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
27+
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
2828
```
2929

3030
or:
3131

3232
``` html
3333
<!-- production version, optimized for size and speed -->
34-
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
34+
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
3535
```
3636

3737
The [Installation](installation.html) page provides more options of installing Vue. Note: We **do not** recommend that beginners start with `vue-cli`, especially if you are not yet familiar with Node.js-based build tools.

src/v2/guide/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Simply download and include with a script tag. `Vue` will be registered as a glo
4141
For prototyping or learning purposes, you can use the latest version with:
4242

4343
``` html
44-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
44+
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
4545
```
4646

4747
For production, we recommend linking to a specific version number and build to avoid unexpected breakage from newer versions:
@@ -84,7 +84,7 @@ Vue provides an [official CLI](https://github.com/vuejs/vue-cli) for quickly sca
8484

8585
## Explanation of Different Builds
8686

87-
In the [`dist/` directory of the NPM package](https://cdn.jsdelivr.net/npm/vue/dist/) you will find many different builds of Vue.js. Here's an overview of the difference between them:
87+
In the [`dist/` directory of the NPM package](https://cdn.jsdelivr.net/npm/vue@2/dist/) you will find many different builds of Vue.js. Here's an overview of the difference between them:
8888

8989
| | UMD | CommonJS | ES Module (for bundlers) | ES Module (for browsers) |
9090
| --- | --- | --- | --- | --- |
@@ -101,7 +101,7 @@ In the [`dist/` directory of the NPM package](https://cdn.jsdelivr.net/npm/vue/d
101101

102102
- **Runtime**: code that is responsible for creating Vue instances, rendering and patching virtual DOM, etc. Basically everything minus the compiler.
103103

104-
- **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a `<script>` tag. The default file from jsDelivr CDN at [https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue) is the Runtime + Compiler UMD build (`vue.js`).
104+
- **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a `<script>` tag. The default file from jsDelivr CDN at [https://cdn.jsdelivr.net/npm/vue@2](https://cdn.jsdelivr.net/npm/vue@2) is the Runtime + Compiler UMD build (`vue.js`).
105105

106106
- **[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: CommonJS builds are intended for use with older bundlers like [browserify](http://browserify.org/) or [webpack 1](https://webpack.github.io). The default file for these bundlers (`pkg.main`) is the Runtime only CommonJS build (`vue.runtime.common.js`).
107107

src/v2/guide/typescript.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ type: guide
44
order: 403
55
---
66

7-
> [Vue CLI](https://cli.vuejs.org) provides built-in TypeScript tooling support.
7+
> [Vue CLI](https://cli.vuejs.org) provides built-in TypeScript tooling support.
88
99
## Official Declaration in NPM Packages
1010

1111
A static type system can help prevent many potential runtime errors, especially as applications grow. That's why Vue ships with [official type declarations](https://github.com/vuejs/vue/tree/dev/types) for [TypeScript](https://www.typescriptlang.org/) - not only in Vue core, but also for [vue-router](https://github.com/vuejs/vue-router/tree/dev/types) and [vuex](https://github.com/vuejs/vuex/tree/dev/types) as well.
1212

13-
Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue.
13+
Since these are [published on NPM](https://cdn.jsdelivr.net/npm/vue@2/types/), and the latest TypeScript knows how to resolve type declarations in NPM packages, this means when installed via NPM, you don't need any additional tooling to use TypeScript with Vue.
1414

1515
## Recommended Configuration
1616

@@ -195,7 +195,7 @@ If you find type inference or member completion isn't working, annotating certai
195195
```ts
196196
import Vue, { PropType } from 'vue'
197197

198-
interface ComplexMessage {
198+
interface ComplexMessage {
199199
title: string,
200200
okMessage: string,
201201
cancelMessage: string
@@ -204,7 +204,7 @@ const Component = Vue.extend({
204204
props: {
205205
name: String,
206206
success: { type: String },
207-
callback: {
207+
callback: {
208208
type: Function as PropType<() => void>
209209
},
210210
message: {

0 commit comments

Comments
 (0)