From 6e990043b06f3d01dab70019f4cee78e75b65615 Mon Sep 17 00:00:00 2001 From: Herrington Darkholme Date: Fri, 20 Oct 2017 10:00:31 +0800 Subject: [PATCH 1/2] build: map vue to local types, simplify build setup --- build/setup.js | 16 +--------------- types/test/tsconfig.json | 6 +++++- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/build/setup.js b/build/setup.js index 231e4365d56..3427c5aa966 100644 --- a/build/setup.js +++ b/build/setup.js @@ -1,7 +1,4 @@ -const { test, ln, chmod, cd, exec } = require('shelljs') -const path = require('path') - -const baseUrl = path.resolve() +const { test, ln, chmod } = require('shelljs') function installHooks () { 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() -setupSSR() - diff --git a/types/test/tsconfig.json b/types/test/tsconfig.json index 784de825267..15809b5f786 100644 --- a/types/test/tsconfig.json +++ b/types/test/tsconfig.json @@ -7,7 +7,11 @@ ], "module": "commonjs", "strict": true, - "noEmit": true + "noEmit": true, + "baseUrl": ".", + "paths": { + "vue": ["../index.d.ts"] + } }, "files": [ "../index.d.ts", From c4e14387bb0bfd4e5c7ac6219f322f8d7d962a40 Mon Sep 17 00:00:00 2001 From: Herrington Darkholme Date: Sat, 21 Oct 2017 10:51:40 +0800 Subject: [PATCH 2/2] build: remove unnecessary install steps --- .circleci/config.yml | 1 - dist/vue.runtime.common.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 99fa8891655..0c5f49e158d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,6 @@ jobs: - v1-vue-{{ .Branch }}- - v1-vue- - run: npm install - - run: cd packages/vue-server-renderer && npm install vue - save_cache: key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }} paths: diff --git a/dist/vue.runtime.common.js b/dist/vue.runtime.common.js index 789cc0b6071..18b21e77bb6 100644 --- a/dist/vue.runtime.common.js +++ b/dist/vue.runtime.common.js @@ -3777,8 +3777,8 @@ function renderStatic ( ) { // static trees can be rendered once and cached on the contructor options // so every instance shares the same cached trees - var renderFns = this.$options.staticRenderFns; - var cached = renderFns.cached || (renderFns.cached = []); + var options = this.$options; + var cached = options.cached || (options.cached = []); var tree = cached[index]; // if has already-rendered static tree and not inside v-for, // we can reuse the same tree by doing a shallow clone. @@ -3788,7 +3788,7 @@ function renderStatic ( : cloneVNode(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); return tree }