Skip to content

Commit 0545217

Browse files
committed
formatting
1 parent da5c948 commit 0545217

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

active-rfcs/0004-global-api-treeshaking.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Make Vue runtime tree-shakable by exposing as much APIs through named exports as
99

1010
# Basic example
1111

12-
``` js
12+
```js
1313
import { nextTick, observable } from 'vue'
1414

1515
nextTick(() => {})
@@ -29,7 +29,7 @@ In addition, knowing that optional features won't increase the bundle size for u
2929

3030
Currently in 2.x, all global APIs are exposed on the single Vue object:
3131

32-
``` js
32+
```js
3333
import Vue from 'vue'
3434

3535
Vue.nextTick(() => {})
@@ -39,7 +39,7 @@ const obj = Vue.observable({})
3939

4040
In 3.x, they can **only** be accessed as named imports:
4141

42-
``` js
42+
```js
4343
import Vue, { nextTick, observable } from 'vue'
4444

4545
Vue.nextTick // undefined
@@ -64,7 +64,7 @@ By not attaching all APIs on the `Vue` default export, any unused APIs can be dr
6464

6565
In addition to public APIs, many of the internal components / helpers can be exported as named exports as well. This allows the compiler to output code that only imports features when they are used. For example the following template:
6666

67-
``` html
67+
```html
6868
<transition>
6969
<div v-show="ok">hello</div>
7070
</transition>
@@ -86,15 +86,15 @@ This means the `Transition` component only gets imported when the application ac
8686

8787
**Note the above only applies to the ES Modules builds for use with tree-shaking capable bundlers - the UMD build still includes all features and exposes everything on the `Vue` global variable (and the compiler will produce appropriate output to use APIs off the global instead of importing).**
8888

89-
# Drawbacks
89+
# Drawbacks
9090

9191
Users can no longer import a single `Vue` variable and then use APIs off of it. However this should be a worthwhile tradeoff for minimal bundle sizes.
9292

9393
## Global API usage in plugins
9494

9595
Some plugins may rely on global APIs originally exposed on `Vue`:
9696

97-
``` js
97+
```js
9898
const plugin = {
9999
install: Vue => {
100100
Vue.nextTick(() => {
@@ -106,7 +106,7 @@ const plugin = {
106106

107107
In 3.0 they will need to import these explicitly:
108108

109-
``` js
109+
```js
110110
import { nextTick } from 'vue'
111111

112112
const plugin = {

0 commit comments

Comments
 (0)