@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 CHANGED
@@ -263,6 +263,12 @@ function property$1(key, value, config) {
263
263
  return Object.assign({ type: 'Property', key,
264
264
  value, kind: 'init', computed: false, method: false, shorthand: false }, config);
265
265
  }
266
+ function spreadElement(argument) {
267
+ return {
268
+ type: 'SpreadElement',
269
+ argument,
270
+ };
271
+ }
266
272
  function assignmentProperty(key, value, config) {
267
273
  return Object.assign({ type: 'Property', key,
268
274
  value, kind: 'init', computed: false, method: false, shorthand: false }, config);
@@ -5228,6 +5234,12 @@ function transform(codeGen) {
5228
5234
  if (ref) {
5229
5235
  data.push(codeGen.genRef(ref));
5230
5236
  }
5237
+ // Properties: lwc:spread directive
5238
+ if (spread) {
5239
+ // spread goes last, so it can be used to override any other properties
5240
+ propsObj.properties.push(spreadElement(codeGen.bindExpression(spread.value)));
5241
+ instrumentation === null || instrumentation === void 0 ? void 0 : instrumentation.incrementCounter(errors.CompilerMetrics.LWCSpreadDirective);
5242
+ }
5231
5243
  if (propsObj.properties.length) {
5232
5244
  data.push(property$1(identifier('props'), propsObj));
5233
5245
  }
@@ -5238,11 +5250,6 @@ function transform(codeGen) {
5238
5250
  ]);
5239
5251
  data.push(property$1(identifier('context'), contextObj));
5240
5252
  }
5241
- // Spread
5242
- if (spread) {
5243
- data.push(property$1(identifier('spread'), codeGen.bindExpression(spread.value)));
5244
- instrumentation === null || instrumentation === void 0 ? void 0 : instrumentation.incrementCounter(errors.CompilerMetrics.LWCSpreadDirective);
5245
- }
5246
5253
  // Key property on VNode
5247
5254
  if (forKey) {
5248
5255
  // If element has user-supplied `key` or is in iterator, call `api.k`
@@ -5365,5 +5372,5 @@ function compile(source, config) {
5365
5372
  exports.compile = compile;
5366
5373
  exports.default = compile;
5367
5374
  exports.parse = parse;
5368
- /** version: 3.3.0 */
5375
+ /** version: 3.3.2 */
5369
5376
  //# sourceMappingURL=index.cjs.js.map