From c6eef59823df796c2b753f19d45757e3eb6c53c0 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 13:20:19 +0430 Subject: [PATCH 01/21] [deps] upgrade vue to 2.3.0 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fd48eba17f..0758141250 100644 --- a/package.json +++ b/package.json @@ -81,14 +81,14 @@ "serialize-javascript": "^1.3.0", "serve-static": "^1.12.1", "url-loader": "^0.5.8", - "vue": "^2.2.6", + "vue": "^2.3.0", "vue-loader": "^11.3.4", "vue-meta": "^0.5.6", "vue-router": "^2.4.0", - "vue-server-renderer": "^2.2.6", + "vue-server-renderer": "^2.3.0", "vue-ssr-html-stream": "^2.2.0", "vue-ssr-webpack-plugin": "^3.0.0", - "vue-template-compiler": "^2.2.6", + "vue-template-compiler": "^2.3.0", "vuex": "^2.3.0", "webpack": "^2.4.1", "webpack-bundle-analyzer": "^2.4.0", From 8db3a22db97726affda7d563fc32992ab33c2342 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 13:24:18 +0430 Subject: [PATCH 02/21] deprecated vue-ssr-webpack-plugin in flavor of vue-server-renderer --- lib/webpack/server.config.js | 4 ++-- package.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/webpack/server.config.js b/lib/webpack/server.config.js index 0a92a9c82e..5e7300f6cc 100644 --- a/lib/webpack/server.config.js +++ b/lib/webpack/server.config.js @@ -1,7 +1,7 @@ 'use strict' import webpack from 'webpack' -import VueSSRPlugin from 'vue-ssr-webpack-plugin' +import VueSSRServerPlugin from 'vue-server-renderer/server-plugin' import base from './base.config.js' import { each, uniq } from 'lodash' import { existsSync, readFileSync } from 'fs' @@ -34,7 +34,7 @@ export default function () { hints: false }, plugins: (config.plugins || []).concat([ - new VueSSRPlugin({ + new VueSSRServerPlugin({ filename: 'server-bundle.json' }), new webpack.DefinePlugin(Object.assign(env, { diff --git a/package.json b/package.json index 0758141250..eefa091ed3 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "vue-router": "^2.4.0", "vue-server-renderer": "^2.3.0", "vue-ssr-html-stream": "^2.2.0", - "vue-ssr-webpack-plugin": "^3.0.0", "vue-template-compiler": "^2.3.0", "vuex": "^2.3.0", "webpack": "^2.4.1", From ac151a41f0ec58e2b50425ab0eaa7b65fe81f708 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 15:50:43 +0430 Subject: [PATCH 03/21] Basic vue-server-renderer/client-plugin integration --- lib/build.js | 60 +++++++++++++++++++++++------------- lib/webpack/client.config.js | 5 +++ 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/lib/build.js b/lib/build.js index 7316939ed7..fdbe87637d 100644 --- a/lib/build.js +++ b/lib/build.js @@ -101,9 +101,11 @@ export function options () { } const serverConfig = getWebpackServerConfig.call(this) const bundlePath = join(serverConfig.output.path, 'server-bundle.json') - if (fs.existsSync(bundlePath)) { + const manifestPath = join(serverConfig.output.path, 'client-manifest.json') + if (fs.existsSync(bundlePath) && fs.existsSync(manifestPath)) { const bundle = fs.readFileSync(bundlePath, 'utf8') - createRenderer.call(this, JSON.parse(bundle)) + const manifest = fs.readFileSync(manifestPath, 'utf8') + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) addAppTemplate.call(this) } } @@ -137,15 +139,13 @@ export function * build () { function * buildFiles () { if (this.dev) { debug('Adding webpack middleware...') - createWebpackMiddleware.call(this) - webpackWatchAndUpdate.call(this) + const clientCompiler = createWebpackMiddleware.call(this) + webpackWatchAndUpdate.call(this, clientCompiler) watchPages.call(this) } else { debug('Building files...') - yield [ - webpackRunClient.call(this), - webpackRunServer.call(this) - ] + yield webpackRunClient.call(this) + yield webpackRunServer.call(this) addAppTemplate.call(this) } } @@ -407,19 +407,34 @@ function createWebpackMiddleware () { }) } }) + return clientCompiler } -function webpackWatchAndUpdate () { +function webpackWatchAndUpdate (clientCompiler) { const MFS = require('memory-fs') // <- dependencies of webpack - const mfs = new MFS() + const serverFS = new MFS() + const clientFS = clientCompiler.outputFileSystem const serverConfig = getWebpackServerConfig.call(this) const serverCompiler = webpack(serverConfig) - const outputPath = join(serverConfig.output.path, 'server-bundle.json') - serverCompiler.outputFileSystem = mfs - this.webpackServerWatcher = serverCompiler.watch(this.options.watchers.webpack, (err) => { + const bundlePath = join(serverConfig.output.path, 'server-bundle.json') + const manifestPath = join(serverConfig.output.path, 'client-manifest.json') + serverCompiler.outputFileSystem = serverFS + const watchHandler = (err) => { if (err) throw err - createRenderer.call(this, JSON.parse(mfs.readFileSync(outputPath, 'utf-8'))) - }) + const bundleExists = serverFS.existsSync(bundlePath) + const manifestExists = clientFS.existsSync(manifestPath) + if (!bundleExists) { + debug('Waiting for server bundle...') + } else if (!manifestExists) { + debug('Waiting for client manifest...') + } else { + const bundle = serverFS.readFileSync(bundlePath, 'utf-8') + const manifest = clientFS.readFileSync(manifestPath, 'utf-8') + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) + } + } + this.webpackServerWatcher = serverCompiler.watch(this.options.watchers.webpack, watchHandler) + this.webpackClientWatcher = clientCompiler.watch(this.options.watchers.webpack, watchHandler) } function webpackRunClient () { @@ -444,16 +459,18 @@ function webpackRunServer () { console.log('[nuxt:build:server]\n', stats.toString(webpackStats)) // eslint-disable-line no-console if (stats.hasErrors()) return reject(new Error('Webpack build exited with errors')) const bundlePath = join(serverConfig.output.path, 'server-bundle.json') + const manifestPath = join(serverConfig.output.path, 'client-manifest.json') readFile(bundlePath, 'utf8') - .then((bundle) => { - createRenderer.call(this, JSON.parse(bundle)) - resolve() - }) + .then((bundle) => readFile(manifestPath, 'utf8') + .then(manifest => { + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) + resolve() + })) }) }) } -function createRenderer (bundle) { +function createRenderer (bundle, manifest) { // Create bundle renderer to give a fresh context for every request let cacheConfig = false if (this.options.cache) { @@ -464,7 +481,8 @@ function createRenderer (bundle) { })) } this.renderer = createBundleRenderer(bundle, { - cache: cacheConfig + cache: cacheConfig, + clientManifest: manifest }) this.renderToString = pify(this.renderer.renderToString) this.renderToStream = this.renderer.renderToStream diff --git a/lib/webpack/client.config.js b/lib/webpack/client.config.js index c2e53b90a5..92380ad483 100644 --- a/lib/webpack/client.config.js +++ b/lib/webpack/client.config.js @@ -2,6 +2,7 @@ import { each, defaults } from 'lodash' import webpack from 'webpack' +import VueSSRClientPlugin from 'vue-server-renderer/client-plugin' import HTMLPlugin from 'html-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' import ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin' @@ -45,6 +46,9 @@ export default function () { }) // Webpack plugins config.plugins = (config.plugins || []).concat([ + new VueSSRClientPlugin({ + filename: 'client-manifest.json' + }), // Strip comments in Vue code new webpack.DefinePlugin(Object.assign(env, { 'process.env.NODE_ENV': JSON.stringify(this.dev ? 'development' : 'production'), @@ -61,6 +65,7 @@ export default function () { // Extract manifest new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', + minChunks: Infinity, filename: this.options.build.filenames.manifest }), // Generate output HTML From 69454799841df7a6fdd18c80954964b15d71e54f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 20:02:41 +0430 Subject: [PATCH 04/21] fix test resources --- test/with-config.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/with-config.test.js b/test/with-config.test.js index fae3ab1869..d9b4845f52 100644 --- a/test/with-config.test.js +++ b/test/with-config.test.js @@ -82,7 +82,7 @@ test('/test/about-bis (added with extendRoutes)', async t => { test('Check stats.json generated by build.analyze', t => { const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json')) - t.is(stats.assets.length, 26) + t.is(stats.assets.length, 27) }) // Close server and ask nuxt to stop listening to file changes From 750276b3f695b2a1fb3fd5361c1b8eee8f4246cd Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 21:14:31 +0430 Subject: [PATCH 05/21] refactor client watch Fixes duplicate READY message --- lib/build.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/build.js b/lib/build.js index fdbe87637d..45a2c1f88a 100644 --- a/lib/build.js +++ b/lib/build.js @@ -139,8 +139,8 @@ export function * build () { function * buildFiles () { if (this.dev) { debug('Adding webpack middleware...') - const clientCompiler = createWebpackMiddleware.call(this) - webpackWatchAndUpdate.call(this, clientCompiler) + createWebpackMiddleware.call(this) + webpackWatchAndUpdate.call(this) watchPages.call(this) } else { debug('Building files...') @@ -386,6 +386,7 @@ function createWebpackMiddleware () { }) ) const clientCompiler = webpack(clientConfig) + this.clientCompiler = clientCompiler // Add the middleware to the instance context this.webpackDevMiddleware = pify(require('webpack-dev-middleware')(clientCompiler, { publicPath: clientConfig.output.publicPath, @@ -406,14 +407,14 @@ function createWebpackMiddleware () { interpolate: /{{([\s\S]+?)}}/g }) } + this.watchHandler() }) - return clientCompiler } -function webpackWatchAndUpdate (clientCompiler) { +function webpackWatchAndUpdate () { const MFS = require('memory-fs') // <- dependencies of webpack const serverFS = new MFS() - const clientFS = clientCompiler.outputFileSystem + const clientFS = this.clientCompiler.outputFileSystem const serverConfig = getWebpackServerConfig.call(this) const serverCompiler = webpack(serverConfig) const bundlePath = join(serverConfig.output.path, 'server-bundle.json') @@ -428,13 +429,13 @@ function webpackWatchAndUpdate (clientCompiler) { } else if (!manifestExists) { debug('Waiting for client manifest...') } else { - const bundle = serverFS.readFileSync(bundlePath, 'utf-8') - const manifest = clientFS.readFileSync(manifestPath, 'utf-8') + const bundle = serverFS.readFileSync(bundlePath, 'utf8') + const manifest = clientFS.readFileSync(manifestPath, 'utf8') createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) } } + this.watchHandler = watchHandler this.webpackServerWatcher = serverCompiler.watch(this.options.watchers.webpack, watchHandler) - this.webpackClientWatcher = clientCompiler.watch(this.options.watchers.webpack, watchHandler) } function webpackRunClient () { From d9ed6ecea973b635cd117cbe7946a3df2d6af4bb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 22:36:10 +0430 Subject: [PATCH 06/21] integrate template with server renderer --- lib/nuxt.js | 3 +-- lib/render.js | 5 +++-- lib/webpack/client.config.js | 22 ++++------------------ 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/lib/nuxt.js b/lib/nuxt.js index 52e2c3ac64..798941a0de 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -43,8 +43,7 @@ class Nuxt { performance: { gzip: { threshold: 0 - }, - prefetch: true + } }, watchers: { webpack: {}, diff --git a/lib/render.js b/lib/render.js index eec45eb82a..d70ebbf449 100644 --- a/lib/render.js +++ b/lib/render.js @@ -93,7 +93,7 @@ export function renderRoute (url, context = {}) { // Add url and isSever to the context context.url = url context.isServer = true - // Call rendertoSting from the bundleRenderer and generate the HTML (will update the context as well) + // Call renderToSting from the bundleRenderer and generate the HTML (will update the context as well) const self = this return co(function * () { let APP = yield self.renderToString(context) @@ -105,8 +105,9 @@ export function renderRoute (url, context = {}) { if (self.options.router.base !== '/') { HEAD += `` } - HEAD += context.styles + HEAD += context.renderResourceHints() + context.renderStyles() APP += `` + APP += context.renderScripts() const html = self.appTemplate({ HTML_ATTRS: 'data-n-head-ssr ' + m.htmlAttrs.text(), BODY_ATTRS: m.bodyAttrs.text(), diff --git a/lib/webpack/client.config.js b/lib/webpack/client.config.js index 92380ad483..2ebdf1551a 100644 --- a/lib/webpack/client.config.js +++ b/lib/webpack/client.config.js @@ -5,8 +5,6 @@ import webpack from 'webpack' import VueSSRClientPlugin from 'vue-server-renderer/client-plugin' import HTMLPlugin from 'html-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' -import ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin' -import PreloadWebpackPlugin from 'preload-webpack-plugin' import ProgressBarPlugin from 'progress-bar-webpack-plugin' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' import OfflinePlugin from 'offline-plugin' @@ -46,9 +44,6 @@ export default function () { }) // Webpack plugins config.plugins = (config.plugins || []).concat([ - new VueSSRClientPlugin({ - filename: 'client-manifest.json' - }), // Strip comments in Vue code new webpack.DefinePlugin(Object.assign(env, { 'process.env.NODE_ENV': JSON.stringify(this.dev ? 'development' : 'production'), @@ -70,22 +65,13 @@ export default function () { }), // Generate output HTML new HTMLPlugin({ - template: this.options.appTemplatePath + template: this.options.appTemplatePath, + inject: false // <- Resources will be injected using vue server renderer }), - // Add defer to scripts - new ScriptExtHtmlWebpackPlugin({ - defaultAttribute: 'defer' + new VueSSRClientPlugin({ + filename: 'client-manifest.json' }) ]) - - if (!this.dev && this.options.performance.prefetch === true) { - // Add prefetch code-splitted routes - config.plugins.push( - new PreloadWebpackPlugin({ - rel: 'prefetch' - }) - ) - } // client bundle progress bar config.plugins.push( new ProgressBarPlugin() From ec552bc5e9e736873ea8b41f2171a942fe7ebea0 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 27 Apr 2017 23:53:57 +0430 Subject: [PATCH 07/21] [deps] upgrade vue-loader to 12.x This brings Compatibility for the new features in vue-server-renderer@^2.3.0. https://github.com/vuejs/vue-loader/releases/tag/v12.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eefa091ed3..924024a566 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "serve-static": "^1.12.1", "url-loader": "^0.5.8", "vue": "^2.3.0", - "vue-loader": "^11.3.4", + "vue-loader": "^12.0.2", "vue-meta": "^0.5.6", "vue-router": "^2.4.0", "vue-server-renderer": "^2.3.0", From 57d391cb99c7f3606fbf40f1ab8bb6f23f62453c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 01:23:07 +0430 Subject: [PATCH 08/21] [deps] upgrade Also yarn.lock included to have consistent CI builds --- package.json | 22 +-- yarn.lock | 546 +++++++++++++++++++++++++++++---------------------- 2 files changed, 325 insertions(+), 243 deletions(-) diff --git a/package.json b/package.json index 924024a566..1f760f6fbc 100644 --- a/package.json +++ b/package.json @@ -54,17 +54,17 @@ "ansi-html": "^0.0.7", "autoprefixer": "^6.7.7", "babel-core": "^6.24.1", - "babel-loader": "^6.4.1", + "babel-loader": "^7.0.0", "babel-preset-es2015": "^6.24.1", "babel-preset-vue-app": "^1.2.0", "chokidar": "^1.6.1", "co": "^4.6.0", "compression": "^1.6.2", "css-loader": "^0.28.0", - "debug": "^2.6.3", + "debug": "^2.6.6", "file-loader": "^0.11.1", "friendly-errors-webpack-plugin": "^1.6.1", - "fs-extra": "^2.1.2", + "fs-extra": "^3.0.0", "glob": "^7.1.1", "hash-sum": "^1.0.2", "html-minifier": "^3.4.3", @@ -79,24 +79,24 @@ "progress-bar-webpack-plugin": "^1.9.3", "script-ext-html-webpack-plugin": "^1.7.1", "serialize-javascript": "^1.3.0", - "serve-static": "^1.12.1", + "serve-static": "^1.12.2", "url-loader": "^0.5.8", "vue": "^2.3.0", "vue-loader": "^12.0.2", "vue-meta": "^0.5.6", - "vue-router": "^2.4.0", + "vue-router": "^2.5.2", "vue-server-renderer": "^2.3.0", "vue-ssr-html-stream": "^2.2.0", "vue-template-compiler": "^2.3.0", - "vuex": "^2.3.0", + "vuex": "^2.3.1", "webpack": "^2.4.1", "webpack-bundle-analyzer": "^2.4.0", - "webpack-dev-middleware": "^1.10.1", + "webpack-dev-middleware": "^1.10.2", "webpack-hot-middleware": "^2.18.0" }, "devDependencies": { "ava": "^0.19.1", - "babel-eslint": "^7.2.2", + "babel-eslint": "^7.2.3", "babel-plugin-array-includes": "^2.0.3", "babel-plugin-transform-async-to-generator": "^6.24.1", "babel-plugin-transform-runtime": "^6.23.0", @@ -110,10 +110,10 @@ "eslint-plugin-node": "^4.2.2", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", - "finalhandler": "^1.0.1", - "jsdom": "^9.12.0", + "finalhandler": "^1.0.2", + "jsdom": "^10.0.0", "json-loader": "^0.5.4", - "nyc": "^10.2.0", + "nyc": "^10.3.0", "request": "^2.81.0", "request-promise-native": "^1.0.3", "webpack-node-externals": "^1.5.4" diff --git a/yarn.lock b/yarn.lock index 877806385a..2fab195043 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,7 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + "@ava/babel-plugin-throws-helper@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz#2fc1fe3c211a71071a4eca7b8f7af5842cd1ae7c" @@ -117,7 +119,7 @@ ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-html@^0.0.7, ansi-html@0.0.7: +ansi-html@0.0.7, ansi-html@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" @@ -237,14 +239,14 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0, assert-plus@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" @@ -417,14 +419,14 @@ babel-core@^6.17.0, babel-core@^6.24.1: slash "^1.0.0" source-map "^0.5.0" -babel-eslint@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.2.tgz#0da2cbe6554fd0fb069f19674f2db2f9c59270ff" +babel-eslint@^7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" dependencies: babel-code-frame "^6.22.0" babel-traverse "^6.23.1" babel-types "^6.23.0" - babylon "^6.16.1" + babylon "^6.17.0" babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.24.1: version "6.24.1" @@ -561,14 +563,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-loader@^6.4.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-6.4.1.tgz#0b34112d5b0748a8dcdbf51acf6f9bd42d50b8ca" +babel-loader@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.0.0.tgz#2e43a66bee1fff4470533d0402c8a4532fafbaf7" dependencies: find-cache-dir "^0.1.1" - loader-utils "^0.2.16" + loader-utils "^1.0.2" mkdirp "^0.5.1" - object-assign "^4.0.1" babel-messages@^6.23.0: version "6.23.0" @@ -1030,10 +1031,14 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24 lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: +babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: version "6.16.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" +babylon@^6.17.0: + version "6.17.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + balanced-match@^0.4.1, balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -1492,7 +1497,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.9.0, commander@2.9.x: +commander@2.9.x, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -1810,7 +1815,7 @@ csso@~2.3.1: clap "^1.0.9" source-map "^0.5.3" -"cssom@>= 0.3.2 < 0.4.0", cssom@0.3.x: +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.2" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" @@ -1854,13 +1859,7 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" - dependencies: - ms "0.7.2" - -debug@~2.2.0, debug@2.2.0: +debug@2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: @@ -1872,6 +1871,24 @@ debug@2.6.1: dependencies: ms "0.7.2" +debug@2.6.3, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" + dependencies: + ms "0.7.2" + +debug@2.6.4: + version "2.6.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" + dependencies: + ms "0.7.3" + +debug@^2.6.3, debug@^2.6.6: + version "2.6.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" + dependencies: + ms "0.7.3" + decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1929,7 +1946,7 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -depd@~1.1.0, depd@1.1.0: +depd@1.1.0, depd@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" @@ -1966,16 +1983,16 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -doctrine@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" dependencies: esutils "^2.0.2" isarray "^1.0.0" -doctrine@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -1997,7 +2014,7 @@ domain-browser@^1.1.1: version "1.1.7" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" -domelementtype@^1.3.0, domelementtype@1: +domelementtype@1, domelementtype@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" @@ -2005,23 +2022,16 @@ domelementtype@~1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" -domhandler@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" - dependencies: - domelementtype "1" - domhandler@2.1: version "2.1.0" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.1.0.tgz#d2646f5e57f6c3bab11cf6cb05d3c0acf7412594" dependencies: domelementtype "1" -domutils@^1.5.1, domutils@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" +domhandler@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" dependencies: - dom-serializer "0" domelementtype "1" domutils@1.1: @@ -2030,20 +2040,27 @@ domutils@1.1: dependencies: domelementtype "1" +domutils@1.5.1, domutils@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" + dot-prop@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" dependencies: is-obj "^1.0.0" -duplexer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" +duplexer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -2144,7 +2161,7 @@ es6-error@^4.0.1, es6-error@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" -es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@2: +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: @@ -2173,7 +2190,7 @@ es6-set@~0.1.5: es6-symbol "3.1.1" event-emitter "~0.3.5" -es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1, es6-symbol@3.1.1: +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: @@ -2533,7 +2550,19 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -finalhandler@^1.0.1, finalhandler@~1.0.0: +finalhandler@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.2.tgz#d0e36f9dbc557f2de14423df6261889e9d60c93a" + dependencies: + debug "2.6.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.1" + statuses "~1.3.1" + unpipe "~1.0.0" + +finalhandler@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.1.tgz#bcd15d1689c0e5ed729b6f7f541a6df984117db8" dependencies: @@ -2642,12 +2671,13 @@ fs-extra@^0.26.4: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" +fs-extra@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.0.tgz#244e0c4b0b8818f54040ec049d8a2bddc1202861" dependencies: graceful-fs "^4.1.2" - jsonfile "^2.1.0" + jsonfile "^3.0.0" + universalify "^0.1.0" fs.realpath@^1.0.0: version "1.0.0" @@ -2903,7 +2933,7 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" -he@^1.1.0, he@1.1.x: +he@1.1.x, he@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -3076,7 +3106,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@2, inherits@2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -3317,14 +3347,14 @@ is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -3339,53 +3369,54 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" +istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" -istanbul-lib-hook@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz#b8e0dc25709bb44e17336ab47b7bb5c97c23f659" +istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" semver "^5.3.0" -istanbul-lib-report@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0.tgz#d83dac7f26566b521585569367fe84ccfc7aaecb" +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" dependencies: - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.1.tgz#f8c8c2e8f2160d1d91526d97e5bd63b2079af71c" +istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" dependencies: - istanbul-lib-coverage "^1.0.2" + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" - rimraf "^2.4.4" + rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" dependencies: handlebars "^4.0.3" -jest-diff@^19.0.0, jest-diff@19.0.0: +jest-diff@19.0.0, jest-diff@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" dependencies: @@ -3491,9 +3522,9 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^9.12.0: - version "9.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" +jsdom@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-10.0.0.tgz#3dda0b760aa248dd9b1392f8bb82e93ad70377b4" dependencies: abab "^1.0.3" acorn "^4.0.4" @@ -3506,7 +3537,9 @@ jsdom@^9.12.0: html-encoding-sniffer "^1.0.1" nwmatcher ">= 1.3.9 < 2.0.0" parse5 "^1.5.1" + pn "^1.0.0" request "^2.79.0" + request-promise-native "^1.0.3" sax "^1.2.1" symbol-tree "^3.2.1" tough-cookie "^2.3.2" @@ -3551,6 +3584,12 @@ jsonfile@^2.1.0: optionalDependencies: graceful-fs "^4.1.6" +jsonfile@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -3640,7 +3679,7 @@ loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" -loader-utils@^0.2.15, loader-utils@^0.2.16, loader-utils@0.2.x: +loader-utils@0.2.x, loader-utils@^0.2.15, loader-utils@^0.2.16: version "0.2.17" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" dependencies: @@ -3664,6 +3703,10 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -3712,6 +3755,19 @@ lodash.merge@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" +lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -3867,7 +3923,7 @@ mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.7: dependencies: mime-db "~1.27.0" -mime@^1.3.4, mime@1.3.4, mime@1.3.x: +mime@1.3.4, mime@1.3.x, mime@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" @@ -3883,42 +3939,42 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, "minimatch@2 || 3": +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@^0.7.1: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" - ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.2: +ms@0.7.2, ms@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + +ms@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-1.0.0.tgz#59adcd22edc543f7b5381862d31387b1f4bc9473" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -4084,9 +4140,9 @@ number-is-nan@^1.0.0: version "1.3.9" resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" -nyc@^10.2.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.0.tgz#facd90240600c9aa4dd81ea99c2fb6a85c53de0c" +nyc@^10.3.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.3.0.tgz#a7051ac03f89d17e719a586a66a84ce4bdfde857" dependencies: archy "^1.0.0" arrify "^1.0.1" @@ -4098,12 +4154,12 @@ nyc@^10.2.0: find-up "^1.1.2" foreground-child "^1.5.3" glob "^7.0.6" - istanbul-lib-coverage "^1.0.2" - istanbul-lib-hook "^1.0.5" - istanbul-lib-instrument "^1.7.0" - istanbul-lib-report "^1.0.0" - istanbul-lib-source-maps "^1.1.1" - istanbul-reports "^1.0.2" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" md5-hex "^1.2.0" merge-source-map "^1.0.2" micromatch "^2.3.11" @@ -4112,9 +4168,9 @@ nyc@^10.2.0: rimraf "^2.5.4" signal-exit "^3.0.1" spawn-wrap "1.2.4" - test-exclude "^4.0.0" - yargs "^7.0.2" - yargs-parser "^4.0.2" + test-exclude "^4.1.0" + yargs "^7.1.0" + yargs-parser "^5.0.0" oauth-sign@~0.8.1: version "0.8.2" @@ -4447,6 +4503,10 @@ pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +pn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.0.0.tgz#1cf5a30b0d806cd18f88fc41a6b5d4ad615b3ba9" + post-compile-webpack-plugin@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/post-compile-webpack-plugin/-/post-compile-webpack-plugin-0.1.1.tgz#1b1a0eea890ce748556ca49e066a48c900e0b370" @@ -4810,26 +4870,26 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -punycode@^1.2.4, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + q@^1.1.2: version "1.5.0" resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" +qs@6.4.0, qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" -qs@~6.4.0, qs@6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" - query-string@^4.1.0: version "4.3.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.3.tgz#91c90ff7173d9acd9e088b3cc223f9b437865692" @@ -4841,7 +4901,7 @@ querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" -querystring@^0.2.0, querystring@0.2.0: +querystring@0.2.0, querystring@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" @@ -4899,6 +4959,15 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" +readable-stream@1.0: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" @@ -4911,15 +4980,6 @@ read-pkg@^2.0.0: string_decoder "~1.0.0" util-deprecate "~1.0.1" -readable-stream@1.0: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -5076,6 +5136,31 @@ request-promise-native@^1.0.3: request-promise-core "1.1.1" stealthy-require "^1.0.0" +request@2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + request@^2.79.0, request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -5103,31 +5188,6 @@ request@^2.79.0, request@^2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" -request@2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5165,9 +5225,9 @@ resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: path-parse "^1.0.5" @@ -5191,7 +5251,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -5231,7 +5291,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, "semver@2 || 3 || 4 || 5", semver@5.3.0: +"semver@2 || 3 || 4 || 5", semver@5.3.0, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -5253,11 +5313,29 @@ send@0.15.1: range-parser "~1.2.0" statuses "~1.3.1" +send@0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.15.2.tgz#f91fab4403bcf87e716f70ceb5db2f578bdc17d6" + dependencies: + debug "2.6.4" + depd "~1.1.0" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.8.0" + fresh "0.5.0" + http-errors "~1.6.1" + mime "1.3.4" + ms "1.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.1" + serialize-javascript@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.3.0.tgz#86a4f3752f5c7e47295449b0bbb63d64ba533f05" -serve-static@^1.12.1, serve-static@1.12.1: +serve-static@1.12.1: version "1.12.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.1.tgz#7443a965e3ced647aceb5639fa06bf4d1bbe0039" dependencies: @@ -5266,6 +5344,15 @@ serve-static@^1.12.1, serve-static@1.12.1: parseurl "~1.3.1" send "0.15.1" +serve-static@^1.12.2: + version "1.12.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.2.tgz#e546e2726081b81b4bcec8e90808ebcdd323afba" + dependencies: + encodeurl "~1.0.1" + escape-html "~1.0.3" + parseurl "~1.3.1" + send "0.15.2" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -5346,16 +5433,16 @@ source-map-support@^0.4.0, source-map-support@^0.4.2: dependencies: source-map "^0.5.6" +source-map@0.5.6, source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3, source-map@0.5.6, source-map@0.5.x: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" @@ -5443,16 +5530,6 @@ strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" -string_decoder@^0.10.25, string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string_decoder@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" - dependencies: - buffer-shims "~1.0.0" - string-length@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" @@ -5474,6 +5551,16 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" +string_decoder@^0.10.25, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" + dependencies: + buffer-shims "~1.0.0" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -5594,9 +5681,9 @@ term-size@^0.1.0: dependencies: execa "^0.4.0" -test-exclude@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -5608,10 +5695,6 @@ text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -5619,6 +5702,10 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + time-require@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/time-require/-/time-require-0.1.2.tgz#f9e12cb370fc2605e11404582ba54ef5ca2b2d98" @@ -5756,6 +5843,10 @@ unique-temp-dir@^1.0.0: os-tmpdir "^1.0.1" uid2 "0.0.3" +universalify@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" + unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -5815,7 +5906,7 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -util@^0.10.3, util@0.10.3: +util@0.10.3, util@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" dependencies: @@ -5864,13 +5955,13 @@ vm-browserify@0.0.4: dependencies: indexof "0.0.1" -vue-hot-reload-api@^2.0.11: +vue-hot-reload-api@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.1.0.tgz#9ca58a6e0df9078554ce1708688b6578754d86de" -vue-loader@^11.3.4: - version "11.3.4" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-11.3.4.tgz#65e10a44ce092d906e14bbc72981dec99eb090d2" +vue-loader@^12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-12.0.2.tgz#f539036b1e0e9516b474a8fd1b5f533145248406" dependencies: consolidate "^0.14.0" hash-sum "^1.0.2" @@ -5880,9 +5971,10 @@ vue-loader@^11.3.4: postcss "^5.0.21" postcss-load-config "^1.1.0" postcss-selector-parser "^2.0.0" + resolve "^1.3.3" source-map "^0.5.6" - vue-hot-reload-api "^2.0.11" - vue-style-loader "^2.0.0" + vue-hot-reload-api "^2.1.0" + vue-style-loader "^3.0.0" vue-template-es2015-compiler "^1.2.2" vue-meta@^0.5.6: @@ -5893,43 +5985,38 @@ vue-meta@^0.5.6: lodash.isplainobject "^4.0.6" object-assign "^4.1.0" -vue-router@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-2.4.0.tgz#56a635e1434a1966ac095f2a485bebdcfc36cec5" +vue-router@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-2.5.2.tgz#870db3b63ead0aab4cd0bac63a7b81341c593f56" -vue-server-renderer@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.2.6.tgz#0a20535544b6948bca076380d058e19bb1304eef" +vue-server-renderer@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.3.0.tgz#2bca0dc11ff47226b70851aa78c579a0db3d5464" dependencies: - de-indent "^1.0.2" + chalk "^1.1.3" + hash-sum "^1.0.2" he "^1.1.0" + lodash.template "^4.4.0" resolve "^1.2.0" + serialize-javascript "^1.3.0" source-map "0.5.6" - vue-ssr-html-stream "^2.1.0" -vue-ssr-html-stream@^2.1.0, vue-ssr-html-stream@^2.2.0: +vue-ssr-html-stream@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/vue-ssr-html-stream/-/vue-ssr-html-stream-2.2.0.tgz#56d78b96c9c172b43749a324c156e888aca96d92" dependencies: serialize-javascript "^1.3.0" -vue-ssr-webpack-plugin@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/vue-ssr-webpack-plugin/-/vue-ssr-webpack-plugin-3.0.0.tgz#db47769ed8e71c8eb53aa9ae7be9ff04baf546fa" - dependencies: - chalk "^1.1.3" - hash-sum "^1.0.2" - -vue-style-loader@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-2.0.5.tgz#f0efac992febe3f12e493e334edb13cd235a3d22" +vue-style-loader@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-3.0.1.tgz#c8b639bb2f24baf9d78274dc17e4f264c1deda08" dependencies: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-template-compiler@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.2.6.tgz#2e2928daf0cd0feca9dfc35a9729adeae173ec68" +vue-template-compiler@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.3.0.tgz#a89a17064b68e182569da51ebbedd71ce57f93bf" dependencies: de-indent "^1.0.2" he "^1.1.0" @@ -5938,13 +6025,13 @@ vue-template-es2015-compiler@^1.2.2: version "1.5.2" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.5.2.tgz#a0a6c50c941d2a4abda963f2f42c337ac450ee95" -vue@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.2.6.tgz#451714b394dd6d4eae7b773c40c2034a59621aed" - -vuex@^2.3.0: +vue@^2.3.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.3.0.tgz#600048bef1682d657a6f3b7b1ffb44898703f2b4" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.3.0.tgz#bc44db0488c5245c788304c7683efe7b4c862d82" + +vuex@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.3.1.tgz#cde8e997c1f9957719bc7dea154f9aa691d981a6" watchpack@^1.3.1: version "1.3.1" @@ -5977,9 +6064,9 @@ webpack-bundle-analyzer@^2.4.0: mkdirp "^0.5.1" opener "^1.4.3" -webpack-dev-middleware@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.10.1.tgz#c6b4cf428139cf1aefbe06a0c00fdb4f8da2f893" +webpack-dev-middleware@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.10.2.tgz#2e252ce1dfb020dbda1ccb37df26f30ab014dbd1" dependencies: memory-fs "~0.4.1" mime "^1.3.4" @@ -6075,18 +6162,14 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wordwrap@0.0.2, wordwrap@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -6153,7 +6236,7 @@ yallist@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yargs-parser@^4.0.2, yargs-parser@^4.2.0: +yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" dependencies: @@ -6183,7 +6266,7 @@ yargs@^6.0.0: y18n "^3.2.1" yargs-parser "^4.2.0" -yargs@^7.0.2: +yargs@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" dependencies: @@ -6209,4 +6292,3 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" - From 8391f308b791f6b782a592ecaab13e1fa4e99b67 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 01:40:56 +0430 Subject: [PATCH 09/21] [jsdom] use new VirtualConsole constructor --- lib/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/render.js b/lib/render.js index d70ebbf449..92522571fa 100644 --- a/lib/render.js +++ b/lib/render.js @@ -136,7 +136,7 @@ export function renderAndGetWindow (url, opts = {}) { process.exit(1) } } - let virtualConsole = jsdom.createVirtualConsole().sendTo(console) + let virtualConsole = new jsdom.VirtualConsole().sendTo(console) if (opts.virtualConsole === false) { virtualConsole = undefined } From 56c39bea88a6927b21271cf67388379e7999fc03 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 02:39:40 +0430 Subject: [PATCH 10/21] fix tests --- lib/build.js | 10 +++++++--- lib/render.js | 8 +++++--- test/dynamic-routes.test.js | 11 +++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/build.js b/lib/build.js index 45a2c1f88a..0c7f6bb081 100644 --- a/lib/build.js +++ b/lib/build.js @@ -43,6 +43,10 @@ let webpackStats = 'none' // force green color debug.color = 2 +// temporary fix for vuejs/vue#5540 until new vue server renderer release +const uniq = require('lodash').uniq +const fixClientManifest = manifest => Object.assign(manifest, {initial: uniq(manifest.initial)}) + const defaults = { analyze: false, publicPath: '/_nuxt/', @@ -105,7 +109,7 @@ export function options () { if (fs.existsSync(bundlePath) && fs.existsSync(manifestPath)) { const bundle = fs.readFileSync(bundlePath, 'utf8') const manifest = fs.readFileSync(manifestPath, 'utf8') - createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) + createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) addAppTemplate.call(this) } } @@ -431,7 +435,7 @@ function webpackWatchAndUpdate () { } else { const bundle = serverFS.readFileSync(bundlePath, 'utf8') const manifest = clientFS.readFileSync(manifestPath, 'utf8') - createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) + createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) } } this.watchHandler = watchHandler @@ -464,7 +468,7 @@ function webpackRunServer () { readFile(bundlePath, 'utf8') .then((bundle) => readFile(manifestPath, 'utf8') .then(manifest => { - createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) + createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) resolve() })) }) diff --git a/lib/render.js b/lib/render.js index 92522571fa..7de47efe3d 100644 --- a/lib/render.js +++ b/lib/render.js @@ -128,7 +128,8 @@ export function renderAndGetWindow (url, opts = {}) { /* istanbul ignore if */ if (!jsdom) { try { - jsdom = require('jsdom') + // https://github.com/tmpvar/jsdom/blob/master/lib/old-api.md + jsdom = require('jsdom/lib/old-api') } catch (e) { console.error('Fail when calling nuxt.renderAndGetWindow(url)') // eslint-disable-line no-console console.error('jsdom module is not installed') // eslint-disable-line no-console @@ -136,13 +137,14 @@ export function renderAndGetWindow (url, opts = {}) { process.exit(1) } } - let virtualConsole = new jsdom.VirtualConsole().sendTo(console) + let virtualConsole = jsdom.createVirtualConsole().sendTo(console) + // let virtualConsole = new jsdom.VirtualConsole().sendTo(console) if (opts.virtualConsole === false) { virtualConsole = undefined } url = url || 'http://localhost:3000' return new Promise((resolve, reject) => { - jsdom.env({ + return jsdom.env({ url: url, features: { FetchExternalResources: ['script', 'link'], diff --git a/test/dynamic-routes.test.js b/test/dynamic-routes.test.js index e7ca8c9746..1c5f64b565 100644 --- a/test/dynamic-routes.test.js +++ b/test/dynamic-routes.test.js @@ -17,12 +17,11 @@ test.before('Init Nuxt.js', async t => { test('Check .nuxt/router.js', t => { return readFile(resolve(__dirname, './fixtures/dynamic-routes/.nuxt/router.js'), 'utf-8') .then((routerFile) => { - routerFile = routerFile.slice( - routerFile.indexOf('routes: ['), - -3 - ) - .replace('routes: [', '[') - .replace(/ _[0-9A-z]+,/g, ' "",') + routerFile = routerFile + .slice(routerFile.indexOf('routes: [')) + .replace('routes: [', '[') + .replace(/ _[0-9A-z]+,/g, ' "",') + .replace('})', '') let routes = eval('( ' + routerFile + ')') // eslint-disable-line no-eval // pages/index.vue t.is(routes[0].path, '/') From 379fb753ca78c9ab31d7b565f4d98fdc551aad2f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 02:47:28 +0430 Subject: [PATCH 11/21] [ci] drop node<6 This is because jsdom no longer supports this environments --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07ba1ee4b9..7db39d1a44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: node_js node_js: - "7.2" - "6.9" - - "5.12" - - "4.7" before_install: - if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi install: From 87172100c7cc237a5d1d0f2efe8997c0df7ce902 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 16:28:25 +0430 Subject: [PATCH 12/21] [vue-loader] allow using builtin extractCSS functionality This option is disabled by default and won't affect exiting users. However users can easily enable this option using `nuxt.build.extractCSS` Implementation is according to: - https://github.com/vuejs/vue-loader/tree/master/docs/en/configurations - https://ssr.vuejs.org/en/css.html - https://github.com/vuejs/vue-hackernews-2.0/tree/master/build --- examples/custom-build/nuxt.config.js | 1 + lib/build.js | 1 + lib/webpack/base.config.js | 18 +++++++++++++----- lib/webpack/client.config.js | 16 ++++++++++++++-- lib/webpack/helpers.js | 15 +++++++++++++++ lib/webpack/vue-loader.config.js | 18 +++++++++++------- package.json | 1 + 7 files changed, 56 insertions(+), 14 deletions(-) create mode 100755 lib/webpack/helpers.js diff --git a/examples/custom-build/nuxt.config.js b/examples/custom-build/nuxt.config.js index 08a9858644..5c0ff6fbae 100644 --- a/examples/custom-build/nuxt.config.js +++ b/examples/custom-build/nuxt.config.js @@ -1,6 +1,7 @@ module.exports = { build: { filenames: { + css: 'styles.[chunkhash].css', // default: common.[chunkhash].css manifest: 'manifest.[hash].js', // default: manifest.[hash].js vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js diff --git a/lib/build.js b/lib/build.js index 0c7f6bb081..f0a2a9e58d 100644 --- a/lib/build.js +++ b/lib/build.js @@ -51,6 +51,7 @@ const defaults = { analyze: false, publicPath: '/_nuxt/', filenames: { + css: 'common.[chunkhash].css', manifest: 'manifest.[hash].js', vendor: 'vendor.bundle.[hash].js', app: 'nuxt.bundle.[chunkhash].js' diff --git a/lib/webpack/base.config.js b/lib/webpack/base.config.js index c27efb6e49..ae163e5914 100644 --- a/lib/webpack/base.config.js +++ b/lib/webpack/base.config.js @@ -4,6 +4,8 @@ import vueLoaderConfig from './vue-loader.config' import { defaults } from 'lodash' import { join } from 'path' import { isUrl, urlJoin } from '../utils' +import { styleLoader, extractStyles } from './helpers' +import ExtractTextPlugin from 'extract-text-webpack-plugin' /* |-------------------------------------------------------------------------- @@ -71,15 +73,21 @@ export default function ({ isClient, isServer }) { cacheDirectory: !!this.dev }) }, - { test: /\.css$/, loader: 'vue-style-loader!css-loader' }, - { test: /\.less$/, loader: 'vue-style-loader!css-loader!less-loader' }, - { test: /\.sass$/, loader: 'vue-style-loader!css-loader!sass-loader?indentedSyntax' }, - { test: /\.scss$/, loader: 'vue-style-loader!css-loader!sass-loader' }, - { test: /\.styl(us)?$/, loader: 'vue-style-loader!css-loader!stylus-loader' } + { test: /\.css$/, use: styleLoader.call(this, 'css') }, + { test: /\.less$/, use: styleLoader.call(this, 'less', 'less-loader') }, + { test: /\.sass$/, use: styleLoader.call(this, 'sass', 'sass-loader?indentedSyntax') }, + { test: /\.scss$/, use: styleLoader.call(this, 'sass', 'sass-loader') }, + { test: /\.styl(us)?$/, use: styleLoader.call(this, 'stylus', 'stylus-loader') } ] }, plugins: this.options.build.plugins } + // CSS extraction + if (extractStyles.call(this)) { + config.plugins.push( + new ExtractTextPlugin({filename: this.options.build.filenames.css}) + ) + } // Add nuxt build loaders (can be configured in nuxt.config.js) config.module.rules = config.module.rules.concat(this.options.build.loaders) // Return config diff --git a/lib/webpack/client.config.js b/lib/webpack/client.config.js index 2ebdf1551a..f4054c05e0 100644 --- a/lib/webpack/client.config.js +++ b/lib/webpack/client.config.js @@ -3,12 +3,14 @@ import { each, defaults } from 'lodash' import webpack from 'webpack' import VueSSRClientPlugin from 'vue-server-renderer/client-plugin' +import ExtractTextPlugin from 'extract-text-webpack-plugin' import HTMLPlugin from 'html-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' import ProgressBarPlugin from 'progress-bar-webpack-plugin' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' import OfflinePlugin from 'offline-plugin' import base from './base.config.js' +import { extractStyles } from './helpers' import { resolve } from 'path' /* @@ -55,9 +57,18 @@ export default function () { // Extract vendor chunks for better caching new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', - filename: this.options.build.filenames.vendor + filename: this.options.build.filenames.vendor, + minChunks (module) { + // A module is extracted into the vendor chunk when... + return ( + // If it's inside node_modules + /node_modules/.test(module.context) && + // Do not externalize if the request is a CSS file + !/\.css$/.test(module.request) + ) + } }), - // Extract manifest + // Extract webpack runtime & manifest new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', minChunks: Infinity, @@ -68,6 +79,7 @@ export default function () { template: this.options.appTemplatePath, inject: false // <- Resources will be injected using vue server renderer }), + // Generate client manifest json new VueSSRClientPlugin({ filename: 'client-manifest.json' }) diff --git a/lib/webpack/helpers.js b/lib/webpack/helpers.js new file mode 100755 index 0000000000..9681212994 --- /dev/null +++ b/lib/webpack/helpers.js @@ -0,0 +1,15 @@ +import ExtractTextPlugin from 'extract-text-webpack-plugin' + +export function extractStyles(ext) { + return !this.dev && !!this.options.build.extractCSS && this.options.build.extractCSS[ext] !== false +} + +export function styleLoader(ext, loader = []) { + if (!extractStyles.call(this, ext)) { + return ['vue-style-loader', 'css-loader'].concat(loader) + } + return ExtractTextPlugin.extract({ + use: ['css-loader?minimize'].concat(loader), + fallback: 'vue-style-loader' + }) +} diff --git a/lib/webpack/vue-loader.config.js b/lib/webpack/vue-loader.config.js index d419725ddf..4e2335e42f 100644 --- a/lib/webpack/vue-loader.config.js +++ b/lib/webpack/vue-loader.config.js @@ -1,6 +1,7 @@ 'use strict' import { defaults } from 'lodash' +import { extractStyles, styleLoader } from './helpers' export default function ({ isClient }) { let babelOptions = JSON.stringify(defaults(this.options.build.babel, { @@ -8,18 +9,21 @@ export default function ({ isClient }) { babelrc: false, cacheDirectory: !!this.dev })) + + // https://github.com/vuejs/vue-loader/blob/master/docs/en/configurations let config = { postcss: this.options.build.postcss, loaders: { 'js': 'babel-loader?' + babelOptions, - 'css': 'vue-style-loader!css-loader', - 'less': 'vue-style-loader!css-loader!less-loader', - 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', - 'scss': 'vue-style-loader!css-loader!sass-loader', - 'stylus': 'vue-style-loader!css-loader!stylus-loader', - 'styl': 'vue-style-loader!css-loader!stylus-loader' + 'css': styleLoader.call(this, 'css'), + 'less': styleLoader.call(this, 'less', 'less-loader'), + 'sass': styleLoader.call(this, 'sass', 'sass-loader?indentedSyntax'), + 'scss': styleLoader.call(this, 'sass', 'scss-loader'), + 'stylus': styleLoader.call(this, 'stylus', 'stylus-loader'), + 'styl': styleLoader.call(this, 'stylus', 'stylus-loader') }, - preserveWhitespace: false + preserveWhitespace: false, + extractCSS: extractStyles.call(this, 'vue') } // Return the config return config diff --git a/package.json b/package.json index 51ca8a4b19..089e5e938a 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "compression": "^1.6.2", "css-loader": "^0.28.0", "debug": "^2.6.6", + "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", "friendly-errors-webpack-plugin": "^1.6.1", "fs-extra": "^3.0.0", From 2e75f22a08ae84758b2887b733c812aaa4ce22df Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 17:10:04 +0430 Subject: [PATCH 13/21] add options.ssr This allows setting custom vue renderer options. including: - shouldPreload(file, type) - runInNewContext - directives https://ssr.vuejs.org/en/api.html#renderer-options --- lib/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/build.js b/lib/build.js index f0a2a9e58d..59f46f1df8 100644 --- a/lib/build.js +++ b/lib/build.js @@ -486,10 +486,10 @@ function createRenderer (bundle, manifest) { maxAge: 1000 * 60 * 15 })) } - this.renderer = createBundleRenderer(bundle, { + this.renderer = createBundleRenderer(bundle, Object.assign({ cache: cacheConfig, clientManifest: manifest - }) + }, this.options.ssr)) this.renderToString = pify(this.renderer.renderToString) this.renderToStream = this.renderer.renderToStream } From 6ee5d958a76babc10e5714db789232377dbc7c18 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 30 Apr 2017 17:24:14 +0430 Subject: [PATCH 14/21] cleanups --- examples/custom-build/nuxt.config.js | 2 +- lib/build.js | 2 +- lib/render.js | 2 +- yarn.lock | 62 ++++++++++++++-------------- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/examples/custom-build/nuxt.config.js b/examples/custom-build/nuxt.config.js index 5c0ff6fbae..22ba1217a6 100644 --- a/examples/custom-build/nuxt.config.js +++ b/examples/custom-build/nuxt.config.js @@ -1,7 +1,7 @@ module.exports = { build: { filenames: { - css: 'styles.[chunkhash].css', // default: common.[chunkhash].css + css: 'styles.[chunkhash].css', // default: common.[chunkhash].css manifest: 'manifest.[hash].js', // default: manifest.[hash].js vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js diff --git a/lib/build.js b/lib/build.js index 59f46f1df8..9c3bd99e2a 100644 --- a/lib/build.js +++ b/lib/build.js @@ -467,7 +467,7 @@ function webpackRunServer () { const bundlePath = join(serverConfig.output.path, 'server-bundle.json') const manifestPath = join(serverConfig.output.path, 'client-manifest.json') readFile(bundlePath, 'utf8') - .then((bundle) => readFile(manifestPath, 'utf8') + .then(bundle => readFile(manifestPath, 'utf8') .then(manifest => { createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) resolve() diff --git a/lib/render.js b/lib/render.js index 7de47efe3d..5434d1c66d 100644 --- a/lib/render.js +++ b/lib/render.js @@ -144,7 +144,7 @@ export function renderAndGetWindow (url, opts = {}) { } url = url || 'http://localhost:3000' return new Promise((resolve, reject) => { - return jsdom.env({ + jsdom.env({ url: url, features: { FetchExternalResources: ['script', 'link'], diff --git a/yarn.lock b/yarn.lock index 2fab195043..fca119a8c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -86,7 +86,7 @@ ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0, ajv@^4.9.1: +ajv@^4.11.2, ajv@^4.7.0, ajv@^4.9.1: version "4.11.7" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" dependencies: @@ -1031,14 +1031,14 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24 lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.16.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" - -babylon@^6.17.0: +babylon@^6.1.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: version "6.17.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" +babylon@^6.11.0: + version "6.16.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" + balanced-match@^0.4.1, balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -1871,19 +1871,13 @@ debug@2.6.1: dependencies: ms "0.7.2" -debug@2.6.3, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" - dependencies: - ms "0.7.2" - debug@2.6.4: version "2.6.4" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" dependencies: ms "0.7.3" -debug@^2.6.3, debug@^2.6.6: +debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.6: version "2.6.6" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" dependencies: @@ -2494,6 +2488,15 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" +extract-text-webpack-plugin@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-2.1.0.tgz#69315b885f876dbf96d3819f6a9f1cca7aebf159" + dependencies: + ajv "^4.11.2" + async "^2.1.2" + loader-utils "^1.0.2" + webpack-sources "^0.1.0" + extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" @@ -2550,7 +2553,7 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -finalhandler@^1.0.2: +finalhandler@^1.0.2, finalhandler@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.2.tgz#d0e36f9dbc557f2de14423df6261889e9d60c93a" dependencies: @@ -2562,18 +2565,6 @@ finalhandler@^1.0.2: statuses "~1.3.1" unpipe "~1.0.0" -finalhandler@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.1.tgz#bcd15d1689c0e5ed729b6f7f541a6df984117db8" - dependencies: - debug "2.6.3" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.1" - statuses "~1.3.1" - unpipe "~1.0.0" - find-cache-dir@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" @@ -3963,11 +3954,11 @@ ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.2, ms@^0.7.1: +ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" -ms@0.7.3: +ms@0.7.3, ms@^0.7.1: version "0.7.3" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" @@ -5419,7 +5410,7 @@ sort-keys@^1.0.0, sort-keys@^1.1.1, sort-keys@^1.1.2: dependencies: is-plain-obj "^1.0.0" -source-list-map@^0.1.7: +source-list-map@^0.1.7, source-list-map@~0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" @@ -5989,7 +5980,7 @@ vue-router@^2.5.2: version "2.5.2" resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-2.5.2.tgz#870db3b63ead0aab4cd0bac63a7b81341c593f56" -vue-server-renderer@^2.3.0: +vue-server-renderer@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.3.0.tgz#2bca0dc11ff47226b70851aa78c579a0db3d5464" dependencies: @@ -6014,7 +6005,7 @@ vue-style-loader@^3.0.0: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-template-compiler@^2.3.0: +vue-template-compiler@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.3.0.tgz#a89a17064b68e182569da51ebbedd71ce57f93bf" dependencies: @@ -6025,7 +6016,7 @@ vue-template-es2015-compiler@^1.2.2: version "1.5.2" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.5.2.tgz#a0a6c50c941d2a4abda963f2f42c337ac450ee95" -vue@^2.3.0: +vue@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/vue/-/vue-2.3.0.tgz#bc44db0488c5245c788304c7683efe7b4c862d82" @@ -6086,6 +6077,13 @@ webpack-node-externals@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.5.4.tgz#ea05ba17108a23e776c35c42e7bb0e86c225be00" +webpack-sources@^0.1.0: + version "0.1.5" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.5.tgz#aa1f3abf0f0d74db7111c40e500b84f966640750" + dependencies: + source-list-map "~0.1.7" + source-map "~0.5.3" + webpack-sources@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb" From 74652e3974b1092b00ac11f008005fd144afd2c1 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 2 May 2017 14:57:39 +0800 Subject: [PATCH 15/21] make use of runInNewContext: false --- lib/app/client.js | 4 +- lib/app/index.js | 161 ++++++++++++++++++++++++---------------------- lib/app/router.js | 20 +++--- lib/app/server.js | 5 +- lib/app/store.js | 14 +++- lib/build.js | 3 +- 6 files changed, 115 insertions(+), 92 deletions(-) diff --git a/lib/app/client.js b/lib/app/client.js index 3627902d87..793c631983 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -2,13 +2,15 @@ import Vue from 'vue' import middleware from './middleware' -import { app, router<%= (store ? ', store' : '') %>, NuxtError } from './index' +import { createApp, NuxtError } from './index' import { applyAsyncData, getMatchedComponents, getMatchedComponentsInstances, flatMapComponents, getContext, promiseSeries, promisify, getLocation, compile } from './utils' const noopData = () => { return {} } const noopFetch = () => {} let _lastPaths = [] let _lastComponentsFiles = [] +const { app, router<%= (store ? ', store' : '') %> } = createApp() + function mapTransitions(Components, to, from) { return Components.map((Component) => { let transition = Component.options.transition diff --git a/lib/app/index.js b/lib/app/index.js index 17b7269867..87fa679d36 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -2,8 +2,8 @@ import Vue from 'vue' import Meta from 'vue-meta' -import router from './router.js' -<% if (store) { %>import store from './store.js'<% } %> +import { createRouter } from './router.js' +<% if (store) { %>import { createStore } from './store.js'<% } %> import NuxtChild from './components/nuxt-child.js' import NuxtLink from './components/nuxt-link.js' import NuxtError from '<%= components.ErrorPage ? components.ErrorPage : "./components/nuxt-error.vue" %>' @@ -25,86 +25,95 @@ Vue.use(Meta, { tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag }) -if (process.browser) { - <% if (store) { %> - // Replace store state before calling plugins - if (window.__NUXT__ && window.__NUXT__.state) { - store.replaceState(window.__NUXT__.state) - } - <% } %> - // window.onNuxtReady(() => console.log('Ready')) hook - // Useful for jsdom testing or plugins (https://github.com/tmpvar/jsdom#dealing-with-asynchronous-script-loading) - window._nuxtReadyCbs = [] - window.onNuxtReady = function (cb) { - window._nuxtReadyCbs.push(cb) - } -} - -// root instance -// here we inject the router and store to all child components, -// making them available everywhere as `this.$router` and `this.$store`. const defaultTransition = <%= -serialize(transition) -.replace('beforeEnter(', 'function(').replace('enter(', 'function(').replace('afterEnter(', 'function(') -.replace('enterCancelled(', 'function(').replace('beforeLeave(', 'function(').replace('leave(', 'function(') -.replace('afterLeave(', 'function(').replace('leaveCancelled(', 'function(') -%> -let app = { - router, - <%= (store ? 'store,' : '') %> - _nuxt: { - defaultTransition: defaultTransition, - transitions: [ defaultTransition ], - setTransitions (transitions) { - if (!Array.isArray(transitions)) { - transitions = [ transitions ] - } - transitions = transitions.map((transition) => { - if (!transition) { - transition = defaultTransition - } else if (typeof transition === 'string') { - transition = Object.assign({}, defaultTransition, { name: transition }) - } else { - transition = Object.assign({}, defaultTransition, transition) - } - return transition - }) - this.$options._nuxt.transitions = transitions - return transitions - }, - err: null, - dateErr: null, - error (err) { - err = err || null - if (typeof err === 'string') { - err = { statusCode: 500, message: err } - } - this.$options._nuxt.dateErr = Date.now() - this.$options._nuxt.err = err; - return err + serialize(transition) + .replace('beforeEnter(', 'function(').replace('enter(', 'function(').replace('afterEnter(', 'function(') + .replace('enterCancelled(', 'function(').replace('beforeLeave(', 'function(').replace('leave(', 'function(') + .replace('afterLeave(', 'function(').replace('leaveCancelled(', 'function(') + %> + +export { NuxtError } + +export function createApp (ssrContext) { + const store = createStore() + const router = createRouter() + + if (process.browser) { + <% if (store) { %> + // Replace store state before calling plugins + if (window.__NUXT__ && window.__NUXT__.state) { + store.replaceState(window.__NUXT__.state) } - }, - ...App -} + <% } %> + // window.onNuxtReady(() => console.log('Ready')) hook + // Useful for jsdom testing or plugins (https://github.com/tmpvar/jsdom#dealing-with-asynchronous-script-loading) + window._nuxtReadyCbs = [] + window.onNuxtReady = function (cb) { + window._nuxtReadyCbs.push(cb) + } + } + + // root instance + // here we inject the router and store to all child components, + // making them available everywhere as `this.$router` and `this.$store`. + let app = { + router, + <%= (store ? 'store,' : '') %> + ssrContext, + _nuxt: { + defaultTransition: defaultTransition, + transitions: [ defaultTransition ], + setTransitions (transitions) { + if (!Array.isArray(transitions)) { + transitions = [ transitions ] + } + transitions = transitions.map((transition) => { + if (!transition) { + transition = defaultTransition + } else if (typeof transition === 'string') { + transition = Object.assign({}, defaultTransition, { name: transition }) + } else { + transition = Object.assign({}, defaultTransition, transition) + } + return transition + }) + this.$options._nuxt.transitions = transitions + return transitions + }, + err: null, + dateErr: null, + error (err) { + err = err || null + if (typeof err === 'string') { + err = { statusCode: 500, message: err } + } + this.$options._nuxt.dateErr = Date.now() + this.$options._nuxt.err = err; + return err + } + }, + ...App + } -// Includes & Inject external plugins -<% plugins.forEach(function (plugin) { -if (plugin.ssr) { %> -<%= (plugin.injectAs ? 'let ' + plugin.injectAs + ' = ' : '') %>require('<%= plugin.src %>') -<% if (plugin.injectAs) { %> -<%= plugin.injectAs + ' = ' + plugin.injectAs + '.default || ' + plugin.injectAs %> -app['<%= plugin.injectAs %>'] = <%= plugin.injectAs %> -<% } -} else { %> -if (process.browser) { + // Includes & Inject external plugins + <% plugins.forEach(function (plugin) { + if (plugin.ssr) { %> <%= (plugin.injectAs ? 'let ' + plugin.injectAs + ' = ' : '') %>require('<%= plugin.src %>') <% if (plugin.injectAs) { %> <%= plugin.injectAs + ' = ' + plugin.injectAs + '.default || ' + plugin.injectAs %> app['<%= plugin.injectAs %>'] = <%= plugin.injectAs %> - <% } %> -} -<% } -}) %> + <% } + } else { %> + if (process.browser) { + <%= (plugin.injectAs ? 'let ' + plugin.injectAs + ' = ' : '') %>require('<%= plugin.src %>') + <% if (plugin.injectAs) { %> + <%= plugin.injectAs + ' = ' + plugin.injectAs + '.default || ' + plugin.injectAs %> + app['<%= plugin.injectAs %>'] = <%= plugin.injectAs %> + <% } %> + } + <% } + }) %> -export { app, router<%= (store ? ', store' : '') %>, NuxtError } + return { app, router<%= (store ? ', store' : '') %> } +} diff --git a/lib/app/router.js b/lib/app/router.js index 6e37b462e9..4d3dc71f64 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -53,12 +53,14 @@ const scrollBehavior = (to, from, savedPosition) => { } <% } %> -export default new Router({ - mode: '<%= router.mode %>', - base: '<%= router.base %>', - linkActiveClass: '<%= router.linkActiveClass %>', - scrollBehavior, - routes: [ -<%= _routes %> - ] -}) +export function createRouter () { + return new Router({ + mode: '<%= router.mode %>', + base: '<%= router.base %>', + linkActiveClass: '<%= router.linkActiveClass %>', + scrollBehavior, + routes: [ + <%= _routes %> + ] + }) +} diff --git a/lib/app/server.js b/lib/app/server.js index b0e0d62db8..ff50771a7a 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -7,11 +7,10 @@ import Vue from 'vue' import { stringify } from 'querystring' import { omit } from 'lodash' import middleware from './middleware' -import { app, router<%= (store ? ', store' : '') %>, NuxtError } from './index' +import { createApp, NuxtError } from './index' import { applyAsyncData, getMatchedComponents, getContext, promiseSeries, promisify, urlJoin } from './utils' const isDev = <%= isDev %> -const _app = new Vue(app) // This exported function will be called by `bundleRenderer`. // This is where we perform data-prefetching to determine the @@ -19,6 +18,8 @@ const _app = new Vue(app) // Since data fetching is async, this function is expected to // return a Promise that resolves to the app instance. export default context => { + const { app, router<%= (store ? ', store' : '') %> } = createApp(context) + const _app = new Vue(app) // Add store to the context <%= (store ? 'context.store = store' : '') %> // Nuxt object diff --git a/lib/app/store.js b/lib/app/store.js index acf94f07ac..0bad41e6e2 100644 --- a/lib/app/store.js +++ b/lib/app/store.js @@ -30,8 +30,11 @@ let storeData = {} if (filenames.indexOf('./index.js') !== -1) { let mainModule = getModule('./index.js') if (mainModule.commit) { - store = mainModule + console.error('[nuxt.js] store/index.js should export raw store options instead of an instance.') } else { + if (mainModule.state && typeof mainModule.state !== 'function') { + console.error('[nuxt.js] store state should be a function.') + } storeData = mainModule } } @@ -49,8 +52,13 @@ if (store == null) { name = namePath.pop() module[name] = getModule(filename) module[name].namespaced = true + + if (typeof module[name].state !== 'function') { + console.error('[nuxt.js] store module state should be a function.') + } } - store = new Vuex.Store(storeData) } -export default store +export function createStore () { + return new Vuex.Store(storeData) +} diff --git a/lib/build.js b/lib/build.js index 9c3bd99e2a..a0d2a0a8a8 100644 --- a/lib/build.js +++ b/lib/build.js @@ -488,7 +488,8 @@ function createRenderer (bundle, manifest) { } this.renderer = createBundleRenderer(bundle, Object.assign({ cache: cacheConfig, - clientManifest: manifest + clientManifest: manifest, + runInNewContext: false }, this.options.ssr)) this.renderToString = pify(this.renderer.renderToString) this.renderToStream = this.renderer.renderToStream From 670b1254dd481dc5748a34313c461e306a9e0352 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 13:46:51 +0430 Subject: [PATCH 16/21] [deps] upgrade Upgrades vue to 2.3.1 --- package.json | 12 ++++++------ yarn.lock | 38 ++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 089e5e938a..4ad08624aa 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "chokidar": "^1.6.1", "co": "^4.6.0", "compression": "^1.6.2", - "css-loader": "^0.28.0", + "css-loader": "^0.28.1", "debug": "^2.6.6", "extract-text-webpack-plugin": "^2.1.0", "file-loader": "^0.11.1", @@ -82,13 +82,13 @@ "serialize-javascript": "^1.3.0", "serve-static": "^1.12.2", "url-loader": "^0.5.8", - "vue": "~2.3.0", + "vue": "~2.3.1", "vue-loader": "^12.0.2", "vue-meta": "^0.5.6", - "vue-router": "^2.5.2", - "vue-server-renderer": "~2.3.0", + "vue-router": "^2.5.3", + "vue-server-renderer": "~2.3.1", "vue-ssr-html-stream": "^2.2.0", - "vue-template-compiler": "~2.3.0", + "vue-template-compiler": "~2.3.1", "vuex": "^2.3.1", "webpack": "^2.4.1", "webpack-bundle-analyzer": "^2.4.0", @@ -112,7 +112,7 @@ "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", "finalhandler": "^1.0.2", - "jsdom": "^10.0.0", + "jsdom": "^10.1.0", "json-loader": "^0.5.4", "nyc": "^10.3.0", "request": "^2.81.0", diff --git a/yarn.lock b/yarn.lock index fca119a8c1..8120c86eaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1721,9 +1721,9 @@ css-color-names@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" -css-loader@^0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.0.tgz#417cfa9789f8cde59a30ccbf3e4da7a806889bad" +css-loader@^0.28.1: + version "0.28.1" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.1.tgz#220325599f8f00452d9ceb4c3ca6c8a66798642d" dependencies: babel-code-frame "^6.11.0" css-selector-tokenizer "^0.7.0" @@ -1736,6 +1736,7 @@ css-loader@^0.28.0: postcss-modules-local-by-default "^1.0.1" postcss-modules-scope "^1.0.0" postcss-modules-values "^1.1.0" + postcss-value-parser "^3.3.0" source-list-map "^0.1.7" css-select@^1.1.0: @@ -3513,9 +3514,9 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-10.0.0.tgz#3dda0b760aa248dd9b1392f8bb82e93ad70377b4" +jsdom@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-10.1.0.tgz#7765e00fd5c3567f34985a1c86ff466a61dacc6a" dependencies: abab "^1.0.3" acorn "^4.0.4" @@ -5976,18 +5977,19 @@ vue-meta@^0.5.6: lodash.isplainobject "^4.0.6" object-assign "^4.1.0" -vue-router@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-2.5.2.tgz#870db3b63ead0aab4cd0bac63a7b81341c593f56" +vue-router@^2.5.3: + version "2.5.3" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-2.5.3.tgz#073783f564b6aece6c8a59c63e298dc2aabfb51b" -vue-server-renderer@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.3.0.tgz#2bca0dc11ff47226b70851aa78c579a0db3d5464" +vue-server-renderer@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.3.1.tgz#923f9e16db0635f10606cfc794f2a128a20def34" dependencies: chalk "^1.1.3" hash-sum "^1.0.2" he "^1.1.0" lodash.template "^4.4.0" + lodash.uniq "^4.5.0" resolve "^1.2.0" serialize-javascript "^1.3.0" source-map "0.5.6" @@ -6005,9 +6007,9 @@ vue-style-loader@^3.0.0: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-template-compiler@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.3.0.tgz#a89a17064b68e182569da51ebbedd71ce57f93bf" +vue-template-compiler@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.3.1.tgz#8bb63e10aca7b04ab31574bde11ed4b54516c711" dependencies: de-indent "^1.0.2" he "^1.1.0" @@ -6016,9 +6018,9 @@ vue-template-es2015-compiler@^1.2.2: version "1.5.2" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.5.2.tgz#a0a6c50c941d2a4abda963f2f42c337ac450ee95" -vue@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.3.0.tgz#bc44db0488c5245c788304c7683efe7b4c862d82" +vue@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.3.1.tgz#cecc3a229160747f3fb01eb2f03dd04e82420462" vuex@^2.3.1: version "2.3.1" From 8a25da81fbc596c5ac3b842276dbc7c13e327eed Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 14:05:09 +0430 Subject: [PATCH 17/21] [test] update fixtures store to return a function --- test/fixtures/basic/store/foo/bar.js | 6 ++++-- test/fixtures/with-config/store/index.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/fixtures/basic/store/foo/bar.js b/test/fixtures/basic/store/foo/bar.js index 43b5268f5e..c8163e596a 100644 --- a/test/fixtures/basic/store/foo/bar.js +++ b/test/fixtures/basic/store/foo/bar.js @@ -1,5 +1,7 @@ -export const state = { - baz: 'Vuex Nested Modules' +export const state = () => { + return { + baz: 'Vuex Nested Modules' + } } export const getters = { diff --git a/test/fixtures/with-config/store/index.js b/test/fixtures/with-config/store/index.js index e5ad937c65..20b0601fcf 100644 --- a/test/fixtures/with-config/store/index.js +++ b/test/fixtures/with-config/store/index.js @@ -3,7 +3,7 @@ import Vuex from 'vuex' Vue.use(Vuex) -const store = new Vuex.Store({ +const store = () => new Vuex.Store({ state: { counter: 0 }, From affbc9c81f30b737d6f428e81da2afcbf1df7851 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 14:31:15 +0430 Subject: [PATCH 18/21] fixClientManifest no needed as of vue 2.3.1 --- lib/build.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/build.js b/lib/build.js index a0d2a0a8a8..c9fcc9d2e6 100644 --- a/lib/build.js +++ b/lib/build.js @@ -43,10 +43,6 @@ let webpackStats = 'none' // force green color debug.color = 2 -// temporary fix for vuejs/vue#5540 until new vue server renderer release -const uniq = require('lodash').uniq -const fixClientManifest = manifest => Object.assign(manifest, {initial: uniq(manifest.initial)}) - const defaults = { analyze: false, publicPath: '/_nuxt/', @@ -110,7 +106,7 @@ export function options () { if (fs.existsSync(bundlePath) && fs.existsSync(manifestPath)) { const bundle = fs.readFileSync(bundlePath, 'utf8') const manifest = fs.readFileSync(manifestPath, 'utf8') - createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) addAppTemplate.call(this) } } @@ -436,7 +432,7 @@ function webpackWatchAndUpdate () { } else { const bundle = serverFS.readFileSync(bundlePath, 'utf8') const manifest = clientFS.readFileSync(manifestPath, 'utf8') - createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) } } this.watchHandler = watchHandler @@ -469,7 +465,7 @@ function webpackRunServer () { readFile(bundlePath, 'utf8') .then(bundle => readFile(manifestPath, 'utf8') .then(manifest => { - createRenderer.call(this, JSON.parse(bundle), fixClientManifest(JSON.parse(manifest))) + createRenderer.call(this, JSON.parse(bundle), JSON.parse(manifest)) resolve() })) }) @@ -489,7 +485,7 @@ function createRenderer (bundle, manifest) { this.renderer = createBundleRenderer(bundle, Object.assign({ cache: cacheConfig, clientManifest: manifest, - runInNewContext: false + runInNewContext: false }, this.options.ssr)) this.renderToString = pify(this.renderer.renderToString) this.renderToStream = this.renderer.renderToStream From a04a563f8d25b3397b0c258eff26599a9e3e9579 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 15:36:22 +0430 Subject: [PATCH 19/21] create store only when available --- lib/app/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/app/index.js b/lib/app/index.js index 87fa679d36..d3c2db8b9d 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -35,7 +35,9 @@ const defaultTransition = <%= export { NuxtError } export function createApp (ssrContext) { + <% if (store) { %> const store = createStore() + <% } %> const router = createRouter() if (process.browser) { From aeea3cb9eb4ab29e834d18cdbfb19fc75c706d8d Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 15:48:44 +0430 Subject: [PATCH 20/21] [tests] fix dynamic routes end of array detection --- test/dynamic-routes.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dynamic-routes.test.js b/test/dynamic-routes.test.js index 1c5f64b565..e52c09d718 100644 --- a/test/dynamic-routes.test.js +++ b/test/dynamic-routes.test.js @@ -21,7 +21,7 @@ test('Check .nuxt/router.js', t => { .slice(routerFile.indexOf('routes: [')) .replace('routes: [', '[') .replace(/ _[0-9A-z]+,/g, ' "",') - .replace('})', '') + routerFile = routerFile.substr(routerFile.indexOf('['), routerFile.lastIndexOf(']') + 1) let routes = eval('( ' + routerFile + ')') // eslint-disable-line no-eval // pages/index.vue t.is(routes[0].path, '/') From c3769f64e79e55e01d849c6748f88dcc62237c1d Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 2 May 2017 15:55:04 +0430 Subject: [PATCH 21/21] [tests] update error assertion Vue now gives better error "render function or template not defined in component" instead of "not_defined is not defined" --- test/error.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/error.test.js b/test/error.test.js index 4b6ebad14d..cca3f10147 100644 --- a/test/error.test.js +++ b/test/error.test.js @@ -37,7 +37,7 @@ test('/ with renderAndGetWindow()', async t => { await nuxt.renderAndGetWindow(url('/')) } catch (e) { t.true(e.message.includes('Could not load the nuxt app')) - t.true(e.body.includes('not_defined is not defined')) + t.true(e.body.includes('render function or template not defined in component')) } })