Fix code quality violations and enhance ROUTE-EXISTS-01 rule
Implement JQHTML function cache ID system and fix bundle compilation Implement underscore prefix for system tables Fix JS syntax linter to support decorators and grant exception to Task system SPA: Update planning docs and wishlists with remaining features SPA: Document Navigation API abandonment and future enhancements Implement SPA browser integration with History API (Phase 1) Convert contacts view page to SPA action Convert clients pages to SPA actions and document conversion procedure SPA: Merge GET parameters and update documentation Implement SPA route URL generation in JavaScript and PHP Implement SPA bootstrap controller architecture Add SPA routing manual page (rsx:man spa) Add SPA routing documentation to CLAUDE.md Phase 4 Complete: Client-side SPA routing implementation Update get_routes() consumers for unified route structure Complete SPA Phase 3: PHP-side route type detection and is_spa flag Restore unified routes structure and Manifest_Query class Refactor route indexing and add SPA infrastructure Phase 3 Complete: SPA route registration in manifest Implement SPA Phase 2: Extract router code and test decorators Rename Jqhtml_Component to Component and complete SPA foundation setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
144
node_modules/webpack/lib/runtime/MakeDeferredNamespaceObjectRuntime.js
generated
vendored
Executable file → Normal file
144
node_modules/webpack/lib/runtime/MakeDeferredNamespaceObjectRuntime.js
generated
vendored
Executable file → Normal file
@@ -8,8 +8,12 @@ const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
const Template = require("../Template");
|
||||
const HelperRuntimeModule = require("./HelperRuntimeModule");
|
||||
|
||||
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
|
||||
/** @typedef {import("../Module").ExportsType} ExportsType */
|
||||
/** @typedef {import("../ChunkGraph").ModuleId} ModuleId */
|
||||
|
||||
/**
|
||||
* @param {import("../Module").ExportsType} exportsType exports type
|
||||
* @param {ExportsType} exportsType exports type
|
||||
* @returns {string} mode
|
||||
*/
|
||||
function getMakeDeferredNamespaceModeFromExportsType(exportsType) {
|
||||
@@ -19,61 +23,81 @@ function getMakeDeferredNamespaceModeFromExportsType(exportsType) {
|
||||
if (exportsType === "dynamic") return `/* ${exportsType} */ 3`;
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../ModuleTemplate").RuntimeTemplate} _runtimeTemplate runtimeTemplate
|
||||
* @param {import("../Module").ExportsType} exportsType exportsType
|
||||
* @param {string} moduleId moduleId
|
||||
* @param {(import("../ChunkGraph").ModuleId | null)[]} asyncDepsIds asyncDepsIds
|
||||
* @returns {string} function
|
||||
* @param {ExportsType} exportsType exportsType
|
||||
* @param {(ModuleId | null)[]} asyncDepsIds asyncDepsIds
|
||||
* @param {RuntimeRequirements} runtimeRequirements runtime requirements
|
||||
* @returns {string} call make optimized deferred namespace object
|
||||
*/
|
||||
function getOptimizedDeferredModule(
|
||||
_runtimeTemplate,
|
||||
exportsType,
|
||||
moduleId,
|
||||
asyncDepsIds
|
||||
exportsType,
|
||||
asyncDepsIds,
|
||||
runtimeRequirements
|
||||
) {
|
||||
const isAsync = asyncDepsIds && asyncDepsIds.length;
|
||||
const init = `${RuntimeGlobals.require}(${moduleId})${
|
||||
isAsync ? `[${RuntimeGlobals.asyncModuleExportSymbol}]` : ""
|
||||
}`;
|
||||
const props = [
|
||||
`/* ${exportsType} */ get a() {`,
|
||||
// if exportsType is "namespace" we can generate the most optimized code,
|
||||
// on the second access, we can avoid trigger the getter.
|
||||
// we can also do this if exportsType is "dynamic" and there is a "__esModule" property on it.
|
||||
exportsType === "namespace" || exportsType === "dynamic"
|
||||
? Template.indent([
|
||||
`var exports = ${init};`,
|
||||
`${
|
||||
exportsType === "dynamic" ? "if (exports.__esModule) " : ""
|
||||
}Object.defineProperty(this, "a", { value: exports });`,
|
||||
"return exports;"
|
||||
])
|
||||
: Template.indent([`return ${init};`]),
|
||||
isAsync ? "}," : "}",
|
||||
isAsync
|
||||
? `[${
|
||||
RuntimeGlobals.makeDeferredNamespaceObjectSymbol
|
||||
}]: ${JSON.stringify(asyncDepsIds.filter((x) => x !== null))}`
|
||||
runtimeRequirements.add(RuntimeGlobals.makeOptimizedDeferredNamespaceObject);
|
||||
const mode = getMakeDeferredNamespaceModeFromExportsType(exportsType);
|
||||
return `${RuntimeGlobals.makeOptimizedDeferredNamespaceObject}(${moduleId}, ${mode}${
|
||||
asyncDepsIds.length > 0
|
||||
? `, ${JSON.stringify(asyncDepsIds.filter((x) => x !== null))}`
|
||||
: ""
|
||||
];
|
||||
return Template.asString(["{", Template.indent(props), "}"]);
|
||||
})`;
|
||||
}
|
||||
|
||||
const strictModuleCache = [
|
||||
"if (cachedModule && cachedModule.error === undefined) {",
|
||||
Template.indent([
|
||||
"var exports = cachedModule.exports;",
|
||||
"if (mode == 0) return exports;",
|
||||
`if (mode == 1) return ${RuntimeGlobals.createFakeNamespaceObject}(exports);`,
|
||||
`if (mode == 2) return ${RuntimeGlobals.createFakeNamespaceObject}(exports, 2);`,
|
||||
`if (mode == 3) return ${RuntimeGlobals.createFakeNamespaceObject}(exports, 6);` // 2 | 4
|
||||
]),
|
||||
"}"
|
||||
];
|
||||
const nonStrictModuleCache = [
|
||||
"// optimization not applied when output.strictModuleErrorHandling is off"
|
||||
];
|
||||
class MakeOptimizedDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
/**
|
||||
* @param {boolean} hasAsyncRuntime if async module is used.
|
||||
*/
|
||||
constructor(hasAsyncRuntime) {
|
||||
super("make optimized deferred namespace object");
|
||||
this.hasAsyncRuntime = hasAsyncRuntime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | null} runtime code
|
||||
*/
|
||||
generate() {
|
||||
if (!this.compilation) return null;
|
||||
const fn = RuntimeGlobals.makeOptimizedDeferredNamespaceObject;
|
||||
const hasAsync = this.hasAsyncRuntime;
|
||||
return Template.asString([
|
||||
// Note: must be a function (not arrow), because this is used in body!
|
||||
`${fn} = function(moduleId, mode${hasAsync ? ", asyncDeps" : ""}) {`,
|
||||
Template.indent([
|
||||
"// mode: 0 => namespace (esm)",
|
||||
"// mode: 1 => default-only (esm strict cjs)",
|
||||
"// mode: 2 => default-with-named (esm-cjs compat)",
|
||||
"// mode: 3 => dynamic (if exports has __esModule, then esm, otherwise default-with-named)",
|
||||
"var r = this;",
|
||||
hasAsync ? "var isAsync = asyncDeps && asyncDeps.length;" : "",
|
||||
"var obj = {",
|
||||
Template.indent([
|
||||
"get a() {",
|
||||
Template.indent([
|
||||
"var exports = r(moduleId);",
|
||||
hasAsync
|
||||
? `if(isAsync) exports = exports[${RuntimeGlobals.asyncModuleExportSymbol}];`
|
||||
: "",
|
||||
// if exportsType is "namespace" we can generate the most optimized code,
|
||||
// on the second access, we can avoid trigger the getter.
|
||||
// we can also do this if exportsType is "dynamic" and there is a "__esModule" property on it.
|
||||
'if(mode == 0 || (mode == 3 && exports.__esModule)) Object.defineProperty(this, "a", { value: exports });',
|
||||
"return exports;"
|
||||
]),
|
||||
"}"
|
||||
]),
|
||||
"};",
|
||||
hasAsync
|
||||
? `if(isAsync) obj[${RuntimeGlobals.deferredModuleAsyncTransitiveDependenciesSymbol}] = asyncDeps;`
|
||||
: "",
|
||||
"return obj;"
|
||||
]),
|
||||
"};"
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
/**
|
||||
@@ -92,8 +116,6 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
const { runtimeTemplate } = this.compilation;
|
||||
const fn = RuntimeGlobals.makeDeferredNamespaceObject;
|
||||
const hasAsync = this.hasAsyncRuntime;
|
||||
const strictError =
|
||||
this.compilation.options.output.strictModuleErrorHandling;
|
||||
const init = runtimeTemplate.supportsOptionalChaining()
|
||||
? "init?.();"
|
||||
: "if (init) init();";
|
||||
@@ -104,7 +126,18 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
"// mode: 3 => dynamic (if exports has __esModule, then esm, otherwise default-with-named)",
|
||||
"",
|
||||
"var cachedModule = __webpack_module_cache__[moduleId];",
|
||||
...(strictError ? strictModuleCache : nonStrictModuleCache),
|
||||
"if (cachedModule && cachedModule.error === undefined) {",
|
||||
Template.indent([
|
||||
"var exports = cachedModule.exports;",
|
||||
hasAsync
|
||||
? `if (${RuntimeGlobals.asyncModuleExportSymbol} in exports) exports = exports[${RuntimeGlobals.asyncModuleExportSymbol}];`
|
||||
: "",
|
||||
"if (mode == 0) return exports;",
|
||||
`if (mode == 1) return ${RuntimeGlobals.createFakeNamespaceObject}(exports);`,
|
||||
`if (mode == 2) return ${RuntimeGlobals.createFakeNamespaceObject}(exports, 2);`,
|
||||
`if (mode == 3) return ${RuntimeGlobals.createFakeNamespaceObject}(exports, 6);` // 2 | 4
|
||||
]),
|
||||
"}",
|
||||
"",
|
||||
`var init = ${runtimeTemplate.basicFunction("", [
|
||||
`ns = ${RuntimeGlobals.require}(moduleId);`,
|
||||
@@ -137,9 +170,7 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
"}"
|
||||
])};`,
|
||||
"",
|
||||
`var ns = ${
|
||||
strictError ? "" : "cachedModule && cachedModule.exports || "
|
||||
}__webpack_module_deferred_exports__[moduleId] || (__webpack_module_deferred_exports__[moduleId] = { __proto__: null });`,
|
||||
"var ns = __webpack_module_deferred_exports__[moduleId] || (__webpack_module_deferred_exports__[moduleId] = { __proto__: null });",
|
||||
"var handler = {",
|
||||
Template.indent([
|
||||
"__proto__: null,",
|
||||
@@ -161,7 +192,7 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
'case "__esModule":',
|
||||
"case Symbol.toStringTag:",
|
||||
hasAsync
|
||||
? `case ${RuntimeGlobals.makeDeferredNamespaceObjectSymbol}:`
|
||||
? `case ${RuntimeGlobals.deferredModuleAsyncTransitiveDependenciesSymbol}:`
|
||||
: "",
|
||||
Template.indent("return true;"),
|
||||
'case "then":',
|
||||
@@ -208,7 +239,10 @@ class MakeDeferredNamespaceObjectRuntimeModule extends HelperRuntimeModule {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MakeDeferredNamespaceObjectRuntimeModule;
|
||||
module.exports.MakeDeferredNamespaceObjectRuntimeModule =
|
||||
MakeDeferredNamespaceObjectRuntimeModule;
|
||||
module.exports.MakeOptimizedDeferredNamespaceObjectRuntimeModule =
|
||||
MakeOptimizedDeferredNamespaceObjectRuntimeModule;
|
||||
module.exports.getMakeDeferredNamespaceModeFromExportsType =
|
||||
getMakeDeferredNamespaceModeFromExportsType;
|
||||
module.exports.getOptimizedDeferredModule = getOptimizedDeferredModule;
|
||||
|
||||
Reference in New Issue
Block a user