Fix async lifecycle ordering, add _spa_init boot phase, update to jqhtml _load_only/_load_render_only flags

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-03-06 22:33:38 +00:00
parent 11c95a2886
commit d1ac456279
2718 changed files with 70593 additions and 6320 deletions

View File

@@ -17,6 +17,36 @@ const SEMICOLON = 0x003B; // U+003B SEMICOLON (;)
const LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)
const NULL = 0;
const arrayMethods = {
createList() {
return [];
},
createSingleNodeList(node) {
return [node];
},
getFirstListNode(list) {
return list && list[0] || null;
},
getLastListNode(list) {
return list && list.length > 0 ? list[list.length - 1] : null;
}
};
const listMethods = {
createList() {
return new List.List();
},
createSingleNodeList(node) {
return new List.List().appendData(node);
},
getFirstListNode(list) {
return list && list.first;
},
getLastListNode(list) {
return list && list.last;
}
};
function createParseContext(name) {
return function() {
return this[name]();
@@ -97,18 +127,10 @@ function createParser(config) {
return code === SEMICOLON ? 2 : 0;
},
createList() {
return new List.List();
},
createSingleNodeList(node) {
return new List.List().appendData(node);
},
getFirstListNode(list) {
return list && list.first;
},
getLastListNode(list) {
return list && list.last;
},
createList: NOOP,
createSingleNodeList: NOOP,
getFirstListNode: NOOP,
getLastListNode: NOOP,
parseWithFallback(consumer, fallback) {
const startIndex = this.tokenIndex;
@@ -280,6 +302,36 @@ function createParser(config) {
);
}
});
const createTokenIterateAPI = () => ({
filename,
source,
tokenCount: parser.tokenCount,
getTokenType: (index) =>
parser.getTokenType(index),
getTokenTypeName: (index) =>
names[parser.getTokenType(index)],
getTokenStart: (index) =>
parser.getTokenStart(index),
getTokenEnd: (index) =>
parser.getTokenEnd(index),
getTokenValue: (index) =>
parser.source.substring(parser.getTokenStart(index), parser.getTokenEnd(index)),
substring: (start, end) =>
parser.source.substring(start, end),
balance: parser.balance.subarray(0, parser.tokenCount + 1),
isBlockOpenerTokenType: parser.isBlockOpenerTokenType,
isBlockCloserTokenType: parser.isBlockCloserTokenType,
getBlockTokenPairIndex: (index) =>
parser.getBlockTokenPairIndex(index),
getLocation: (offset) =>
locationMap.getLocation(offset, filename),
getRangeLocation: (start, end) =>
locationMap.getLocationRange(start, end, filename)
});
const parse = function(source_, options) {
source = source_;
@@ -303,12 +355,22 @@ function createParser(config) {
parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;
const { context = 'default', onComment } = options;
const { context = 'default', list = true, onComment, onToken } = options;
if (context in parser.context === false) {
throw new Error('Unknown context `' + context + '`');
}
Object.assign(parser, list ? listMethods : arrayMethods);
if (Array.isArray(onToken)) {
parser.forEachToken((type, start, end) => {
onToken.push({ type, start, end });
});
} else if (typeof onToken === 'function') {
parser.forEachToken(onToken.bind(createTokenIterateAPI()));
}
if (typeof onComment === 'function') {
parser.forEachToken((type, start, end) => {
if (type === types.Comment) {