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:
97
node_modules/webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js
generated
vendored
Executable file → Normal file
97
node_modules/webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js
generated
vendored
Executable file → Normal file
@@ -5,7 +5,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const CommentCompilationWarning = require("../CommentCompilationWarning");
|
||||
const HotModuleReplacementPlugin = require("../HotModuleReplacementPlugin");
|
||||
const WebpackError = require("../WebpackError");
|
||||
const {
|
||||
@@ -21,6 +20,7 @@ const HarmonyExports = require("./HarmonyExports");
|
||||
const { ExportPresenceModes } = require("./HarmonyImportDependency");
|
||||
const HarmonyImportSideEffectDependency = require("./HarmonyImportSideEffectDependency");
|
||||
const HarmonyImportSpecifierDependency = require("./HarmonyImportSpecifierDependency");
|
||||
const { ImportPhaseUtils, createGetImportPhase } = require("./ImportPhase");
|
||||
|
||||
/** @typedef {import("estree").Expression} Expression */
|
||||
/** @typedef {import("estree").Identifier} Identifier */
|
||||
@@ -36,6 +36,7 @@ const HarmonyImportSpecifierDependency = require("./HarmonyImportSpecifierDepend
|
||||
/** @typedef {import("../javascript/JavascriptParser").Members} Members */
|
||||
/** @typedef {import("../javascript/JavascriptParser").MembersOptionals} MembersOptionals */
|
||||
/** @typedef {import("./HarmonyImportDependency").Ids} Ids */
|
||||
/** @typedef {import("./ImportPhase").ImportPhaseType} ImportPhaseType */
|
||||
|
||||
const harmonySpecifierTag = Symbol("harmony import");
|
||||
|
||||
@@ -47,7 +48,7 @@ const harmonySpecifierTag = Symbol("harmony import");
|
||||
* @property {string} name
|
||||
* @property {boolean} await
|
||||
* @property {ImportAttributes=} attributes
|
||||
* @property {boolean | undefined} defer
|
||||
* @property {ImportPhaseType} phase
|
||||
*/
|
||||
|
||||
const PLUGIN_NAME = "HarmonyImportDependencyParserPlugin";
|
||||
@@ -57,6 +58,7 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
* @param {JavascriptParserOptions} options options
|
||||
*/
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
this.exportPresenceMode =
|
||||
options.importExportsPresence !== undefined
|
||||
? ExportPresenceModes.fromUserOption(options.importExportsPresence)
|
||||
@@ -66,7 +68,6 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
? ExportPresenceModes.ERROR
|
||||
: ExportPresenceModes.AUTO;
|
||||
this.strictThisContextOnImports = options.strictThisContextOnImports;
|
||||
this.deferImport = options.deferImport;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,6 +77,8 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
apply(parser) {
|
||||
const { exportPresenceMode } = this;
|
||||
|
||||
const getImportPhase = createGetImportPhase(this.options.deferImport);
|
||||
|
||||
/**
|
||||
* @param {Members} members members
|
||||
* @param {MembersOptionals} membersOptionals members Optionals
|
||||
@@ -119,26 +122,24 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
parser.state.module.addPresentationalDependency(clearDep);
|
||||
parser.unsetAsiPosition(/** @type {Range} */ (statement.range)[1]);
|
||||
const attributes = getImportAttributes(statement);
|
||||
let defer = false;
|
||||
if (this.deferImport) {
|
||||
({ defer } = getImportMode(parser, statement));
|
||||
if (
|
||||
defer &&
|
||||
(statement.specifiers.length !== 1 ||
|
||||
statement.specifiers[0].type !== "ImportNamespaceSpecifier")
|
||||
) {
|
||||
const error = new WebpackError(
|
||||
"Deferred import can only be used with `import * as namespace from '...'` syntax."
|
||||
);
|
||||
error.loc = statement.loc || undefined;
|
||||
parser.state.current.addError(error);
|
||||
}
|
||||
const phase = getImportPhase(parser, statement);
|
||||
if (
|
||||
ImportPhaseUtils.isDefer(phase) &&
|
||||
(statement.specifiers.length !== 1 ||
|
||||
statement.specifiers[0].type !== "ImportNamespaceSpecifier")
|
||||
) {
|
||||
const error = new WebpackError(
|
||||
"Deferred import can only be used with `import * as namespace from '...'` syntax."
|
||||
);
|
||||
error.loc = statement.loc || undefined;
|
||||
parser.state.current.addError(error);
|
||||
}
|
||||
|
||||
const sideEffectDep = new HarmonyImportSideEffectDependency(
|
||||
/** @type {string} */ (source),
|
||||
parser.state.lastHarmonyImportOrder,
|
||||
attributes,
|
||||
defer
|
||||
phase,
|
||||
attributes
|
||||
);
|
||||
sideEffectDep.loc = /** @type {DependencyLocation} */ (statement.loc);
|
||||
parser.state.module.addDependency(sideEffectDep);
|
||||
@@ -148,9 +149,7 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
PLUGIN_NAME,
|
||||
(statement, source, id, name) => {
|
||||
const ids = id === null ? [] : [id];
|
||||
const defer = this.deferImport
|
||||
? getImportMode(parser, statement).defer
|
||||
: false;
|
||||
const phase = getImportPhase(parser, statement);
|
||||
parser.tagVariable(
|
||||
name,
|
||||
harmonySpecifierTag,
|
||||
@@ -160,7 +159,7 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
ids,
|
||||
sourceOrder: parser.state.lastHarmonyImportOrder,
|
||||
attributes: getImportAttributes(statement),
|
||||
defer
|
||||
phase
|
||||
})
|
||||
);
|
||||
return true;
|
||||
@@ -237,9 +236,9 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
/** @type {Range} */
|
||||
(expr.range),
|
||||
exportPresenceMode,
|
||||
settings.phase,
|
||||
settings.attributes,
|
||||
[],
|
||||
settings.defer
|
||||
[]
|
||||
);
|
||||
dep.referencedPropertiesInDestructuring =
|
||||
parser.destructuringAssignmentPropertiesFor(expr);
|
||||
@@ -287,9 +286,9 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
/** @type {Range} */
|
||||
(expr.range),
|
||||
exportPresenceMode,
|
||||
settings.phase,
|
||||
settings.attributes,
|
||||
ranges,
|
||||
settings.defer
|
||||
ranges
|
||||
);
|
||||
dep.referencedPropertiesInDestructuring =
|
||||
parser.destructuringAssignmentPropertiesFor(expr);
|
||||
@@ -337,9 +336,9 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
settings.name,
|
||||
/** @type {Range} */ (expr.range),
|
||||
exportPresenceMode,
|
||||
settings.phase,
|
||||
settings.attributes,
|
||||
ranges,
|
||||
settings.defer
|
||||
ranges
|
||||
);
|
||||
dep.directImport = members.length === 0;
|
||||
dep.call = true;
|
||||
@@ -406,44 +405,4 @@ module.exports = class HarmonyImportDependencyParserPlugin {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {JavascriptParser} parser parser
|
||||
* @param {ExportNamedDeclaration | ExportAllDeclaration | ImportDeclaration} node node
|
||||
* @returns {{ defer: boolean }} import attributes
|
||||
*/
|
||||
function getImportMode(parser, node) {
|
||||
const result = { defer: "phase" in node && node.phase === "defer" };
|
||||
if (!node.range) {
|
||||
return result;
|
||||
}
|
||||
const { options, errors } = parser.parseCommentOptions(node.range);
|
||||
if (errors) {
|
||||
for (const e of errors) {
|
||||
const { comment } = e;
|
||||
if (!comment.loc) continue;
|
||||
parser.state.module.addWarning(
|
||||
new CommentCompilationWarning(
|
||||
`Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`,
|
||||
comment.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!options) return result;
|
||||
if (options.webpackDefer) {
|
||||
if (typeof options.webpackDefer === "boolean") {
|
||||
result.defer = options.webpackDefer;
|
||||
} else if (node.loc) {
|
||||
parser.state.module.addWarning(
|
||||
new CommentCompilationWarning(
|
||||
"webpackDefer magic comment expected a boolean value.",
|
||||
node.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports.getImportMode = getImportMode;
|
||||
module.exports.harmonySpecifierTag = harmonySpecifierTag;
|
||||
|
||||
Reference in New Issue
Block a user