From becf2f2a6242a71e3b17f2962ab32b2ee806aa11 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Wed, 16 Nov 2016 11:46:58 +0900 Subject: [PATCH 01/18] Adds friendly error plugin --- package.json | 3 ++- server/build/webpack.js | 6 +++++- server/hot-reloader.js | 19 ++----------------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 8bd0a7b6..e63c6f12 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "babel-runtime": "6.11.6", "cross-spawn": "4.0.2", "del": "2.2.2", + "friendly-errors-webpack-plugin": "1.1.0", "glamor": "2.17.10", "glob-promise": "1.0.6", "htmlescape": "1.1.1", @@ -66,11 +67,11 @@ "react-dom": "15.3.2", "react-hot-loader": "3.0.0-beta.6", "send": "0.14.1", + "sockjs-client": "1.1.1", "strip-ansi": "3.0.1", "url": "0.11.0", "webpack": "1.13.2", "webpack-dev-server": "1.16.2", - "sockjs-client": "1.1.1", "write-file-webpack-plugin": "3.3.0" }, "devDependencies": { diff --git a/server/build/webpack.js b/server/build/webpack.js index cae825f9..6b478243 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -7,6 +7,7 @@ import WatchPagesPlugin from './plugins/watch-pages-plugin' import WatchRemoveEventPlugin from './plugins/watch-remove-event-plugin' import DynamicEntryPlugin from './plugins/dynamic-entry-plugin' import DetachPlugin from './plugins/detach-plugin' +import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' export default async function createCompiler (dir, { hotReload = false } = {}) { dir = resolve(dir) @@ -49,7 +50,10 @@ export default async function createCompiler (dir, { hotReload = false } = {}) { new DynamicEntryPlugin(), new UnlinkFilePlugin(), new WatchRemoveEventPlugin(), - new WatchPagesPlugin(dir) + new WatchPagesPlugin(dir), + new FriendlyErrorsWebpackPlugin({ + messages: ['Your application is running here http://localhost:3000'] + }) ] : [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, diff --git a/server/hot-reloader.js b/server/hot-reloader.js index eb776e7f..5b6fca16 100644 --- a/server/hot-reloader.js +++ b/server/hot-reloader.js @@ -82,23 +82,8 @@ export default class HotReloader { publicPath: '/', hot: true, noInfo: true, - clientLogLevel: 'warning', - stats: { - assets: false, - children: false, - chunks: false, - color: false, - errors: true, - errorDetails: false, - hash: false, - modules: false, - publicPath: false, - reasons: false, - source: false, - timings: false, - version: false, - warnings: false - } + quiet: true, + clientLogLevel: 'warning' }) } From 825d1878ffbdb71774e0adf9a9453acbed0d5ed3 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Wed, 16 Nov 2016 13:05:19 +0900 Subject: [PATCH 02/18] Removes unecessary and undisplayed default message --- server/build/webpack.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/build/webpack.js b/server/build/webpack.js index 6b478243..af7e0053 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -51,9 +51,7 @@ export default async function createCompiler (dir, { hotReload = false } = {}) { new UnlinkFilePlugin(), new WatchRemoveEventPlugin(), new WatchPagesPlugin(dir), - new FriendlyErrorsWebpackPlugin({ - messages: ['Your application is running here http://localhost:3000'] - }) + new FriendlyErrorsWebpackPlugin() ] : [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, From 89850322df0c1a1034bd02e336ad1712aea7b1ad Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 23 Nov 2016 15:56:47 +0000 Subject: [PATCH 03/18] Remove `developers` from LICENSE file (#290) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 991620e1..69b61253 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Zeit, Inc. developers +Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 3a6dd325a1cb84e8e288b251e0aa3a2d6ca2504a Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Wed, 23 Nov 2016 16:57:47 +0100 Subject: [PATCH 04/18] Rename LICENSE to LICENSE.md --- LICENSE => LICENSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE => LICENSE.md (100%) diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md From a14cc667204501de7eea5b561e0083a609473557 Mon Sep 17 00:00:00 2001 From: Naoyuki Kanezawa Date: Thu, 24 Nov 2016 03:32:49 +0900 Subject: [PATCH 05/18] Remove webpack-dev-server (#276) * remove webpack-dev-server * webpack: fix publicPath --- client/next-dev.js | 1 - client/webpack-dev-client/index.js | 167 --------------------- client/webpack-dev-client/socket.js | 39 ----- client/webpack-hot-middleware-client.js | 30 ++++ package.json | 4 +- server/build/plugins/watch-pages-plugin.js | 4 +- server/build/webpack.js | 6 +- server/hot-reloader.js | 55 ++++--- server/index.js | 4 + 9 files changed, 74 insertions(+), 236 deletions(-) delete mode 100644 client/webpack-dev-client/index.js delete mode 100644 client/webpack-dev-client/socket.js create mode 100644 client/webpack-hot-middleware-client.js diff --git a/client/next-dev.js b/client/next-dev.js index 823107bb..454365e3 100644 --- a/client/next-dev.js +++ b/client/next-dev.js @@ -1,5 +1,4 @@ import 'react-hot-loader/patch' -import './webpack-dev-client?http://localhost:3030' import * as next from './next' module.exports = next diff --git a/client/webpack-dev-client/index.js b/client/webpack-dev-client/index.js deleted file mode 100644 index 94c46564..00000000 --- a/client/webpack-dev-client/index.js +++ /dev/null @@ -1,167 +0,0 @@ -/* global __resourceQuery, next */ - -// Based on 'webpack-dev-server/client' - -import url from 'url' -import stripAnsi from 'strip-ansi' -import socket from './socket' - -function getCurrentScriptSource () { - // `document.currentScript` is the most accurate way to find the current script, - // but is not supported in all browsers. - if (document.currentScript) { - return document.currentScript.getAttribute('src') - } - // Fall back to getting all scripts in the document. - const scriptElements = document.scripts || [] - const currentScript = scriptElements[scriptElements.length - 1] - if (currentScript) { - return currentScript.getAttribute('src') - } - // Fail as there was no script to use. - throw new Error('[WDS] Failed to get current script source') -} - -let urlParts -if (typeof __resourceQuery === 'string' && __resourceQuery) { - // If this bundle is inlined, use the resource query to get the correct url. - urlParts = url.parse(__resourceQuery.substr(1)) -} else { - // Else, get the url from the