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>
114 lines
3.2 KiB
JavaScript
114 lines
3.2 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const DependenciesBlock = require("./DependenciesBlock");
|
|
const makeSerializable = require("./util/makeSerializable");
|
|
|
|
/** @typedef {import("./ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */
|
|
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
|
/** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */
|
|
/** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */
|
|
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
/** @typedef {import("./util/Hash")} Hash */
|
|
|
|
/** @typedef {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | string} GroupOptions */
|
|
|
|
class AsyncDependenciesBlock extends DependenciesBlock {
|
|
/**
|
|
* @param {GroupOptions | null} groupOptions options for the group
|
|
* @param {(DependencyLocation | null)=} loc the line of code
|
|
* @param {(string | null)=} request the request
|
|
*/
|
|
constructor(groupOptions, loc, request) {
|
|
super();
|
|
if (typeof groupOptions === "string") {
|
|
groupOptions = { name: groupOptions };
|
|
} else if (!groupOptions) {
|
|
groupOptions = { name: undefined };
|
|
}
|
|
this.groupOptions = groupOptions;
|
|
this.loc = loc;
|
|
this.request = request;
|
|
this._stringifiedGroupOptions = undefined;
|
|
}
|
|
|
|
/**
|
|
* @returns {ChunkGroupOptions["name"]} The name of the chunk
|
|
*/
|
|
get chunkName() {
|
|
return this.groupOptions.name;
|
|
}
|
|
|
|
/**
|
|
* @param {string | undefined} value The new chunk name
|
|
* @returns {void}
|
|
*/
|
|
set chunkName(value) {
|
|
if (this.groupOptions.name !== value) {
|
|
this.groupOptions.name = value;
|
|
this._stringifiedGroupOptions = undefined;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {Hash} hash the hash used to track dependencies
|
|
* @param {UpdateHashContext} context context
|
|
* @returns {void}
|
|
*/
|
|
updateHash(hash, context) {
|
|
const { chunkGraph } = context;
|
|
if (this._stringifiedGroupOptions === undefined) {
|
|
this._stringifiedGroupOptions = JSON.stringify(this.groupOptions);
|
|
}
|
|
const chunkGroup = chunkGraph.getBlockChunkGroup(this);
|
|
hash.update(
|
|
`${this._stringifiedGroupOptions}${chunkGroup ? chunkGroup.id : ""}`
|
|
);
|
|
super.updateHash(hash, context);
|
|
}
|
|
|
|
/**
|
|
* @param {ObjectSerializerContext} context context
|
|
*/
|
|
serialize(context) {
|
|
const { write } = context;
|
|
write(this.groupOptions);
|
|
write(this.loc);
|
|
write(this.request);
|
|
super.serialize(context);
|
|
}
|
|
|
|
/**
|
|
* @param {ObjectDeserializerContext} context context
|
|
*/
|
|
deserialize(context) {
|
|
const { read } = context;
|
|
this.groupOptions = read();
|
|
this.loc = read();
|
|
this.request = read();
|
|
super.deserialize(context);
|
|
}
|
|
}
|
|
|
|
makeSerializable(AsyncDependenciesBlock, "webpack/lib/AsyncDependenciesBlock");
|
|
|
|
Object.defineProperty(AsyncDependenciesBlock.prototype, "module", {
|
|
get() {
|
|
throw new Error(
|
|
"module property was removed from AsyncDependenciesBlock (it's not needed)"
|
|
);
|
|
},
|
|
set() {
|
|
throw new Error(
|
|
"module property was removed from AsyncDependenciesBlock (it's not needed)"
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = AsyncDependenciesBlock;
|