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

@@ -26,12 +26,6 @@ function processChildren(node, delimeter) {
node.children.forEach(this.node, this);
}
function processChunk(chunk) {
index.tokenize(chunk, (type, start, end) => {
this.token(type, chunk.slice(start, end));
});
}
function createGenerator(config) {
const types$1 = new Map();
@@ -55,9 +49,13 @@ 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(' ', types.WhiteSpace, true);
}
this.emit(value, type, false);
if (type === types.Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
@@ -90,7 +88,14 @@ function createGenerator(config) {
node: (node) => handlers.node(node),
children: processChildren,
token: (type, value) => handlers.token(type, value),
tokenize: processChunk
tokenize: (raw) =>
index.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

@@ -5,17 +5,20 @@ const types = require('../tokenizer/types.cjs');
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 === types.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
@@ -152,14 +155,10 @@ function createMap(pairs) {
type !== types.Function &&
type !== types.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(' ', types.WhiteSpace, true);
}
return nextCode;
return nextCode | emitWs;
};
}