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

@@ -23,12 +23,6 @@ function processChildren(node, delimeter) {
node.children.forEach(this.node, this);
}
function processChunk(chunk) {
tokenize(chunk, (type, start, end) => {
this.token(type, chunk.slice(start, end));
});
}
export function createGenerator(config) {
const types = new Map();
@@ -52,9 +46,13 @@ export function createGenerator(config) {
}
},
tokenBefore: tokenBefore.safe,
token(type, value) {
token(type, value, suppressAutoWhiteSpace) {
prevCode = this.tokenBefore(prevCode, type, value);
if (!suppressAutoWhiteSpace && prevCode & 1) {
this.emit(' ', WhiteSpace, true);
}
this.emit(value, type, false);
if (type === Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
@@ -87,7 +85,14 @@ export function createGenerator(config) {
node: (node) => handlers.node(node),
children: processChildren,
token: (type, value) => handlers.token(type, value),
tokenize: processChunk
tokenize: (raw) =>
tokenize(raw, (type, start, end) => {
handlers.token(
type,
raw.slice(start, end),
start !== 0 // suppress auto whitespace for internal value tokens
);
})
};
handlers.node(node);

View File

@@ -1,5 +1,4 @@
import {
WhiteSpace,
Delim,
Ident,
Function as FunctionToken,
@@ -20,17 +19,20 @@ import {
const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
// code:
// 0xxxxxxx x0000000 - char code (0x80 for non-ASCII) or delim value
// 00000000 0xxxxxx0 - token type (0 for delim, 1 for token)
// 00000000 0000000x - reserved for carriage emit flag (0 for no space, 1 for space)
const code = (type, value) => {
if (type === Delim) {
type = value;
}
if (typeof type === 'string') {
const charCode = type.charCodeAt(0);
return charCode > 0x7F ? 0x8000 : charCode << 8;
type = Math.min(type.charCodeAt(0), 0x80) << 6; // replace non-ASCII with 0x80
}
return type;
return type << 1;
};
// https://www.w3.org/TR/css-syntax-3/#serialization
@@ -167,14 +169,10 @@ function createMap(pairs) {
type !== FunctionToken &&
type !== CDC) ||
(nextCharCode === PLUSSIGN)
? isWhiteSpaceRequired.has(prevCode << 16 | nextCharCode << 8)
: isWhiteSpaceRequired.has(prevCode << 16 | nextCode);
? isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCharCode << 7)
: isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCode);
if (emitWs) {
this.emit(' ', WhiteSpace, true);
}
return nextCode;
return nextCode | emitWs;
};
}