Browse Source

build: map vue to local types, simplify build setup (#6860)

* build: map vue to local types, simplify build setup

* build: remove unnecessary install steps
dev
Herrington Darkholme 7 years ago
committed by Evan You
parent
commit
048e940779
  1. 1
      .circleci/config.yml
  2. 16
      build/setup.js
  3. 6
      dist/vue.runtime.common.js
  4. 6
      types/test/tsconfig.json

1
.circleci/config.yml

@ -16,7 +16,6 @@ jobs:
- v1-vue-{{ .Branch }}- - v1-vue-{{ .Branch }}-
- v1-vue- - v1-vue-
- run: npm install - run: npm install
- run: cd packages/vue-server-renderer && npm install vue
- save_cache: - save_cache:
key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }} key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths: paths:

16
build/setup.js

@ -1,7 +1,4 @@
const { test, ln, chmod, cd, exec } = require('shelljs') const { test, ln, chmod } = require('shelljs')
const path = require('path')
const baseUrl = path.resolve()
function installHooks () { function installHooks () {
if (test('-e', '.git/hooks')) { if (test('-e', '.git/hooks')) {
@ -12,15 +9,4 @@ function installHooks () {
} }
} }
function setupSSR () {
const ssrBase = path.resolve('packages/vue-server-renderer')
if (!test('-e', path.join(ssrBase, 'node_modules'))) {
cd(ssrBase)
exec('npm install')
cd(baseUrl)
}
}
installHooks() installHooks()
setupSSR()

6
dist/vue.runtime.common.js

@ -3777,8 +3777,8 @@ function renderStatic (
) { ) {
// static trees can be rendered once and cached on the contructor options // static trees can be rendered once and cached on the contructor options
// so every instance shares the same cached trees // so every instance shares the same cached trees
var renderFns = this.$options.staticRenderFns; var options = this.$options;
var cached = renderFns.cached || (renderFns.cached = []); var cached = options.cached || (options.cached = []);
var tree = cached[index]; var tree = cached[index];
// if has already-rendered static tree and not inside v-for, // if has already-rendered static tree and not inside v-for,
// we can reuse the same tree by doing a shallow clone. // we can reuse the same tree by doing a shallow clone.
@ -3788,7 +3788,7 @@ function renderStatic (
: cloneVNode(tree) : cloneVNode(tree)
} }
// otherwise, render a fresh tree. // otherwise, render a fresh tree.
tree = cached[index] = renderFns[index].call(this._renderProxy, null, this); tree = cached[index] = options.staticRenderFns[index].call(this._renderProxy, null, this);
markStatic(tree, ("__static__" + index), false); markStatic(tree, ("__static__" + index), false);
return tree return tree
} }

6
types/test/tsconfig.json

@ -7,7 +7,11 @@
], ],
"module": "commonjs", "module": "commonjs",
"strict": true, "strict": true,
"noEmit": true "noEmit": true,
"baseUrl": ".",
"paths": {
"vue": ["../index.d.ts"]
}
}, },
"files": [ "files": [
"../index.d.ts", "../index.d.ts",

Loading…
Cancel
Save