Socket
Socket
Sign inDemoInstall

webpack

Package Overview
Dependencies
76
Maintainers
4
Versions
832
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.82.1 to 5.83.0

lib/util/propertyName.js

3

hot/dev-server.js

@@ -7,5 +7,6 @@ /*

if (module.hot) {
/** @type {undefined|string} */
var lastHash;
var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_hash__) >= 0;
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
};

@@ -12,0 +13,0 @@ var log = require("./log");

@@ -6,2 +6,7 @@ /* global __resourceQuery */

var urlBase = decodeURIComponent(__resourceQuery.slice(1));
/**
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
* @returns {() => void} function to destroy response
*/
exports.keepAlive = function (options) {

@@ -12,2 +17,3 @@ var data = options.data;

var module = options.module;
/** @type {import("http").IncomingMessage} */
var response;

@@ -32,2 +38,6 @@ var request = (

);
/**
* @param {Error} err error
*/
function errorHandler(err) {

@@ -34,0 +44,0 @@ err.message =

@@ -12,2 +12,3 @@ /* global __resourceQuery */

var urlBase = decodeURIComponent(__resourceQuery.slice(1));
/** @type {EventSource | undefined} */
var activeEventSource;

@@ -23,2 +24,6 @@ var activeKeys = new Map();

);
/**
* @this {EventSource}
* @param {Event & { message?: string, filename?: string, lineno?: number, colno?: number, error?: Error }} event event
*/
activeEventSource.onerror = function (event) {

@@ -47,2 +52,6 @@ errorHandlers.forEach(function (onError) {

/**
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
* @returns {() => void} function to destroy response
*/
exports.keepAlive = function (options) {

@@ -49,0 +58,0 @@ var data = options.data;

@@ -5,2 +5,7 @@ /*

*/
/**
* @param {(string | number)[]} updatedModules updated modules
* @param {(string | number)[] | null} renewedModules renewed modules
*/
module.exports = function (updatedModules, renewedModules) {

@@ -7,0 +12,0 @@ var unacceptedModules = updatedModules.filter(function (moduleId) {

@@ -0,1 +1,4 @@

/** @typedef {"info" | "warning" | "error"} LogLevel */
/** @type {LogLevel} */
var logLevel = "info";

@@ -5,2 +8,6 @@

/**
* @param {LogLevel} level log level
* @returns {boolean} true, if should log
*/
function shouldLog(level) {

@@ -14,2 +21,6 @@ var shouldLog =

/**
* @param {(msg?: string) => void} logFn log function
* @returns {(level: LogLevel, msg?: string) => void} function that logs when log level is sufficient
*/
function logGroup(logFn) {

@@ -23,2 +34,6 @@ return function (level, msg) {

/**
* @param {LogLevel} level log level
* @param {string|Error} msg message
*/
module.exports = function (level, msg) {

@@ -48,2 +63,5 @@ if (shouldLog(level)) {

/**
* @param {LogLevel} level log level
*/
module.exports.setLogLevel = function (level) {

@@ -53,2 +71,6 @@ logLevel = level;

/**
* @param {Error} err error
* @returns {string} formatted error
*/
module.exports.formatError = function (err) {

@@ -55,0 +77,0 @@ var message = err.message;

@@ -7,5 +7,6 @@ /*

if (module.hot) {
/** @type {undefined|string} */
var lastHash;
var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_hash__) >= 0;
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
};

@@ -12,0 +13,0 @@ var log = require("./log");

@@ -10,2 +10,5 @@ /*

/**
* @param {boolean=} fromUpdate true when called from update
*/
var checkForUpdate = function checkForUpdate(fromUpdate) {

@@ -12,0 +15,0 @@ if (module.hot.status() === "idle") {

@@ -8,2 +8,6 @@ /*

var log = require("./log");
/**
* @param {boolean=} fromUpdate true when called from update
*/
var checkForUpdate = function checkForUpdate(fromUpdate) {

@@ -10,0 +14,0 @@ module.hot

@@ -508,3 +508,3 @@ /*

/**
* @returns {Iterable<ChunkGroup>} the chunkGroups that the said chunk is referenced in
* @returns {SortableSet<ChunkGroup>} the chunkGroups that the said chunk is referenced in
*/

@@ -511,0 +511,0 @@ get groupsIterable() {

@@ -292,3 +292,2 @@ /*

D(experiments, "backCompat", !experiments.futureDefaults);
D(experiments, "topLevelAwait", experiments.futureDefaults);
D(experiments, "syncWebAssembly", false);

@@ -303,2 +302,9 @@ D(experiments, "asyncWebAssembly", experiments.futureDefaults);

// TODO webpack 6: remove this. topLevelAwait should be enabled by default
let shouldEnableTopLevelAwait = true;
if (typeof experiments.topLevelAwait === "boolean") {
shouldEnableTopLevelAwait = experiments.topLevelAwait;
}
D(experiments, "topLevelAwait", shouldEnableTopLevelAwait);
if (typeof experiments.buildHttp === "object") {

@@ -305,0 +311,0 @@ D(experiments.buildHttp, "frozen", production);

@@ -11,2 +11,3 @@ /*

const makeSerializable = require("../util/makeSerializable");
const propertyAccess = require("../util/propertyAccess");
const HarmonyExportInitFragment = require("./HarmonyExportInitFragment");

@@ -176,5 +177,5 @@ const NullDependency = require("./NullDependency");

// This is a little bit incorrect as TDZ is not correct, but we can't use const.
content = `/* harmony default export */ ${exportsName}[${JSON.stringify(
content = `/* harmony default export */ ${exportsName}${propertyAccess(
used
)}] = `;
)} = `;
} else {

@@ -181,0 +182,0 @@ content = `/* unused harmony default export */ var ${name} = `;

@@ -18,2 +18,3 @@ /*

const propertyAccess = require("../util/propertyAccess");
const { propertyName } = require("../util/propertyName");
const { getRuntimeKey, keyToRuntime } = require("../util/runtime");

@@ -1223,3 +1224,3 @@ const HarmonyExportInitFragment = require("./HarmonyExportInitFragment");

RuntimeGlobals.definePropertyGetters
}(${exportsName}, { ${JSON.stringify(
}(${exportsName}, { ${propertyName(
key

@@ -1226,0 +1227,0 @@ )}: function() { return ${returnValue}; } });\n`;

@@ -11,2 +11,3 @@ /*

const { first } = require("../util/SetHelpers");
const { propertyName } = require("../util/propertyName");

@@ -154,3 +155,3 @@ /** @typedef {import("webpack-sources").Source} Source */

definitions.push(
`\n/* harmony export */ ${JSON.stringify(
`\n/* harmony export */ ${propertyName(
key

@@ -157,0 +158,0 @@ )}: ${runtimeTemplate.returningFunction(value)}`

@@ -34,2 +34,3 @@ /*

/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */
/** @typedef {import("./ChunkGroup")} ChunkGroup */
/** @typedef {import("./Compilation").Asset} Asset */

@@ -41,2 +42,3 @@ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */

/** @typedef {import("./MultiStats")} MultiStats */
/** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
/** @typedef {import("./Parser").ParserState} ParserState */

@@ -43,0 +45,0 @@ /** @typedef {import("./ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */

@@ -17,3 +17,3 @@ /*

/** @typedef {string | RegExp | string[] | RegExp[]} Matcher */
/** @typedef {string | RegExp | (string | RegExp)[]} Matcher */
/** @typedef {{test?: Matcher, include?: Matcher, exclude?: Matcher }} MatchObject */

@@ -20,0 +20,0 @@

@@ -30,2 +30,3 @@ /*

const propertyAccess = require("../util/propertyAccess");
const { propertyName } = require("../util/propertyName");
const {

@@ -1488,3 +1489,3 @@ filterRuntime,

definitions.push(
`\n ${JSON.stringify(key)}: ${runtimeTemplate.returningFunction(
`\n ${propertyName(key)}: ${runtimeTemplate.returningFunction(
value(requestShortener)

@@ -1534,5 +1535,5 @@ )}`

nsObj.push(
`\n ${JSON.stringify(
usedName
)}: ${runtimeTemplate.returningFunction(finalName)}`
`\n ${propertyName(usedName)}: ${runtimeTemplate.returningFunction(
finalName
)}`
);

@@ -1539,0 +1540,0 @@ }

@@ -8,56 +8,6 @@ /*

const SAFE_IDENTIFIER = /^[_a-zA-Z$][_a-zA-Z$0-9]*$/;
const RESERVED_IDENTIFIER = new Set([
"break",
"case",
"catch",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"else",
"export",
"extends",
"finally",
"for",
"function",
"if",
"import",
"in",
"instanceof",
"new",
"return",
"super",
"switch",
"this",
"throw",
"try",
"typeof",
"var",
"void",
"while",
"with",
"enum",
// strict mode
"implements",
"interface",
"let",
"package",
"private",
"protected",
"public",
"static",
"yield",
"yield",
// module code
"await",
// skip future reserved keywords defined under ES1 till ES3
// additional
"null",
"true",
"false"
]);
const {
SAFE_IDENTIFIER,
RESERVED_IDENTIFIER
} = require("../util/propertyName");

@@ -64,0 +14,0 @@ /**

declare namespace webpack {
type HotEvent =
type DeclinedEvent =
| {
type: "disposed";
/** The module in question. */
moduleId: number;
}
| {
type: "self-declined" | "unaccepted";
/** The module in question. */
moduleId: number;
/** the chain from where the update was propagated. */
chain: number[];
}
| {
type: "declined";
/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the chain from where the update was propagated. */
chain: number[];
chain: (number | string)[];
/** the module id of the declining parent */
parentId: number;
parentId: number | string;
}
| {
type: "accepted";
type: "self-declined";
/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the chain from where the update was propagated. */
chain: number[];
/** the modules that are outdated and will be disposed */
outdatedModules: number[];
/** the accepted dependencies that are outdated */
outdatedDependencies: {
[id: number]: number[];
};
}
chain: (number | string)[];
};
type UnacceptedEvent = {
type: "unaccepted";
/** The module in question. */
moduleId: number | string;
/** the chain from where the update was propagated. */
chain: (number | string)[];
};
type AcceptedEvent = {
type: "accepted";
/** The module in question. */
moduleId: number | string;
/** the modules that are outdated and will be disposed */
outdatedModules: (number | string)[];
/** the accepted dependencies that are outdated */
outdatedDependencies: {
[id: number]: (number | string)[];
};
};
type DisposedEvent = {
type: "disposed";
/** The module in question. */
moduleId: number | string;
};
type ErroredEvent =
| {
type: "accept-error-handler-errored";
/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the module id owning the accept handler. */
dependencyId: number;
dependencyId: number | string;
/** the thrown error */

@@ -51,3 +61,3 @@ error: Error;

/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the thrown error */

@@ -61,5 +71,5 @@ error: Error;

/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the module id owning the accept handler. */
dependencyId: number;
dependencyId: number | string;
/** the thrown error */

@@ -71,3 +81,3 @@ error: Error;

/** The module in question. */
moduleId: number;
moduleId: number | string;
/** the thrown error */

@@ -77,2 +87,9 @@ error: Error;

type HotEvent =
| DeclinedEvent
| UnacceptedEvent
| AcceptedEvent
| DisposedEvent
| ErroredEvent;
interface ApplyOptions {

@@ -82,7 +99,7 @@ ignoreUnaccepted?: boolean;

ignoreErrored?: boolean;
onDeclined?(callback: (info: HotEvent) => void): void;
onUnaccepted?(callback: (info: HotEvent) => void): void;
onAccepted?(callback: (info: HotEvent) => void): void;
onDisposed?(callback: (info: HotEvent) => void): void;
onErrored?(callback: (info: HotEvent) => void): void;
onDeclined?: (event: DeclinedEvent) => void;
onUnaccepted?: (event: UnacceptedEvent) => void;
onAccepted?: (event: AcceptedEvent) => void;
onDisposed?: (event: DisposedEvent) => void;
onErrored?: (event: ErroredEvent) => void;
}

@@ -89,0 +106,0 @@

{
"name": "webpack",
"version": "5.82.1",
"version": "5.83.0",
"author": "Tobias Koppers @sokra",

@@ -42,3 +42,3 @@ "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",

"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@types/node": "^20.1.7",
"assemblyscript": "^0.27.2",

@@ -177,3 +177,3 @@ "babel-loader": "^8.1.0",

"cover:merge": "yarn mkdirp .nyc_output && nyc merge .nyc_output coverage/coverage-nyc.json && rimraf .nyc_output",
"cover:report": "nyc report -t coverage"
"cover:report": "nyc report --reporter=lcov --reporter=text -t coverage"
},

@@ -180,0 +180,0 @@ "lint-staged": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc