Skip to content

Commit 048e940

Browse files
HerringtonDarkholmeyyx990803
authored andcommitted
build: map vue to local types, simplify build setup (vuejs#6860)
* build: map vue to local types, simplify build setup * build: remove unnecessary install steps
1 parent a433b16 commit 048e940

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

.circleci/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
- v1-vue-{{ .Branch }}-
1717
- v1-vue-
1818
- run: npm install
19-
- run: cd packages/vue-server-renderer && npm install vue
2019
- save_cache:
2120
key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
2221
paths:

build/setup.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
const { test, ln, chmod, cd, exec } = require('shelljs')
2-
const path = require('path')
3-
4-
const baseUrl = path.resolve()
1+
const { test, ln, chmod } = require('shelljs')
52

63
function installHooks () {
74
if (test('-e', '.git/hooks')) {
@@ -12,15 +9,4 @@ function installHooks () {
129
}
1310
}
1411

15-
function setupSSR () {
16-
const ssrBase = path.resolve('packages/vue-server-renderer')
17-
if (!test('-e', path.join(ssrBase, 'node_modules'))) {
18-
cd(ssrBase)
19-
exec('npm install')
20-
cd(baseUrl)
21-
}
22-
}
23-
2412
installHooks()
25-
setupSSR()
26-

dist/vue.runtime.common.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3777,8 +3777,8 @@ function renderStatic (
37773777
) {
37783778
// static trees can be rendered once and cached on the contructor options
37793779
// so every instance shares the same cached trees
3780-
var renderFns = this.$options.staticRenderFns;
3781-
var cached = renderFns.cached || (renderFns.cached = []);
3780+
var options = this.$options;
3781+
var cached = options.cached || (options.cached = []);
37823782
var tree = cached[index];
37833783
// if has already-rendered static tree and not inside v-for,
37843784
// we can reuse the same tree by doing a shallow clone.
@@ -3788,7 +3788,7 @@ function renderStatic (
37883788
: cloneVNode(tree)
37893789
}
37903790
// otherwise, render a fresh tree.
3791-
tree = cached[index] = renderFns[index].call(this._renderProxy, null, this);
3791+
tree = cached[index] = options.staticRenderFns[index].call(this._renderProxy, null, this);
37923792
markStatic(tree, ("__static__" + index), false);
37933793
return tree
37943794
}

types/test/tsconfig.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
],
88
"module": "commonjs",
99
"strict": true,
10-
"noEmit": true
10+
"noEmit": true,
11+
"baseUrl": ".",
12+
"paths": {
13+
"vue": ["../index.d.ts"]
14+
}
1115
},
1216
"files": [
1317
"../index.d.ts",

0 commit comments

Comments
 (0)