Compare commits

...

4 Commits

Author SHA1 Message Date
Mondal 55a8b74c3c
Merge fad1bc1f32 into 3c08fd105c 2025-10-01 13:29:46 +13:00
Kevin Brey 3c08fd105c
fix(warnings): update import.meta warning messages for clarity (#19961)
Github Actions / lint (push) Waiting to run Details
Github Actions / validate-legacy-node (push) Waiting to run Details
Github Actions / benchmark (1/4) (push) Waiting to run Details
Github Actions / benchmark (2/4) (push) Waiting to run Details
Github Actions / benchmark (3/4) (push) Waiting to run Details
Github Actions / benchmark (4/4) (push) Waiting to run Details
Github Actions / basic (push) Waiting to run Details
Github Actions / unit (push) Waiting to run Details
Github Actions / integration (10.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (10.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (10.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (10.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (12.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (14.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (16.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (18.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (20.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (20.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (20.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (22.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (22.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, macos-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, macos-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, ubuntu-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, ubuntu-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (24.x, windows-latest, a) (push) Blocked by required conditions Details
Github Actions / integration (24.x, windows-latest, b) (push) Blocked by required conditions Details
Github Actions / integration (lts/*, ubuntu-latest, a, 1) (push) Blocked by required conditions Details
Github Actions / integration (lts/*, ubuntu-latest, b, 1) (push) Blocked by required conditions Details
2025-09-30 17:32:35 +03:00
Alexander Akait f508e8b705
chore: pin memfs for old node.js version (#19963) 2025-09-30 17:32:09 +03:00
Mondal fad1bc1f32 fix: resolve type and dependency issues, patch lazyCompilation/UMD interaction 2025-09-22 17:11:50 +00:00
5 changed files with 34 additions and 18 deletions

View File

@ -214,7 +214,7 @@ jobs:
# Install old `jest` version and deps for legacy node versions
- run: |
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 husky@^8.0.3 lint-staged@^13.2.1 cspell@^6.31.1 open-cli@^7.2.0 coffee-loader@^1.0.0 babel-loader@^8.1.0 style-loader@^2.0.0 css-loader@^5.0.1 less-loader@^8.1.1 mini-css-extract-plugin@^1.6.1 nyc@^15.1.0 --ignore-engines
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 husky@^8.0.3 lint-staged@^13.2.1 cspell@^6.31.1 open-cli@^7.2.0 coffee-loader@^1.0.0 babel-loader@^8.1.0 style-loader@^2.0.0 css-loader@^5.0.1 less-loader@^8.1.1 mini-css-extract-plugin@^1.6.1 nyc@^15.1.0 memfs@4.14.0 --ignore-engines
yarn --frozen-lockfile --ignore-engines
if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x'

View File

@ -115,7 +115,7 @@ class ImportMetaPlugin {
new ModuleDependencyWarning(
parser.state.module,
new CriticalDependencyWarning(
"Accessing import.meta directly is unsupported (only property access or destructuring is supported)"
"'import.meta' cannot be used as a standalone expression. For static analysis, its properties must be accessed directly (e.g., 'import.meta.url') or through destructuring."
),
/** @type {DependencyLocation} */ (metaProperty.loc)
)

View File

@ -376,28 +376,40 @@ class LazyCompilationPlugin {
apply(compiler) {
/** @type {BackendApi} */
let backend;
compiler.hooks.beforeCompile.tapAsync(PLUGIN_NAME, (params, callback) => {
if (backend !== undefined) return callback();
const promise = this.backend(compiler, (err, result) => {
if (err) return callback(err);
backend = /** @type {BackendApi} */ (result);
callback();
});
if (promise && promise.then) {
promise.then((b) => {
backend = b;
compiler.hooks.beforeCompile.tapAsync(
PLUGIN_NAME,
(/** @type {any} */ params, /** @type {(err?: Error | null) => void} */ callback) => {
if (backend !== undefined) return callback();
const promise = this.backend(compiler, (err, result) => {
if (err) return callback(err);
backend = /** @type {BackendApi} */ (result);
callback();
}, callback);
});
if (promise && promise.then) {
promise.then((b) => {
backend = b;
callback();
}, callback);
}
}
});
);
compiler.hooks.thisCompilation.tap(
PLUGIN_NAME,
/**
* @param {import("../Compilation")} compilation
* @param {{ normalModuleFactory: import("../NormalModuleFactory") }} param1
*/
(compilation, { normalModuleFactory }) => {
normalModuleFactory.hooks.module.tap(
PLUGIN_NAME,
/**
* @param {Module} module
* @param {*} createData
* @param {*} resolveData
*/
(module, createData, resolveData) => {
if (
resolveData.dependencies.every((dep) =>
resolveData.dependencies.every((dep: any) =>
HMR_DEPENDENCY_TYPES.has(dep.type)
)
) {
@ -457,7 +469,7 @@ class LazyCompilationPlugin {
);
}
);
compiler.hooks.shutdown.tapAsync(PLUGIN_NAME, (callback) => {
compiler.hooks.shutdown.tapAsync(PLUGIN_NAME, (callback: (...args: any[]) => void) => {
backend.dispose(callback);
});
}

View File

@ -1,3 +1,7 @@
"use strict";
module.exports = [[/Critical dependency: Accessing import\.meta/]];
module.exports = [
[
/Critical dependency: 'import\.meta' cannot be used as a standalone expression\. For static analysis, its properties must be accessed directly \(e\.g\., 'import\.meta\.url'\) or through destructuring\./
]
];

View File

@ -2,6 +2,6 @@
module.exports = [
[
/Accessing import.meta directly is unsupported \(only property access or destructuring is supported\)/
/'import\.meta' cannot be used as a standalone expression\. For static analysis, its properties must be accessed directly \(e\.g\., 'import\.meta\.url'\) or through destructuring\./
]
];