@lwc/template-compiler 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +13 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/shared/estree.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -238,6 +238,12 @@ function property$1(key, value, config) {
|
|
|
238
238
|
return Object.assign({ type: 'Property', key,
|
|
239
239
|
value, kind: 'init', computed: false, method: false, shorthand: false }, config);
|
|
240
240
|
}
|
|
241
|
+
function spreadElement(argument) {
|
|
242
|
+
return {
|
|
243
|
+
type: 'SpreadElement',
|
|
244
|
+
argument,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
241
247
|
function assignmentProperty(key, value, config) {
|
|
242
248
|
return Object.assign({ type: 'Property', key,
|
|
243
249
|
value, kind: 'init', computed: false, method: false, shorthand: false }, config);
|
|
@@ -5203,6 +5209,12 @@ function transform(codeGen) {
|
|
|
5203
5209
|
if (ref) {
|
|
5204
5210
|
data.push(codeGen.genRef(ref));
|
|
5205
5211
|
}
|
|
5212
|
+
// Properties: lwc:spread directive
|
|
5213
|
+
if (spread) {
|
|
5214
|
+
// spread goes last, so it can be used to override any other properties
|
|
5215
|
+
propsObj.properties.push(spreadElement(codeGen.bindExpression(spread.value)));
|
|
5216
|
+
instrumentation === null || instrumentation === void 0 ? void 0 : instrumentation.incrementCounter(CompilerMetrics.LWCSpreadDirective);
|
|
5217
|
+
}
|
|
5206
5218
|
if (propsObj.properties.length) {
|
|
5207
5219
|
data.push(property$1(identifier('props'), propsObj));
|
|
5208
5220
|
}
|
|
@@ -5213,11 +5225,6 @@ function transform(codeGen) {
|
|
|
5213
5225
|
]);
|
|
5214
5226
|
data.push(property$1(identifier('context'), contextObj));
|
|
5215
5227
|
}
|
|
5216
|
-
// Spread
|
|
5217
|
-
if (spread) {
|
|
5218
|
-
data.push(property$1(identifier('spread'), codeGen.bindExpression(spread.value)));
|
|
5219
|
-
instrumentation === null || instrumentation === void 0 ? void 0 : instrumentation.incrementCounter(CompilerMetrics.LWCSpreadDirective);
|
|
5220
|
-
}
|
|
5221
5228
|
// Key property on VNode
|
|
5222
5229
|
if (forKey) {
|
|
5223
5230
|
// If element has user-supplied `key` or is in iterator, call `api.k`
|
|
@@ -5338,5 +5345,5 @@ function compile(source, config) {
|
|
|
5338
5345
|
}
|
|
5339
5346
|
|
|
5340
5347
|
export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, compile, compile as default, parse };
|
|
5341
|
-
/** version: 3.3.
|
|
5348
|
+
/** version: 3.3.2 */
|
|
5342
5349
|
//# sourceMappingURL=index.js.map
|