From efa4739519631f883bdcb23958706b10cbe5669b Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 19 Aug 2021 08:07:53 -0700 Subject: [PATCH 1/5] fix(plugin-webpack): fix deprecation warnings for dev-server@4.0.0 --- packages/plugin/webpack/src/WebpackPlugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index 0023b97158..046c4de113 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -302,9 +302,9 @@ Your packaged app may be larger than expected if you dont ignore everything othe config.plugins.push(pluginLogs); const compiler = webpack(config); - const webpackDevServer = new WebpackDevServer(compiler, this.devServerOptions()); - const server = await webpackDevServer.listen(this.port); - this.servers.push(server); + const webpackDevServer = new WebpackDevServer(this.devServerOptions(), compiler); + await webpackDevServer.start(this.port); + this.servers.push(webpackDevServer.server); }); await asyncOra('Compiling Preload Scripts', async () => { From 4177f4dcd37bdfc38551324a46c4c1f0b14114c2 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 19 Aug 2021 08:10:01 -0700 Subject: [PATCH 2/5] start doesn't take a port --- packages/plugin/webpack/src/WebpackPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index 046c4de113..8713707de8 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -303,7 +303,7 @@ Your packaged app may be larger than expected if you dont ignore everything othe const compiler = webpack(config); const webpackDevServer = new WebpackDevServer(this.devServerOptions(), compiler); - await webpackDevServer.start(this.port); + await webpackDevServer.start(); this.servers.push(webpackDevServer.server); }); From aaeb50822826b0d57865221b7145535a1bf872bb Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 19 Aug 2021 08:23:57 -0700 Subject: [PATCH 3/5] Deprecation warning changes require ^4.0.0 --- package.json | 2 +- packages/plugin/webpack/package.json | 2 +- yarn.lock | 30 +++++++++++----------------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index d379c5e764..c33773d86b 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "sudo-prompt": "^9.1.1", "username": "^5.1.0", "webpack": "^5.37.0", - "webpack-dev-server": "^4.0.0-rc.0", + "webpack-dev-server": "^4.0.0", "webpack-merge": "^5.7.3", "which": "^2.0.2", "xterm": "^4.9.0", diff --git a/packages/plugin/webpack/package.json b/packages/plugin/webpack/package.json index df8e195673..c5082376a3 100644 --- a/packages/plugin/webpack/package.json +++ b/packages/plugin/webpack/package.json @@ -31,7 +31,7 @@ "global": "^4.3.2", "html-webpack-plugin": "^5.3.1", "webpack": "^5.37.0", - "webpack-dev-server": "^4.0.0-rc.0", + "webpack-dev-server": "^4.0.0", "webpack-merge": "^5.7.3" } } diff --git a/yarn.lock b/yarn.lock index cf297b6266..b8675c9cd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5512,11 +5512,6 @@ ipaddr.js@^2.0.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0" integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== -is-absolute-url@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698" - integrity sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q== - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -6128,11 +6123,6 @@ keyv@^4.0.0: dependencies: json-buffer "3.0.1" -killable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" - integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== - kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -9832,14 +9822,15 @@ webpack-dev-middleware@^5.0.0: range-parser "^1.2.1" schema-utils "^3.0.0" -webpack-dev-server@^4.0.0-rc.0: - version "4.0.0-rc.0" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.0.0-rc.0.tgz#56099f1e1e877d15a1fc28a928f38bbc600e33da" - integrity sha512-9S+MywBN/ecr8AbXNVUnmbFji8UTtzLR6M5Dgy6sB5Ti/73UgHn8TMhLaSBZBkY/cmSmWHDSwUXFs8lOeARpOw== +webpack-dev-server@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.0.0.tgz#fb4906e91182154bba54a66e6e06f84c1e3c0a80" + integrity sha512-ya5cjoBSf3LqrshZn2HMaRZQx8YRNBE+tx+CQNFGaLLHrvs4Y1aik0sl5SFhLz2cW1O9/NtyaZhthc+8UiuvkQ== dependencies: ansi-html "^0.0.7" bonjour "^3.5.0" chokidar "^3.5.1" + colorette "^1.2.2" compression "^1.7.4" connect-history-api-fallback "^1.6.0" del "^6.0.0" @@ -9849,8 +9840,6 @@ webpack-dev-server@^4.0.0-rc.0: http-proxy-middleware "^2.0.0" internal-ip "^6.2.0" ipaddr.js "^2.0.1" - is-absolute-url "^3.0.3" - killable "^1.0.1" open "^8.0.9" p-retry "^4.5.0" portfinder "^1.0.28" @@ -9862,7 +9851,7 @@ webpack-dev-server@^4.0.0-rc.0: strip-ansi "^7.0.0" url "^0.11.0" webpack-dev-middleware "^5.0.0" - ws "^7.5.3" + ws "^8.1.0" webpack-merge@^5.7.3: version "5.8.0" @@ -10045,11 +10034,16 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.4.6, ws@^7.5.3: +ws@^7.4.6: version "7.5.3" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== +ws@^8.1.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.0.tgz#0b738cd484bfc9303421914b11bb4011e07615bb" + integrity sha512-uYhVJ/m9oXwEI04iIVmgLmugh2qrZihkywG9y5FfZV2ATeLIzHf93qs+tUNqlttbQK957/VX3mtwAS+UfIwA4g== + xml2js@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" From c0fcb37147b7678fba76e9c0f5111c75b9496011 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 19 Aug 2021 08:26:24 -0700 Subject: [PATCH 4/5] Fix manual typings --- typings/webpack-dev-server/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typings/webpack-dev-server/index.d.ts b/typings/webpack-dev-server/index.d.ts index 4f95464fef..89f2f58ea5 100644 --- a/typings/webpack-dev-server/index.d.ts +++ b/typings/webpack-dev-server/index.d.ts @@ -3,8 +3,9 @@ declare module 'webpack-dev-server' { import { Server } from 'http'; import { Compiler } from 'webpack'; class WebpackDevServer { - constructor(compiler: Compiler, options?: {}) - listen(port?: number, hostname?: string): Promise + constructor(options: {}, compilter: Compiler) + server: Server; + start(): Promise close(): void } export default WebpackDevServer; From 522ccdf8649091c00a6d991bed34b4e9cb613ce7 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 19 Aug 2021 08:33:34 -0700 Subject: [PATCH 5/5] Fix typo --- typings/webpack-dev-server/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/webpack-dev-server/index.d.ts b/typings/webpack-dev-server/index.d.ts index 89f2f58ea5..4fdf131899 100644 --- a/typings/webpack-dev-server/index.d.ts +++ b/typings/webpack-dev-server/index.d.ts @@ -3,7 +3,7 @@ declare module 'webpack-dev-server' { import { Server } from 'http'; import { Compiler } from 'webpack'; class WebpackDevServer { - constructor(options: {}, compilter: Compiler) + constructor(options: {}, compiler: Compiler) server: Server; start(): Promise close(): void