lwc 2.42.0 → 2.44.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 (68) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +85 -225
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +85 -224
  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 +35 -20
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +85 -226
  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 +36 -21
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +85 -224
  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 +35 -20
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +85 -226
  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 +36 -21
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +152 -182
  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 +133 -183
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +89 -74
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +89 -74
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +85 -70
  34. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +88 -71
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  38. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +84 -67
  39. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +89 -74
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  42. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  43. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +85 -70
  44. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +88 -71
  46. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  47. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  48. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +84 -67
  49. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  50. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  51. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  52. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  53. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  54. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  55. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  56. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  57. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  58. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  59. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  60. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  61. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  62. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  63. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  64. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  65. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  66. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  67. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  68. package/package.json +7 -7
@@ -43,7 +43,7 @@ var assert = /*#__PURE__*/Object.freeze({
43
43
  */
44
44
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
45
45
  const { isArray: isArray$1 } = Array;
46
- const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
46
+ const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
47
47
  const { fromCharCode: StringFromCharCode } = String;
48
48
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
49
49
  function isUndefined$1(obj) {
@@ -322,24 +322,6 @@ function htmlAttributeToProperty(attrName) {
322
322
  return propertyName;
323
323
  }
324
324
 
325
- /*
326
- * Copyright (c) 2020, salesforce.com, inc.
327
- * All rights reserved.
328
- * SPDX-License-Identifier: MIT
329
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
330
- */
331
- const ESCAPED_CHARS = {
332
- '"': '"',
333
- "'": ''',
334
- '<': '&lt;',
335
- '>': '&gt;',
336
- '&': '&amp;',
337
- };
338
- function htmlEscape(str, attrMode = false) {
339
- const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
340
- return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
341
- }
342
-
343
325
  /*
344
326
  * Copyright (c) 2018, salesforce.com, inc.
345
327
  * All rights reserved.
@@ -347,9 +329,9 @@ function htmlEscape(str, attrMode = false) {
347
329
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
348
330
  */
349
331
  // Increment whenever the LWC template compiler changes
350
- const LWC_VERSION = "2.42.0";
332
+ const LWC_VERSION = "2.44.0";
351
333
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
352
- /** version: 2.42.0 */
334
+ /** version: 2.44.0 */
353
335
 
354
336
  /**
355
337
  * Copyright (C) 2018 salesforce.com, inc.
@@ -427,7 +409,7 @@ function setFeatureFlagForTest(name, value) {
427
409
  setFeatureFlag(name, value);
428
410
  }
429
411
  }
430
- /** version: 2.42.0 */
412
+ /** version: 2.44.0 */
431
413
 
432
414
  /**
433
415
  * Copyright (C) 2018 salesforce.com, inc.
@@ -491,7 +473,7 @@ function applyAriaReflection(prototype = Element.prototype) {
491
473
  }
492
474
  }
493
475
  }
494
- /** version: 2.42.0 */
476
+ /** version: 2.44.0 */
495
477
 
496
478
  /*
497
479
  * Copyright (c) 2018, salesforce.com, inc.
@@ -934,101 +916,6 @@ const defaultDefHTMLPropertyNames = [
934
916
  'tabIndex',
935
917
  'title',
936
918
  ];
937
- function offsetPropertyErrorMessage(name) {
938
- return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
939
- }
940
- // Global HTML Attributes & Properties
941
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
942
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
943
- //
944
- // If you update this list, check for test files that recapitulate the same list. Searching the codebase
945
- // for e.g. "dropzone" should suffice.
946
- const globalHTMLProperties = {
947
- accessKey: {
948
- attribute: 'accesskey',
949
- },
950
- accessKeyLabel: {
951
- readOnly: true,
952
- },
953
- className: {
954
- attribute: 'class',
955
- error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.',
956
- },
957
- contentEditable: {
958
- attribute: 'contenteditable',
959
- },
960
- dataset: {
961
- readOnly: true,
962
- error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead.",
963
- },
964
- dir: {
965
- attribute: 'dir',
966
- },
967
- draggable: {
968
- attribute: 'draggable',
969
- },
970
- dropzone: {
971
- attribute: 'dropzone',
972
- readOnly: true,
973
- },
974
- hidden: {
975
- attribute: 'hidden',
976
- },
977
- id: {
978
- attribute: 'id',
979
- },
980
- inputMode: {
981
- attribute: 'inputmode',
982
- },
983
- lang: {
984
- attribute: 'lang',
985
- },
986
- slot: {
987
- attribute: 'slot',
988
- error: 'Using the `slot` property is an anti-pattern.',
989
- },
990
- spellcheck: {
991
- attribute: 'spellcheck',
992
- },
993
- style: {
994
- attribute: 'style',
995
- },
996
- tabIndex: {
997
- attribute: 'tabindex',
998
- },
999
- title: {
1000
- attribute: 'title',
1001
- },
1002
- translate: {
1003
- attribute: 'translate',
1004
- },
1005
- // additional "global attributes" that are not present in the link above.
1006
- isContentEditable: {
1007
- readOnly: true,
1008
- },
1009
- offsetHeight: {
1010
- readOnly: true,
1011
- error: offsetPropertyErrorMessage('offsetHeight'),
1012
- },
1013
- offsetLeft: {
1014
- readOnly: true,
1015
- error: offsetPropertyErrorMessage('offsetLeft'),
1016
- },
1017
- offsetParent: {
1018
- readOnly: true,
1019
- },
1020
- offsetTop: {
1021
- readOnly: true,
1022
- error: offsetPropertyErrorMessage('offsetTop'),
1023
- },
1024
- offsetWidth: {
1025
- readOnly: true,
1026
- error: offsetPropertyErrorMessage('offsetWidth'),
1027
- },
1028
- role: {
1029
- attribute: 'role',
1030
- },
1031
- };
1032
919
  let controlledElement = null;
1033
920
  let controlledAttributeName;
1034
921
  function isAttributeLocked(elm, attrName) {
@@ -1213,8 +1100,7 @@ function getShadowRootRestrictionsDescriptors(sr) {
1213
1100
  }),
1214
1101
  addEventListener: generateDataDescriptor({
1215
1102
  value(type, listener, options) {
1216
- // TODO [#420]: this is triggered when the component author attempts to add a listener
1217
- // programmatically into its Component's shadow root
1103
+ // TODO [#1824]: Potentially relax this restriction
1218
1104
  if (!isUndefined$1(options)) {
1219
1105
  logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
1220
1106
  }
@@ -1260,8 +1146,7 @@ function getCustomElementRestrictionsDescriptors(elm) {
1260
1146
  }),
1261
1147
  addEventListener: generateDataDescriptor({
1262
1148
  value(type, listener, options) {
1263
- // TODO [#420]: this is triggered when the component author attempts to add a listener
1264
- // programmatically into a lighting element node
1149
+ // TODO [#1824]: Potentially relax this restriction
1265
1150
  if (!isUndefined$1(options)) {
1266
1151
  logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
1267
1152
  }
@@ -1289,7 +1174,7 @@ function getComponentRestrictionsDescriptors() {
1289
1174
  function getLightningElementPrototypeRestrictionsDescriptors(proto) {
1290
1175
  assertNotProd(); // this method should never leak to prod
1291
1176
  const originalDispatchEvent = proto.dispatchEvent;
1292
- const descriptors = {
1177
+ return {
1293
1178
  dispatchEvent: generateDataDescriptor({
1294
1179
  value(event) {
1295
1180
  const vm = getAssociatedVM(this);
@@ -1307,32 +1192,6 @@ function getLightningElementPrototypeRestrictionsDescriptors(proto) {
1307
1192
  },
1308
1193
  }),
1309
1194
  };
1310
- forEach.call(getOwnPropertyNames$1(globalHTMLProperties), (propName) => {
1311
- if (propName in proto) {
1312
- return; // no need to redefine something that we are already exposing
1313
- }
1314
- descriptors[propName] = generateAccessorDescriptor({
1315
- get() {
1316
- const { error, attribute } = globalHTMLProperties[propName];
1317
- const msg = [];
1318
- msg.push(`Accessing the global HTML property "${propName}" is disabled.`);
1319
- if (error) {
1320
- msg.push(error);
1321
- }
1322
- else if (attribute) {
1323
- msg.push(`Instead access it via \`this.getAttribute("${attribute}")\`.`);
1324
- }
1325
- logError(msg.join('\n'), getAssociatedVM(this));
1326
- },
1327
- set() {
1328
- const { readOnly } = globalHTMLProperties[propName];
1329
- if (readOnly) {
1330
- logError(`The global HTML property \`${propName}\` is read-only.`, getAssociatedVM(this));
1331
- }
1332
- },
1333
- });
1334
- });
1335
- return descriptors;
1336
1195
  }
1337
1196
  // This routine will prevent access to certain properties on a shadow root instance to guarantee
1338
1197
  // that all components will work fine in IE11 and other browsers without shadow dom support.
@@ -2683,12 +2542,7 @@ function createPublicPropertyDescriptor(key) {
2683
2542
  }
2684
2543
  function createPublicAccessorDescriptor(key, descriptor) {
2685
2544
  const { get, set, enumerable, configurable } = descriptor;
2686
- if (!isFunction$1(get)) {
2687
- if (process.env.NODE_ENV !== 'production') {
2688
- assert.invariant(isFunction$1(get), `Invalid compiler output for public accessor ${toString$1(key)} decorated with @api`);
2689
- }
2690
- throw new Error();
2691
- }
2545
+ assert.invariant(isFunction$1(get), `Invalid public accessor ${toString$1(key)} decorated with @api. The property is missing a getter.`);
2692
2546
  return {
2693
2547
  get() {
2694
2548
  if (process.env.NODE_ENV !== 'production') {
@@ -2810,64 +2664,64 @@ function getClassDescriptorType(descriptor) {
2810
2664
  }
2811
2665
  }
2812
2666
  function validateObservedField(Ctor, fieldName, descriptor) {
2667
+ assertNotProd(); // this method should never leak to prod
2813
2668
  if (!isUndefined$1(descriptor)) {
2814
2669
  const type = getClassDescriptorType(descriptor);
2815
2670
  const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
2816
- // [W-9927596] Ideally we always throw an error when detecting duplicate observed field.
2817
- // This branch is only here for backward compatibility reasons.
2818
- if (type === "accessor" /* DescriptorType.Accessor */) {
2819
- logError(message);
2820
- }
2821
- else {
2822
- assert.fail(message);
2823
- }
2671
+ // TODO [#3408]: this should throw, not log
2672
+ logError(message);
2824
2673
  }
2825
2674
  }
2826
2675
  function validateFieldDecoratedWithTrack(Ctor, fieldName, descriptor) {
2676
+ assertNotProd(); // this method should never leak to prod
2827
2677
  if (!isUndefined$1(descriptor)) {
2828
2678
  const type = getClassDescriptorType(descriptor);
2829
- assert.fail(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
2679
+ // TODO [#3408]: this should throw, not log
2680
+ logError(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
2830
2681
  }
2831
2682
  }
2832
2683
  function validateFieldDecoratedWithWire(Ctor, fieldName, descriptor) {
2684
+ assertNotProd(); // this method should never leak to prod
2833
2685
  if (!isUndefined$1(descriptor)) {
2834
2686
  const type = getClassDescriptorType(descriptor);
2835
- assert.fail(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
2687
+ // TODO [#3408]: this should throw, not log
2688
+ logError(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
2836
2689
  }
2837
2690
  }
2838
2691
  function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
2692
+ assertNotProd(); // this method should never leak to prod
2839
2693
  if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
2840
- assert.fail(`Invalid @wire ${methodName} method.`);
2694
+ // TODO [#3441]: This line of code does not seem possible to reach.
2695
+ logError(`Invalid @wire ${methodName} field. The field should have a valid writable descriptor.`);
2841
2696
  }
2842
2697
  }
2843
2698
  function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
2699
+ assertNotProd(); // this method should never leak to prod
2844
2700
  if (!isUndefined$1(descriptor)) {
2845
2701
  const type = getClassDescriptorType(descriptor);
2846
2702
  const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
2847
- // [W-9927596] Ideally we always throw an error when detecting duplicate public properties.
2848
- // This branch is only here for backward compatibility reasons.
2849
- if (type === "accessor" /* DescriptorType.Accessor */) {
2850
- logError(message);
2851
- }
2852
- else {
2853
- assert.fail(message);
2854
- }
2703
+ // TODO [#3408]: this should throw, not log
2704
+ logError(message);
2855
2705
  }
2856
2706
  }
2857
2707
  function validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor) {
2858
- if (isUndefined$1(descriptor)) {
2859
- assert.fail(`Invalid @api get ${fieldName} accessor.`);
2860
- }
2861
- else if (isFunction$1(descriptor.set)) {
2862
- assert.isTrue(isFunction$1(descriptor.get), `Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
2708
+ assertNotProd(); // this method should never leak to prod
2709
+ if (isFunction$1(descriptor.set)) {
2710
+ if (!isFunction$1(descriptor.get)) {
2711
+ // TODO [#3441]: This line of code does not seem possible to reach.
2712
+ logError(`Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
2713
+ }
2863
2714
  }
2864
2715
  else if (!isFunction$1(descriptor.get)) {
2865
- assert.fail(`Missing @api get ${fieldName} accessor.`);
2716
+ // TODO [#3441]: This line of code does not seem possible to reach.
2717
+ logError(`Missing @api get ${fieldName} accessor.`);
2866
2718
  }
2867
2719
  }
2868
2720
  function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
2721
+ assertNotProd(); // this method should never leak to prod
2869
2722
  if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
2870
- assert.fail(`Invalid @api ${methodName} method.`);
2723
+ // TODO [#3441]: This line of code does not seem possible to reach.
2724
+ logError(`Invalid @api ${methodName} method.`);
2871
2725
  }
2872
2726
  }
2873
2727
  /**
@@ -2890,13 +2744,14 @@ function registerDecorators(Ctor, meta) {
2890
2744
  apiFieldsConfig[fieldName] = propConfig.config;
2891
2745
  descriptor = getOwnPropertyDescriptor$1(proto, fieldName);
2892
2746
  if (propConfig.config > 0) {
2747
+ if (isUndefined$1(descriptor)) {
2748
+ // TODO [#3441]: This line of code does not seem possible to reach.
2749
+ throw new Error();
2750
+ }
2893
2751
  // accessor declaration
2894
2752
  if (process.env.NODE_ENV !== 'production') {
2895
2753
  validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor);
2896
2754
  }
2897
- if (isUndefined$1(descriptor)) {
2898
- throw new Error();
2899
- }
2900
2755
  descriptor = createPublicAccessorDescriptor(fieldName, descriptor);
2901
2756
  }
2902
2757
  else {
@@ -2936,7 +2791,10 @@ function registerDecorators(Ctor, meta) {
2936
2791
  descriptor = getOwnPropertyDescriptor$1(proto, fieldOrMethodName);
2937
2792
  if (method === 1) {
2938
2793
  if (process.env.NODE_ENV !== 'production') {
2939
- assert.isTrue(adapter, `@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
2794
+ if (!adapter) {
2795
+ // TODO [#3408]: this should throw, not log
2796
+ logError(`@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
2797
+ }
2940
2798
  validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
2941
2799
  }
2942
2800
  if (isUndefined$1(descriptor)) {
@@ -2947,7 +2805,10 @@ function registerDecorators(Ctor, meta) {
2947
2805
  }
2948
2806
  else {
2949
2807
  if (process.env.NODE_ENV !== 'production') {
2950
- assert.isTrue(adapter, `@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
2808
+ if (!adapter) {
2809
+ // TODO [#3408]: this should throw, not log
2810
+ logError(`@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
2811
+ }
2951
2812
  validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
2952
2813
  }
2953
2814
  descriptor = internalWireFieldDecorator(fieldOrMethodName);
@@ -3753,6 +3614,15 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
3753
3614
  // the stylesheet, while internally, we have a replacement for it.
3754
3615
  stylesheet = getStyleOrSwappedStyle(stylesheet);
3755
3616
  }
3617
+ // Check that this stylesheet was generated by our compiler
3618
+ if (!isStylesheetRegistered(stylesheet)) {
3619
+ if (process.env.NODE_ENV !== 'production') {
3620
+ logWarnOnce(`TypeError: Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
3621
+ }
3622
+ report("UnexpectedStylesheetContent" /* ReportingEventId.UnexpectedStylesheetContent */, {
3623
+ tagName: vm.tagName.toLowerCase(),
3624
+ });
3625
+ }
3756
3626
  const isScopedCss = stylesheet[KEY__SCOPED_CSS];
3757
3627
  if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS &&
3758
3628
  !isScopedCss &&
@@ -3873,6 +3743,18 @@ function createStylesheet(vm, stylesheets) {
3873
3743
  }
3874
3744
  return null;
3875
3745
  }
3746
+ const signedStylesheetSet = new Set();
3747
+ /**
3748
+ * INTERNAL: This function can only be invoked by compiled code. The compiler
3749
+ * will prevent this function from being imported by userland code.
3750
+ */
3751
+ function registerStylesheet(stylesheet) {
3752
+ signedStylesheetSet.add(stylesheet);
3753
+ return stylesheet;
3754
+ }
3755
+ function isStylesheetRegistered(stylesheet) {
3756
+ return signedStylesheetSet.has(stylesheet);
3757
+ }
3876
3758
 
3877
3759
  /*
3878
3760
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5577,18 +5459,12 @@ function getVMBeingRendered() {
5577
5459
  function setVMBeingRendered(vm) {
5578
5460
  vmBeingRendered = vm;
5579
5461
  }
5580
- function validateSlots(vm, html) {
5462
+ function validateSlots(vm) {
5581
5463
  assertNotProd(); // this method should never leak to prod
5582
5464
  const { cmpSlots } = vm;
5583
- const { slots = EmptyArray } = html;
5584
5465
  for (const slotName in cmpSlots.slotAssignments) {
5585
5466
  // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5586
5467
  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}.`);
5587
- if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
5588
- // TODO [#1297]: this should never really happen because the compiler should always validate
5589
- // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5590
- logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
5591
- }
5592
5468
  }
5593
5469
  }
5594
5470
  function validateLightDomTemplate(template, vm) {
@@ -5707,7 +5583,7 @@ function evaluateTemplate(vm, html) {
5707
5583
  }
5708
5584
  if (process.env.NODE_ENV !== 'production') {
5709
5585
  // validating slots in every rendering since the allocated content might change over time
5710
- validateSlots(vm, html);
5586
+ validateSlots(vm);
5711
5587
  // add the VM to the list of host VMs that can be re-rendered if html is swapped
5712
5588
  setActiveVM(vm);
5713
5589
  }
@@ -6690,7 +6566,7 @@ function checkAndReportViolation(elm, prop, isSetter, setValue) {
6690
6566
  const vm = findVM(elm);
6691
6567
  if (process.env.NODE_ENV !== 'production') {
6692
6568
  logWarnOnce(`Element <${elm.tagName.toLowerCase()}> ` +
6693
- (isUndefined$1(vm) ? '' : `owned by <${vm.elm.tagName.toLowerCase()}> `) +
6569
+ (isUndefined$1(vm) ? '' : `owned by <${vm.tagName.toLowerCase()}> `) +
6694
6570
  `uses non-standard property "${prop}". This will be removed in a future version of LWC. ` +
6695
6571
  `See https://sfdc.co/deprecated-aria`);
6696
6572
  }
@@ -6807,8 +6683,6 @@ function hydrateNode(node, vnode, renderer) {
6807
6683
  return renderer.nextSibling(hydratedNode);
6808
6684
  }
6809
6685
  const NODE_VALUE_PROP = 'nodeValue';
6810
- const PARENT_NODE_PROP = 'parentNode';
6811
- const TAG_NAME_PROP = 'tagName';
6812
6686
  function textNodeContentsAreEqual(node, vnode, renderer) {
6813
6687
  const { getProperty } = renderer;
6814
6688
  const nodeValue = getProperty(node, NODE_VALUE_PROP);
@@ -6820,22 +6694,6 @@ function textNodeContentsAreEqual(node, vnode, renderer) {
6820
6694
  if (nodeValue === '\u200D' && vnode.text === '') {
6821
6695
  return true;
6822
6696
  }
6823
- // Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
6824
- // but not when generated by the engine client-side.
6825
- const parentNode = getProperty(node, PARENT_NODE_PROP);
6826
- // Should never be null, but just to be safe, we check.
6827
- /* istanbul ignore else */
6828
- if (!isNull(parentNode)) {
6829
- const tagName = getProperty(parentNode, TAG_NAME_PROP);
6830
- // If the tagName is STYLE, then the following condition should always be true.
6831
- // The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
6832
- // for component authors to render different `<style>` text content on the client and server.
6833
- // But just to be safe, we check.
6834
- /* istanbul ignore next */
6835
- if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
6836
- return true;
6837
- }
6838
- }
6839
6697
  return false;
6840
6698
  }
6841
6699
  function hydrateText(node, vnode, renderer) {
@@ -7059,7 +6917,7 @@ function validateAttrs(vnode, elm, renderer) {
7059
6917
  function validateClassAttr(vnode, elm, renderer) {
7060
6918
  const { data, owner } = vnode;
7061
6919
  let { className, classMap } = data;
7062
- const { getProperty, getClassList } = renderer;
6920
+ const { getProperty, getClassList, getAttribute } = renderer;
7063
6921
  const scopedToken = getScopeTokenClass(owner);
7064
6922
  const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
7065
6923
  // Classnames for scoped CSS are added directly to the DOM during rendering,
@@ -7089,11 +6947,12 @@ function validateClassAttr(vnode, elm, renderer) {
7089
6947
  }
7090
6948
  let nodesAreCompatible = true;
7091
6949
  let readableVnodeClassname;
7092
- const elmClassName = getProperty(elm, 'className');
6950
+ const elmClassName = getAttribute(elm, 'class');
7093
6951
  if (!isUndefined$1(className) && String(className) !== elmClassName) {
7094
6952
  // className is used when class is bound to an expr.
7095
6953
  nodesAreCompatible = false;
7096
- readableVnodeClassname = className;
6954
+ // stringify for pretty-printing
6955
+ readableVnodeClassname = JSON.stringify(className);
7097
6956
  }
7098
6957
  else if (!isUndefined$1(classMap)) {
7099
6958
  // classMap is used when class is set to static value.
@@ -7106,19 +6965,20 @@ function validateClassAttr(vnode, elm, renderer) {
7106
6965
  nodesAreCompatible = false;
7107
6966
  }
7108
6967
  }
7109
- readableVnodeClassname = computedClassName.trim();
6968
+ // stringify for pretty-printing
6969
+ readableVnodeClassname = JSON.stringify(computedClassName.trim());
7110
6970
  if (classList.length > keys(classMap).length) {
7111
6971
  nodesAreCompatible = false;
7112
6972
  }
7113
6973
  }
7114
- else if (isUndefined$1(className) && elmClassName !== '') {
6974
+ else if (isUndefined$1(className) && !isNull(elmClassName)) {
7115
6975
  // SSR contains a className but client-side VDOM does not
7116
6976
  nodesAreCompatible = false;
7117
- readableVnodeClassname = '';
6977
+ readableVnodeClassname = '""';
7118
6978
  }
7119
6979
  if (!nodesAreCompatible) {
7120
6980
  if (process.env.NODE_ENV !== 'production') {
7121
- logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${readableVnodeClassname}" but found "${elmClassName}"`, vnode.owner);
6981
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected ${readableVnodeClassname} but found ${JSON.stringify(elmClassName)}`, vnode.owner);
7122
6982
  }
7123
6983
  }
7124
6984
  return nodesAreCompatible;
@@ -7459,12 +7319,12 @@ function readonly(obj) {
7459
7319
  if (process.env.NODE_ENV !== 'production') {
7460
7320
  // TODO [#1292]: Remove the readonly decorator
7461
7321
  if (arguments.length !== 1) {
7462
- assert.fail('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
7322
+ logError('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
7463
7323
  }
7464
7324
  }
7465
7325
  return getReadOnlyProxy(obj);
7466
7326
  }
7467
- /* version: 2.42.0 */
7327
+ /* version: 2.44.0 */
7468
7328
 
7469
7329
  /*
7470
7330
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7892,7 +7752,7 @@ function rendererFactory(baseRenderer) {
7892
7752
  function isNull(obj) {
7893
7753
  return obj === null;
7894
7754
  }
7895
- /** version: 2.42.0 */
7755
+ /** version: 2.44.0 */
7896
7756
 
7897
7757
  /*
7898
7758
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8511,7 +8371,7 @@ function registerContextProvider(elm, adapterContextToken, onContextSubscription
8511
8371
  });
8512
8372
  }));
8513
8373
  }
8514
- /* version: 2.42.0 */
8374
+ /* version: 2.44.0 */
8515
8375
 
8516
- export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
8376
+ export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerStylesheet, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
8517
8377
  //# sourceMappingURL=engine-dom.js.map