Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack/webpack-dev-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.13.2
Choose a base ref
...
head repository: webpack/webpack-dev-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.13.3
Choose a head ref
  • 12 commits
  • 5 files changed
  • 3 contributors

Commits on Apr 3, 2023

  1. chore(deps-dev): bump @types/node-forge from 1.3.1 to 1.3.2 (#4802)

    Bumps [@types/node-forge](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-forge) from 1.3.1 to 1.3.2.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-forge)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/node-forge"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3a32ad5 View commit details
  2. chore(deps-dev): bump @babel/plugin-transform-runtime (#4801)

    Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.21.0 to 7.21.4.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.21.4/packages/babel-plugin-transform-runtime)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/plugin-transform-runtime"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0fda077 View commit details
  3. chore(deps-dev): bump @babel/preset-env from 7.20.2 to 7.21.4 (#4800)

    Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.20.2 to 7.21.4.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.21.4/packages/babel-preset-env)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/preset-env"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e8ea8a View commit details
  4. chore(deps-dev): bump @babel/core from 7.21.3 to 7.21.4 (#4799)

    Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.21.3 to 7.21.4.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.21.4/packages/babel-core)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/core"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    01410a4 View commit details

Commits on Apr 4, 2023

  1. chore(deps-dev): bump core-js from 3.29.1 to 3.30.0 (#4803)

    Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.29.1 to 3.30.0.
    - [Release notes](https://github.com/zloirock/core-js/releases)
    - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/zloirock/core-js/commits/v3.30.0/packages/core-js)
    
    ---
    updated-dependencies:
    - dependency-name: core-js
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 4, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    78b90f8 View commit details

Commits on Apr 6, 2023

  1. chore(deps-dev): bump webpack from 5.77.0 to 5.78.0 (#4805)

    Bumps [webpack](https://github.com/webpack/webpack) from 5.77.0 to 5.78.0.
    - [Release notes](https://github.com/webpack/webpack/releases)
    - [Commits](webpack/webpack@v5.77.0...v5.78.0)
    
    ---
    updated-dependencies:
    - dependency-name: webpack
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6c0fd28 View commit details

Commits on Apr 7, 2023

  1. chore(deps-dev): bump memfs from 3.4.13 to 3.5.0 (#4807)

    Bumps [memfs](https://github.com/streamich/memfs) from 3.4.13 to 3.5.0.
    - [Release notes](https://github.com/streamich/memfs/releases)
    - [Changelog](https://github.com/streamich/memfs/blob/master/CHANGELOG.md)
    - [Commits](streamich/memfs@v3.4.13...v3.5.0)
    
    ---
    updated-dependencies:
    - dependency-name: memfs
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 7, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c883cbc View commit details

Commits on Apr 10, 2023

  1. chore(deps-dev): bump eslint from 8.37.0 to 8.38.0 (#4811)

    Bumps [eslint](https://github.com/eslint/eslint) from 8.37.0 to 8.38.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
    - [Commits](eslint/eslint@v8.37.0...v8.38.0)
    
    ---
    updated-dependencies:
    - dependency-name: eslint
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 10, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    abbcb44 View commit details

Commits on Apr 13, 2023

  1. chore(deps-dev): bump webpack from 5.78.0 to 5.79.0 (#4815)

    Bumps [webpack](https://github.com/webpack/webpack) from 5.78.0 to 5.79.0.
    - [Release notes](https://github.com/webpack/webpack/releases)
    - [Commits](webpack/webpack@v5.78.0...v5.79.0)
    
    ---
    updated-dependencies:
    - dependency-name: webpack
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 13, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    63f8ff0 View commit details

Commits on Apr 14, 2023

  1. chore(deps-dev): bump core-js from 3.30.0 to 3.30.1 (#4817)

    Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.30.0 to 3.30.1.
    - [Release notes](https://github.com/zloirock/core-js/releases)
    - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/zloirock/core-js/commits/v3.30.1/packages/core-js)
    
    ---
    updated-dependencies:
    - dependency-name: core-js
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 14, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fc2c36b View commit details

Commits on Apr 15, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fcf01d1 View commit details
  2. Copy the full SHA
    80a96fd View commit details
Showing with 797 additions and 620 deletions.
  1. +7 −0 CHANGELOG.md
  2. +35 −10 lib/Server.js
  3. +216 −216 package-lock.json
  4. +1 −1 package.json
  5. +538 −393 types/lib/Server.d.ts
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [4.13.3](https://github.com/webpack/webpack-dev-server/compare/v4.13.2...v4.13.3) (2023-04-15)


### Bug Fixes

* **perf:** reduced initial start time ([#4818](https://github.com/webpack/webpack-dev-server/issues/4818)) ([fcf01d1](https://github.com/webpack/webpack-dev-server/commit/fcf01d1b8eb67aa1c93486e1b34ceefc33d9ee73))

### [4.13.2](https://github.com/webpack/webpack-dev-server/compare/v4.13.1...v4.13.2) (2023-03-31)


45 changes: 35 additions & 10 deletions lib/Server.js
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@ const url = require("url");
const util = require("util");
const fs = require("graceful-fs");
const ipaddr = require("ipaddr.js");
const defaultGateway = require("default-gateway");
const express = require("express");
const { validate } = require("schema-utils");
const schema = require("./options.json");

@@ -210,6 +208,34 @@ if (!process.env.WEBPACK_SERVE) {
process.env.WEBPACK_SERVE = true;
}

/**
* @template T
* @param fn {(function(): any) | undefined}
* @returns {function(): T}
*/
const memoize = (fn) => {
let cache = false;
/** @type {T} */
let result;

return () => {
if (cache) {
return result;
}

result = /** @type {function(): any} */ (fn)();
cache = true;
// Allow to clean up memory for fn
// and all dependent resources
// eslint-disable-next-line no-undefined
fn = undefined;

return result;
};
};

const getExpress = memoize(() => require("express"));

class Server {
/**
* @param {Configuration | Compiler | MultiCompiler} options
@@ -342,7 +368,7 @@ class Server {
*/
static async internalIP(family) {
try {
const { gateway } = await defaultGateway[family]();
const { gateway } = await require("default-gateway")[family]();
return Server.findIp(gateway);
} catch {
// ignore
@@ -355,7 +381,7 @@ class Server {
*/
static internalIPSync(family) {
try {
const { gateway } = defaultGateway[family].sync();
const { gateway } = require("default-gateway")[family].sync();
return Server.findIp(gateway);
} catch {
// ignore
@@ -1144,7 +1170,7 @@ class Server {
// Ignore error
}

// It is file
// It is a file
return stats ? fs.readFileSync(item) : item;
}
};
@@ -1898,8 +1924,7 @@ class Server {
*/
setupApp() {
/** @type {import("express").Application | undefined}*/
// eslint-disable-next-line new-cap
this.app = new /** @type {any} */ (express)();
this.app = new /** @type {any} */ (getExpress())();
}

/**
@@ -2318,7 +2343,7 @@ class Server {
middlewares.push({
name: "express-static",
path: publicPath,
middleware: express.static(
middleware: getExpress().static(
staticOption.directory,
staticOption.staticOptions
),
@@ -2373,7 +2398,7 @@ class Server {
middlewares.push({
name: "express-static",
path: publicPath,
middleware: express.static(
middleware: getExpress().static(
staticOption.directory,
staticOption.staticOptions
),
@@ -3257,7 +3282,7 @@ class Server {
*/
(error) => {
if (error.code === "ECONNREFUSED") {
// No other server listening on this socket so it can be safely removed
// No other server listening on this socket, so it can be safely removed
fs.unlinkSync(/** @type {string} */ (this.options.ipc));

resolve();
432 changes: 216 additions & 216 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-dev-server",
"version": "4.13.2",
"version": "4.13.3",
"description": "Serves a webpack app. Updates the browser on changes.",
"bin": "bin/webpack-dev-server.js",
"main": "lib/Server.js",
931 changes: 538 additions & 393 deletions types/lib/Server.d.ts

Large diffs are not rendered by default.