Add <%br= %> jqhtml syntax docs, class override detection, npm update

Document event handler placement and model fetch clarification

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-01-15 10:16:06 +00:00
parent 61f8f058f2
commit 1594502cb2
791 changed files with 7044 additions and 6089 deletions

View File

@@ -51,15 +51,13 @@ var compatData = {
}
};
{
const node = core.types.identifier("a");
const property = core.types.objectProperty(core.types.identifier("key"), node);
const pattern = core.types.objectPattern([property]);
var ZERO_REFS = core.types.isReferenced(node, property, pattern) ? 1 : 0;
}
const node = core.types.identifier("a");
const property = core.types.objectProperty(core.types.identifier("key"), node);
const pattern = core.types.objectPattern([property]);
var ZERO_REFS = core.types.isReferenced(node, property, pattern) ? 1 : 0;
var index = helperPluginUtils.declare((api, opts) => {
var _api$assumption, _api$assumption2, _api$assumption3, _api$assumption4;
api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta");
api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
const targets = api.targets();
const supportsObjectAssign = !helperCompilationTargets.isRequired("Object.assign", targets, {
compatData
@@ -120,15 +118,13 @@ var index = helperPluginUtils.declare((api, opts) => {
}
return false;
}
function extractNormalizedKeys(node) {
const props = node.properties;
function extractNormalizedKeys(pattern) {
const propsList = pattern.get("properties").map(p => p.node);
const keys = [];
let allPrimitives = true;
let hasTemplateLiteral = false;
for (const prop of props) {
const {
key
} = prop;
for (const prop of propsList) {
const key = prop.key;
if (core.types.isIdentifier(key) && !prop.computed) {
keys.push(core.types.stringLiteral(key.name));
} else if (core.types.isTemplateLiteral(key)) {
@@ -137,12 +133,17 @@ var index = helperPluginUtils.declare((api, opts) => {
} else if (core.types.isLiteral(key)) {
keys.push(core.types.stringLiteral(String(key.value)));
} else {
keys.push(core.types.cloneNode(key));
if (core.types.isMemberExpression(key, {
if (core.types.isAssignmentExpression(key) && core.types.isIdentifier(key.left)) {
keys.push(core.types.cloneNode(key.left));
} else {
keys.push(core.types.cloneNode(key));
}
const keyToCheck = core.types.isAssignmentExpression(key) ? key.right : key;
if (core.types.isMemberExpression(keyToCheck, {
computed: false
}) && core.types.isIdentifier(key.object, {
}) && core.types.isIdentifier(keyToCheck.object, {
name: "Symbol"
}) || core.types.isCallExpression(key) && core.types.matchesPattern(key.callee, "Symbol.for")) ; else {
}) || core.types.isCallExpression(keyToCheck) && core.types.matchesPattern(keyToCheck.callee, "Symbol.for")) ; else {
allPrimitives = false;
}
}
@@ -154,17 +155,23 @@ var index = helperPluginUtils.declare((api, opts) => {
};
}
function replaceImpureComputedKeys(properties, scope) {
const impureComputedPropertyDeclarators = [];
for (const propPath of properties) {
const key = propPath.get("key");
if (propPath.node.computed && !key.isPure()) {
const name = scope.generateUidBasedOnNode(key.node);
const declarator = core.types.variableDeclarator(core.types.identifier(name), key.node);
impureComputedPropertyDeclarators.push(declarator);
key.replaceWith(core.types.identifier(name));
const tempVariableDeclarations = [];
for (const property of properties) {
const keyExpression = property.get("key");
if (keyExpression.isAssignmentExpression() && keyExpression.get("left").isIdentifier()) {
const identName = keyExpression.node.left.name;
if (scope.hasUid(identName)) {
continue;
}
}
if (property.node.computed && !keyExpression.isPure()) {
const tempVariableName = scope.generateUidBasedOnNode(keyExpression.node);
const tempVariableDeclaration = core.types.variableDeclarator(core.types.identifier(tempVariableName), keyExpression.node);
tempVariableDeclarations.push(tempVariableDeclaration);
keyExpression.replaceWith(core.types.identifier(tempVariableName));
}
}
return impureComputedPropertyDeclarators;
return tempVariableDeclarations;
}
function removeUnusedExcludedKeys(path) {
const bindings = path.getOuterBindingIdentifierPaths();
@@ -176,6 +183,36 @@ var index = helperPluginUtils.declare((api, opts) => {
bindingParentPath.remove();
});
}
function collectComputedKeysInSourceOrder(destructuringPattern) {
const computedProperties = [];
function visitPattern(pattern) {
if (pattern.isObjectPattern()) {
const properties = pattern.get("properties");
for (const property of properties) {
if (property.isRestElement()) continue;
if (property.node.computed) {
computedProperties.push(property);
}
const nestedPattern = property.get("value");
visitPattern(nestedPattern);
}
} else if (pattern.isArrayPattern()) {
for (const element of pattern.get("elements")) {
if (!element) continue;
if (element.isRestElement()) {
const restArgument = element.get("argument");
visitPattern(restArgument);
} else {
visitPattern(element);
}
}
} else if (pattern.isAssignmentPattern()) {
visitPattern(pattern.get("left"));
}
}
visitPattern(destructuringPattern);
return computedProperties;
}
function createObjectRest(path, file, objRef) {
const props = path.get("properties");
const last = props[props.length - 1];
@@ -187,7 +224,7 @@ var index = helperPluginUtils.declare((api, opts) => {
keys,
allPrimitives,
hasTemplateLiteral
} = extractNormalizedKeys(path.node);
} = extractNormalizedKeys(path);
if (keys.length === 0) {
return [impureComputedPropertyDeclarators, restElement.argument, core.types.callExpression(getExtendsHelper(file), [core.types.objectExpression([]), core.types.sequenceExpression([core.types.callExpression(file.addHelper("objectDestructuringEmpty"), [core.types.cloneNode(objRef)]), core.types.cloneNode(objRef)])])];
}
@@ -289,6 +326,25 @@ var index = helperPluginUtils.declare((api, opts) => {
}
let insertionPath = path;
const originalPath = path;
if (hasObjectRestElement(path.get("id"))) {
const destructuringPattern = originalPath.get("id");
const propertiesWithComputedKeys = collectComputedKeysInSourceOrder(destructuringPattern);
for (const property of propertiesWithComputedKeys) {
const computedKeyExpression = property.get("key");
if (computedKeyExpression.isAssignmentExpression() && computedKeyExpression.get("left").isIdentifier() && originalPath.scope.hasUid(computedKeyExpression.node.left.name)) {
continue;
}
if (!computedKeyExpression.isPure()) {
const tempVariableName = originalPath.scope.generateUidBasedOnNode(computedKeyExpression.node);
const tempIdentifier = core.types.identifier(tempVariableName);
originalPath.scope.push({
id: tempIdentifier,
kind: "var"
});
computedKeyExpression.replaceWith(core.types.assignmentExpression("=", core.types.cloneNode(tempIdentifier), computedKeyExpression.node));
}
}
}
visitObjectRestElements(path.get("id"), path => {
if (shouldStoreRHSInTemporaryVariable(originalPath.node.id) && !core.types.isIdentifier(originalPath.node.init)) {
const initRef = path.scope.generateUidIdentifierBasedOnNode(originalPath.node.init, "ref");
@@ -309,10 +365,12 @@ var index = helperPluginUtils.declare((api, opts) => {
});
const impureObjRefComputedDeclarators = replaceImpureComputedKeys(refPropertyPath, path.scope);
refPropertyPath.forEach(prop => {
const {
node
} = prop;
ref = core.types.memberExpression(ref, core.types.cloneNode(node.key), node.computed || core.types.isLiteral(node.key));
const keyPath = prop.get("key");
let keyForMemberExpression = keyPath.node;
if (core.types.isAssignmentExpression(keyPath.node)) {
keyForMemberExpression = keyPath.node.left;
}
ref = core.types.memberExpression(ref, core.types.cloneNode(keyForMemberExpression), prop.node.computed || core.types.isLiteral(keyPath.node));
});
const objectPatternPath = path.parentPath;
const [impureComputedPropertyDeclarators, argument, callExpression] = createObjectRest(objectPatternPath, file, ref);
@@ -330,14 +388,12 @@ var index = helperPluginUtils.declare((api, opts) => {
});
},
ExportNamedDeclaration(path) {
var _path$splitExportDecl;
const declaration = path.get("declaration");
if (!declaration.isVariableDeclaration()) return;
const hasRest = declaration.get("declarations").some(path => hasObjectRestElement(path.get("id")));
if (!hasRest) return;
{
var _path$splitExportDecl;
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
}
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
path.splitExportDeclaration();
},
CatchClause(path) {
@@ -450,13 +506,11 @@ var index = helperPluginUtils.declare((api, opts) => {
if (setSpreadProperties) {
helper = getExtendsHelper(file);
} else {
{
try {
helper = file.addHelper("objectSpread2");
} catch (_unused) {
this.file.declarations.objectSpread2 = null;
helper = file.addHelper("objectSpread");
}
try {
helper = file.addHelper("objectSpread2");
} catch (_unused) {
this.file.declarations.objectSpread2 = null;
helper = file.addHelper("objectSpread");
}
}
let exp = null;

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-transform-object-rest-spread",
"version": "7.28.4",
"version": "7.28.6",
"description": "Compile object rest and spread to ES5",
"repository": {
"type": "git",
@@ -17,19 +17,19 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-compilation-targets": "^7.27.2",
"@babel/helper-plugin-utils": "^7.27.1",
"@babel/plugin-transform-destructuring": "^7.28.0",
"@babel/helper-compilation-targets": "^7.28.6",
"@babel/helper-plugin-utils": "^7.28.6",
"@babel/plugin-transform-destructuring": "^7.28.5",
"@babel/plugin-transform-parameters": "^7.27.7",
"@babel/traverse": "^7.28.4"
"@babel/traverse": "^7.28.6"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.28.4",
"@babel/core": "^7.28.6",
"@babel/helper-plugin-test-runner": "^7.27.1",
"@babel/parser": "^7.28.4"
"@babel/parser": "^7.28.6"
},
"engines": {
"node": ">=6.9.0"