lwc 2.42.0 → 2.43.0

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.
Files changed (64) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +41 -24
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +41 -23
  4. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
  5. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +32 -16
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +42 -24
  9. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
  10. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  11. package/dist/engine-dom/iife/es5/engine-dom_debug.js +34 -18
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +41 -23
  14. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
  15. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  16. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +32 -16
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +42 -24
  19. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
  20. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  21. package/dist/engine-dom/umd/es5/engine-dom_debug.js +34 -18
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +37 -14
  24. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
  25. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  26. package/dist/engine-server/esm/es2017/engine-server.js +37 -15
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  34. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  38. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  42. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  43. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  46. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  47. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  48. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  49. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  50. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  51. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  52. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  53. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  54. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  55. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  56. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  57. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  58. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  59. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  60. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  61. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  62. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  63. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  64. package/package.json +7 -7
@@ -444,9 +444,9 @@ function htmlEscape(str, attrMode = false) {
444
444
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
445
445
  */
446
446
  // Increment whenever the LWC template compiler changes
447
- const LWC_VERSION = "2.42.0";
447
+ const LWC_VERSION = "2.43.0";
448
448
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
449
- /** version: 2.42.0 */
449
+ /** version: 2.43.0 */
450
450
 
451
451
  /**
452
452
  * Copyright (C) 2018 salesforce.com, inc.
@@ -524,7 +524,7 @@ function setFeatureFlagForTest(name, value) {
524
524
  setFeatureFlag(name, value);
525
525
  }
526
526
  }
527
- /** version: 2.42.0 */
527
+ /** version: 2.43.0 */
528
528
 
529
529
  /*
530
530
  * Copyright (c) 2020, salesforce.com, inc.
@@ -620,9 +620,16 @@ function applyAriaReflection(prototype = Element.prototype) {
620
620
  }
621
621
  }
622
622
  }
623
- /** version: 2.42.0 */
623
+ /** version: 2.43.0 */
624
624
 
625
625
  /* proxy-compat-disable */
626
+ /**
627
+ * Report to the current dispatcher, if there is one.
628
+ * @param reportingEventId
629
+ * @param payload - data to report
630
+ */
631
+ function report(reportingEventId, payload) {
632
+ }
626
633
 
627
634
  /*
628
635
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3534,6 +3541,15 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
3534
3541
  // the stylesheet, while internally, we have a replacement for it.
3535
3542
  stylesheet = getStyleOrSwappedStyle(stylesheet);
3536
3543
  }
3544
+ // Check that this stylesheet was generated by our compiler
3545
+ if (!isStylesheetRegistered(stylesheet)) {
3546
+ if (process.env.NODE_ENV !== 'production') {
3547
+ logWarnOnce(`TypeError: Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
3548
+ }
3549
+ report("UnexpectedStylesheetContent" /* ReportingEventId.UnexpectedStylesheetContent */, {
3550
+ tagName: vm.tagName.toLowerCase(),
3551
+ });
3552
+ }
3537
3553
  const isScopedCss = stylesheet[KEY__SCOPED_CSS];
3538
3554
  if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS &&
3539
3555
  !isScopedCss &&
@@ -3622,6 +3638,18 @@ function createStylesheet(vm, stylesheets) {
3622
3638
  }
3623
3639
  return null;
3624
3640
  }
3641
+ const signedStylesheetSet = new Set();
3642
+ /**
3643
+ * INTERNAL: This function can only be invoked by compiled code. The compiler
3644
+ * will prevent this function from being imported by userland code.
3645
+ */
3646
+ function registerStylesheet(stylesheet) {
3647
+ signedStylesheetSet.add(stylesheet);
3648
+ return stylesheet;
3649
+ }
3650
+ function isStylesheetRegistered(stylesheet) {
3651
+ return signedStylesheetSet.has(stylesheet);
3652
+ }
3625
3653
 
3626
3654
  /*
3627
3655
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5279,18 +5307,12 @@ function getVMBeingRendered() {
5279
5307
  function setVMBeingRendered(vm) {
5280
5308
  vmBeingRendered = vm;
5281
5309
  }
5282
- function validateSlots(vm, html) {
5310
+ function validateSlots(vm) {
5283
5311
  assertNotProd(); // this method should never leak to prod
5284
5312
  const { cmpSlots } = vm;
5285
- const { slots = EmptyArray } = html;
5286
5313
  for (const slotName in cmpSlots.slotAssignments) {
5287
5314
  // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5288
5315
  assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots.slotAssignments[slotName])} for slot "${slotName}" in ${vm}.`);
5289
- if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
5290
- // TODO [#1297]: this should never really happen because the compiler should always validate
5291
- // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5292
- logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
5293
- }
5294
5316
  }
5295
5317
  }
5296
5318
  function validateLightDomTemplate(template, vm) {
@@ -5404,7 +5426,7 @@ function evaluateTemplate(vm, html) {
5404
5426
  }
5405
5427
  if (process.env.NODE_ENV !== 'production') {
5406
5428
  // validating slots in every rendering since the allocated content might change over time
5407
- validateSlots(vm, html);
5429
+ validateSlots(vm);
5408
5430
  // add the VM to the list of host VMs that can be re-rendered if html is swapped
5409
5431
  setActiveVM(vm);
5410
5432
  }
@@ -6345,7 +6367,7 @@ function readonly(obj) {
6345
6367
  }
6346
6368
  return getReadOnlyProxy(obj);
6347
6369
  }
6348
- /* version: 2.42.0 */
6370
+ /* version: 2.43.0 */
6349
6371
 
6350
6372
  /*
6351
6373
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6880,7 +6902,7 @@ seal(LightningElement.prototype);
6880
6902
  function createElement() {
6881
6903
  throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
6882
6904
  }
6883
- /* version: 2.42.0 */
6905
+ /* version: 2.43.0 */
6884
6906
 
6885
6907
  exports.LightningElement = LightningElement;
6886
6908
  exports.api = api$1;
@@ -6895,6 +6917,7 @@ exports.readonly = readonly;
6895
6917
  exports.register = register;
6896
6918
  exports.registerComponent = registerComponent;
6897
6919
  exports.registerDecorators = registerDecorators;
6920
+ exports.registerStylesheet = registerStylesheet;
6898
6921
  exports.registerTemplate = registerTemplate;
6899
6922
  exports.renderComponent = renderComponent;
6900
6923
  exports.renderer = renderer;