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
@@ -46,7 +46,7 @@ var LWC = (function (exports) {
46
46
  */
47
47
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
48
48
  const { isArray: isArray$1 } = Array;
49
- 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;
49
+ 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;
50
50
  const { fromCharCode: StringFromCharCode } = String;
51
51
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
52
52
  function isUndefined$1(obj) {
@@ -325,24 +325,6 @@ var LWC = (function (exports) {
325
325
  return propertyName;
326
326
  }
327
327
 
328
- /*
329
- * Copyright (c) 2020, salesforce.com, inc.
330
- * All rights reserved.
331
- * SPDX-License-Identifier: MIT
332
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
333
- */
334
- const ESCAPED_CHARS = {
335
- '"': '"',
336
- "'": ''',
337
- '<': '&lt;',
338
- '>': '&gt;',
339
- '&': '&amp;',
340
- };
341
- function htmlEscape(str, attrMode = false) {
342
- const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
343
- return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
344
- }
345
-
346
328
  /*
347
329
  * Copyright (c) 2018, salesforce.com, inc.
348
330
  * All rights reserved.
@@ -350,9 +332,9 @@ var LWC = (function (exports) {
350
332
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
351
333
  */
352
334
  // Increment whenever the LWC template compiler changes
353
- const LWC_VERSION = "2.42.0";
335
+ const LWC_VERSION = "2.44.0";
354
336
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
355
- /** version: 2.42.0 */
337
+ /** version: 2.44.0 */
356
338
 
357
339
  /**
358
340
  * Copyright (C) 2018 salesforce.com, inc.
@@ -430,7 +412,7 @@ var LWC = (function (exports) {
430
412
  setFeatureFlag(name, value);
431
413
  }
432
414
  }
433
- /** version: 2.42.0 */
415
+ /** version: 2.44.0 */
434
416
 
435
417
  /**
436
418
  * Copyright (C) 2018 salesforce.com, inc.
@@ -494,7 +476,7 @@ var LWC = (function (exports) {
494
476
  }
495
477
  }
496
478
  }
497
- /** version: 2.42.0 */
479
+ /** version: 2.44.0 */
498
480
 
499
481
  /*
500
482
  * Copyright (c) 2018, salesforce.com, inc.
@@ -937,101 +919,6 @@ var LWC = (function (exports) {
937
919
  'tabIndex',
938
920
  'title',
939
921
  ];
940
- function offsetPropertyErrorMessage(name) {
941
- 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.`;
942
- }
943
- // Global HTML Attributes & Properties
944
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
945
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
946
- //
947
- // If you update this list, check for test files that recapitulate the same list. Searching the codebase
948
- // for e.g. "dropzone" should suffice.
949
- const globalHTMLProperties = {
950
- accessKey: {
951
- attribute: 'accesskey',
952
- },
953
- accessKeyLabel: {
954
- readOnly: true,
955
- },
956
- className: {
957
- attribute: 'class',
958
- 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.',
959
- },
960
- contentEditable: {
961
- attribute: 'contenteditable',
962
- },
963
- dataset: {
964
- readOnly: true,
965
- 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.",
966
- },
967
- dir: {
968
- attribute: 'dir',
969
- },
970
- draggable: {
971
- attribute: 'draggable',
972
- },
973
- dropzone: {
974
- attribute: 'dropzone',
975
- readOnly: true,
976
- },
977
- hidden: {
978
- attribute: 'hidden',
979
- },
980
- id: {
981
- attribute: 'id',
982
- },
983
- inputMode: {
984
- attribute: 'inputmode',
985
- },
986
- lang: {
987
- attribute: 'lang',
988
- },
989
- slot: {
990
- attribute: 'slot',
991
- error: 'Using the `slot` property is an anti-pattern.',
992
- },
993
- spellcheck: {
994
- attribute: 'spellcheck',
995
- },
996
- style: {
997
- attribute: 'style',
998
- },
999
- tabIndex: {
1000
- attribute: 'tabindex',
1001
- },
1002
- title: {
1003
- attribute: 'title',
1004
- },
1005
- translate: {
1006
- attribute: 'translate',
1007
- },
1008
- // additional "global attributes" that are not present in the link above.
1009
- isContentEditable: {
1010
- readOnly: true,
1011
- },
1012
- offsetHeight: {
1013
- readOnly: true,
1014
- error: offsetPropertyErrorMessage('offsetHeight'),
1015
- },
1016
- offsetLeft: {
1017
- readOnly: true,
1018
- error: offsetPropertyErrorMessage('offsetLeft'),
1019
- },
1020
- offsetParent: {
1021
- readOnly: true,
1022
- },
1023
- offsetTop: {
1024
- readOnly: true,
1025
- error: offsetPropertyErrorMessage('offsetTop'),
1026
- },
1027
- offsetWidth: {
1028
- readOnly: true,
1029
- error: offsetPropertyErrorMessage('offsetWidth'),
1030
- },
1031
- role: {
1032
- attribute: 'role',
1033
- },
1034
- };
1035
922
  let controlledElement = null;
1036
923
  let controlledAttributeName;
1037
924
  function isAttributeLocked(elm, attrName) {
@@ -1216,8 +1103,7 @@ var LWC = (function (exports) {
1216
1103
  }),
1217
1104
  addEventListener: generateDataDescriptor({
1218
1105
  value(type, listener, options) {
1219
- // TODO [#420]: this is triggered when the component author attempts to add a listener
1220
- // programmatically into its Component's shadow root
1106
+ // TODO [#1824]: Potentially relax this restriction
1221
1107
  if (!isUndefined$1(options)) {
1222
1108
  logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
1223
1109
  }
@@ -1263,8 +1149,7 @@ var LWC = (function (exports) {
1263
1149
  }),
1264
1150
  addEventListener: generateDataDescriptor({
1265
1151
  value(type, listener, options) {
1266
- // TODO [#420]: this is triggered when the component author attempts to add a listener
1267
- // programmatically into a lighting element node
1152
+ // TODO [#1824]: Potentially relax this restriction
1268
1153
  if (!isUndefined$1(options)) {
1269
1154
  logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
1270
1155
  }
@@ -1292,7 +1177,7 @@ var LWC = (function (exports) {
1292
1177
  function getLightningElementPrototypeRestrictionsDescriptors(proto) {
1293
1178
  assertNotProd(); // this method should never leak to prod
1294
1179
  const originalDispatchEvent = proto.dispatchEvent;
1295
- const descriptors = {
1180
+ return {
1296
1181
  dispatchEvent: generateDataDescriptor({
1297
1182
  value(event) {
1298
1183
  const vm = getAssociatedVM(this);
@@ -1310,32 +1195,6 @@ var LWC = (function (exports) {
1310
1195
  },
1311
1196
  }),
1312
1197
  };
1313
- forEach.call(getOwnPropertyNames$1(globalHTMLProperties), (propName) => {
1314
- if (propName in proto) {
1315
- return; // no need to redefine something that we are already exposing
1316
- }
1317
- descriptors[propName] = generateAccessorDescriptor({
1318
- get() {
1319
- const { error, attribute } = globalHTMLProperties[propName];
1320
- const msg = [];
1321
- msg.push(`Accessing the global HTML property "${propName}" is disabled.`);
1322
- if (error) {
1323
- msg.push(error);
1324
- }
1325
- else if (attribute) {
1326
- msg.push(`Instead access it via \`this.getAttribute("${attribute}")\`.`);
1327
- }
1328
- logError(msg.join('\n'), getAssociatedVM(this));
1329
- },
1330
- set() {
1331
- const { readOnly } = globalHTMLProperties[propName];
1332
- if (readOnly) {
1333
- logError(`The global HTML property \`${propName}\` is read-only.`, getAssociatedVM(this));
1334
- }
1335
- },
1336
- });
1337
- });
1338
- return descriptors;
1339
1198
  }
1340
1199
  // This routine will prevent access to certain properties on a shadow root instance to guarantee
1341
1200
  // that all components will work fine in IE11 and other browsers without shadow dom support.
@@ -2686,12 +2545,7 @@ var LWC = (function (exports) {
2686
2545
  }
2687
2546
  function createPublicAccessorDescriptor(key, descriptor) {
2688
2547
  const { get, set, enumerable, configurable } = descriptor;
2689
- if (!isFunction$1(get)) {
2690
- if (process.env.NODE_ENV !== 'production') {
2691
- assert.invariant(isFunction$1(get), `Invalid compiler output for public accessor ${toString$1(key)} decorated with @api`);
2692
- }
2693
- throw new Error();
2694
- }
2548
+ assert.invariant(isFunction$1(get), `Invalid public accessor ${toString$1(key)} decorated with @api. The property is missing a getter.`);
2695
2549
  return {
2696
2550
  get() {
2697
2551
  if (process.env.NODE_ENV !== 'production') {
@@ -2813,64 +2667,64 @@ var LWC = (function (exports) {
2813
2667
  }
2814
2668
  }
2815
2669
  function validateObservedField(Ctor, fieldName, descriptor) {
2670
+ assertNotProd(); // this method should never leak to prod
2816
2671
  if (!isUndefined$1(descriptor)) {
2817
2672
  const type = getClassDescriptorType(descriptor);
2818
2673
  const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
2819
- // [W-9927596] Ideally we always throw an error when detecting duplicate observed field.
2820
- // This branch is only here for backward compatibility reasons.
2821
- if (type === "accessor" /* DescriptorType.Accessor */) {
2822
- logError(message);
2823
- }
2824
- else {
2825
- assert.fail(message);
2826
- }
2674
+ // TODO [#3408]: this should throw, not log
2675
+ logError(message);
2827
2676
  }
2828
2677
  }
2829
2678
  function validateFieldDecoratedWithTrack(Ctor, fieldName, descriptor) {
2679
+ assertNotProd(); // this method should never leak to prod
2830
2680
  if (!isUndefined$1(descriptor)) {
2831
2681
  const type = getClassDescriptorType(descriptor);
2832
- assert.fail(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
2682
+ // TODO [#3408]: this should throw, not log
2683
+ logError(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
2833
2684
  }
2834
2685
  }
2835
2686
  function validateFieldDecoratedWithWire(Ctor, fieldName, descriptor) {
2687
+ assertNotProd(); // this method should never leak to prod
2836
2688
  if (!isUndefined$1(descriptor)) {
2837
2689
  const type = getClassDescriptorType(descriptor);
2838
- assert.fail(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
2690
+ // TODO [#3408]: this should throw, not log
2691
+ logError(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
2839
2692
  }
2840
2693
  }
2841
2694
  function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
2695
+ assertNotProd(); // this method should never leak to prod
2842
2696
  if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
2843
- assert.fail(`Invalid @wire ${methodName} method.`);
2697
+ // TODO [#3441]: This line of code does not seem possible to reach.
2698
+ logError(`Invalid @wire ${methodName} field. The field should have a valid writable descriptor.`);
2844
2699
  }
2845
2700
  }
2846
2701
  function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
2702
+ assertNotProd(); // this method should never leak to prod
2847
2703
  if (!isUndefined$1(descriptor)) {
2848
2704
  const type = getClassDescriptorType(descriptor);
2849
2705
  const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
2850
- // [W-9927596] Ideally we always throw an error when detecting duplicate public properties.
2851
- // This branch is only here for backward compatibility reasons.
2852
- if (type === "accessor" /* DescriptorType.Accessor */) {
2853
- logError(message);
2854
- }
2855
- else {
2856
- assert.fail(message);
2857
- }
2706
+ // TODO [#3408]: this should throw, not log
2707
+ logError(message);
2858
2708
  }
2859
2709
  }
2860
2710
  function validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor) {
2861
- if (isUndefined$1(descriptor)) {
2862
- assert.fail(`Invalid @api get ${fieldName} accessor.`);
2863
- }
2864
- else if (isFunction$1(descriptor.set)) {
2865
- 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.`);
2711
+ assertNotProd(); // this method should never leak to prod
2712
+ if (isFunction$1(descriptor.set)) {
2713
+ if (!isFunction$1(descriptor.get)) {
2714
+ // TODO [#3441]: This line of code does not seem possible to reach.
2715
+ logError(`Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
2716
+ }
2866
2717
  }
2867
2718
  else if (!isFunction$1(descriptor.get)) {
2868
- assert.fail(`Missing @api get ${fieldName} accessor.`);
2719
+ // TODO [#3441]: This line of code does not seem possible to reach.
2720
+ logError(`Missing @api get ${fieldName} accessor.`);
2869
2721
  }
2870
2722
  }
2871
2723
  function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
2724
+ assertNotProd(); // this method should never leak to prod
2872
2725
  if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
2873
- assert.fail(`Invalid @api ${methodName} method.`);
2726
+ // TODO [#3441]: This line of code does not seem possible to reach.
2727
+ logError(`Invalid @api ${methodName} method.`);
2874
2728
  }
2875
2729
  }
2876
2730
  /**
@@ -2893,13 +2747,14 @@ var LWC = (function (exports) {
2893
2747
  apiFieldsConfig[fieldName] = propConfig.config;
2894
2748
  descriptor = getOwnPropertyDescriptor$1(proto, fieldName);
2895
2749
  if (propConfig.config > 0) {
2750
+ if (isUndefined$1(descriptor)) {
2751
+ // TODO [#3441]: This line of code does not seem possible to reach.
2752
+ throw new Error();
2753
+ }
2896
2754
  // accessor declaration
2897
2755
  if (process.env.NODE_ENV !== 'production') {
2898
2756
  validateAccessorDecoratedWithApi(Ctor, fieldName, descriptor);
2899
2757
  }
2900
- if (isUndefined$1(descriptor)) {
2901
- throw new Error();
2902
- }
2903
2758
  descriptor = createPublicAccessorDescriptor(fieldName, descriptor);
2904
2759
  }
2905
2760
  else {
@@ -2939,7 +2794,10 @@ var LWC = (function (exports) {
2939
2794
  descriptor = getOwnPropertyDescriptor$1(proto, fieldOrMethodName);
2940
2795
  if (method === 1) {
2941
2796
  if (process.env.NODE_ENV !== 'production') {
2942
- assert.isTrue(adapter, `@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
2797
+ if (!adapter) {
2798
+ // TODO [#3408]: this should throw, not log
2799
+ logError(`@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
2800
+ }
2943
2801
  validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
2944
2802
  }
2945
2803
  if (isUndefined$1(descriptor)) {
@@ -2950,7 +2808,10 @@ var LWC = (function (exports) {
2950
2808
  }
2951
2809
  else {
2952
2810
  if (process.env.NODE_ENV !== 'production') {
2953
- assert.isTrue(adapter, `@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
2811
+ if (!adapter) {
2812
+ // TODO [#3408]: this should throw, not log
2813
+ logError(`@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
2814
+ }
2954
2815
  validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
2955
2816
  }
2956
2817
  descriptor = internalWireFieldDecorator(fieldOrMethodName);
@@ -3756,6 +3617,15 @@ var LWC = (function (exports) {
3756
3617
  // the stylesheet, while internally, we have a replacement for it.
3757
3618
  stylesheet = getStyleOrSwappedStyle(stylesheet);
3758
3619
  }
3620
+ // Check that this stylesheet was generated by our compiler
3621
+ if (!isStylesheetRegistered(stylesheet)) {
3622
+ if (process.env.NODE_ENV !== 'production') {
3623
+ logWarnOnce(`TypeError: Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
3624
+ }
3625
+ report("UnexpectedStylesheetContent" /* ReportingEventId.UnexpectedStylesheetContent */, {
3626
+ tagName: vm.tagName.toLowerCase(),
3627
+ });
3628
+ }
3759
3629
  const isScopedCss = stylesheet[KEY__SCOPED_CSS];
3760
3630
  if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS &&
3761
3631
  !isScopedCss &&
@@ -3876,6 +3746,18 @@ var LWC = (function (exports) {
3876
3746
  }
3877
3747
  return null;
3878
3748
  }
3749
+ const signedStylesheetSet = new Set();
3750
+ /**
3751
+ * INTERNAL: This function can only be invoked by compiled code. The compiler
3752
+ * will prevent this function from being imported by userland code.
3753
+ */
3754
+ function registerStylesheet(stylesheet) {
3755
+ signedStylesheetSet.add(stylesheet);
3756
+ return stylesheet;
3757
+ }
3758
+ function isStylesheetRegistered(stylesheet) {
3759
+ return signedStylesheetSet.has(stylesheet);
3760
+ }
3879
3761
 
3880
3762
  /*
3881
3763
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5580,18 +5462,12 @@ var LWC = (function (exports) {
5580
5462
  function setVMBeingRendered(vm) {
5581
5463
  vmBeingRendered = vm;
5582
5464
  }
5583
- function validateSlots(vm, html) {
5465
+ function validateSlots(vm) {
5584
5466
  assertNotProd(); // this method should never leak to prod
5585
5467
  const { cmpSlots } = vm;
5586
- const { slots = EmptyArray } = html;
5587
5468
  for (const slotName in cmpSlots.slotAssignments) {
5588
5469
  // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5589
5470
  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}.`);
5590
- if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
5591
- // TODO [#1297]: this should never really happen because the compiler should always validate
5592
- // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
5593
- logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
5594
- }
5595
5471
  }
5596
5472
  }
5597
5473
  function validateLightDomTemplate(template, vm) {
@@ -5710,7 +5586,7 @@ var LWC = (function (exports) {
5710
5586
  }
5711
5587
  if (process.env.NODE_ENV !== 'production') {
5712
5588
  // validating slots in every rendering since the allocated content might change over time
5713
- validateSlots(vm, html);
5589
+ validateSlots(vm);
5714
5590
  // add the VM to the list of host VMs that can be re-rendered if html is swapped
5715
5591
  setActiveVM(vm);
5716
5592
  }
@@ -6693,7 +6569,7 @@ var LWC = (function (exports) {
6693
6569
  const vm = findVM(elm);
6694
6570
  if (process.env.NODE_ENV !== 'production') {
6695
6571
  logWarnOnce(`Element <${elm.tagName.toLowerCase()}> ` +
6696
- (isUndefined$1(vm) ? '' : `owned by <${vm.elm.tagName.toLowerCase()}> `) +
6572
+ (isUndefined$1(vm) ? '' : `owned by <${vm.tagName.toLowerCase()}> `) +
6697
6573
  `uses non-standard property "${prop}". This will be removed in a future version of LWC. ` +
6698
6574
  `See https://sfdc.co/deprecated-aria`);
6699
6575
  }
@@ -6810,8 +6686,6 @@ var LWC = (function (exports) {
6810
6686
  return renderer.nextSibling(hydratedNode);
6811
6687
  }
6812
6688
  const NODE_VALUE_PROP = 'nodeValue';
6813
- const PARENT_NODE_PROP = 'parentNode';
6814
- const TAG_NAME_PROP = 'tagName';
6815
6689
  function textNodeContentsAreEqual(node, vnode, renderer) {
6816
6690
  const { getProperty } = renderer;
6817
6691
  const nodeValue = getProperty(node, NODE_VALUE_PROP);
@@ -6823,22 +6697,6 @@ var LWC = (function (exports) {
6823
6697
  if (nodeValue === '\u200D' && vnode.text === '') {
6824
6698
  return true;
6825
6699
  }
6826
- // Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
6827
- // but not when generated by the engine client-side.
6828
- const parentNode = getProperty(node, PARENT_NODE_PROP);
6829
- // Should never be null, but just to be safe, we check.
6830
- /* istanbul ignore else */
6831
- if (!isNull(parentNode)) {
6832
- const tagName = getProperty(parentNode, TAG_NAME_PROP);
6833
- // If the tagName is STYLE, then the following condition should always be true.
6834
- // The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
6835
- // for component authors to render different `<style>` text content on the client and server.
6836
- // But just to be safe, we check.
6837
- /* istanbul ignore next */
6838
- if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
6839
- return true;
6840
- }
6841
- }
6842
6700
  return false;
6843
6701
  }
6844
6702
  function hydrateText(node, vnode, renderer) {
@@ -7062,7 +6920,7 @@ var LWC = (function (exports) {
7062
6920
  function validateClassAttr(vnode, elm, renderer) {
7063
6921
  const { data, owner } = vnode;
7064
6922
  let { className, classMap } = data;
7065
- const { getProperty, getClassList } = renderer;
6923
+ const { getProperty, getClassList, getAttribute } = renderer;
7066
6924
  const scopedToken = getScopeTokenClass(owner);
7067
6925
  const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
7068
6926
  // Classnames for scoped CSS are added directly to the DOM during rendering,
@@ -7092,11 +6950,12 @@ var LWC = (function (exports) {
7092
6950
  }
7093
6951
  let nodesAreCompatible = true;
7094
6952
  let readableVnodeClassname;
7095
- const elmClassName = getProperty(elm, 'className');
6953
+ const elmClassName = getAttribute(elm, 'class');
7096
6954
  if (!isUndefined$1(className) && String(className) !== elmClassName) {
7097
6955
  // className is used when class is bound to an expr.
7098
6956
  nodesAreCompatible = false;
7099
- readableVnodeClassname = className;
6957
+ // stringify for pretty-printing
6958
+ readableVnodeClassname = JSON.stringify(className);
7100
6959
  }
7101
6960
  else if (!isUndefined$1(classMap)) {
7102
6961
  // classMap is used when class is set to static value.
@@ -7109,19 +6968,20 @@ var LWC = (function (exports) {
7109
6968
  nodesAreCompatible = false;
7110
6969
  }
7111
6970
  }
7112
- readableVnodeClassname = computedClassName.trim();
6971
+ // stringify for pretty-printing
6972
+ readableVnodeClassname = JSON.stringify(computedClassName.trim());
7113
6973
  if (classList.length > keys(classMap).length) {
7114
6974
  nodesAreCompatible = false;
7115
6975
  }
7116
6976
  }
7117
- else if (isUndefined$1(className) && elmClassName !== '') {
6977
+ else if (isUndefined$1(className) && !isNull(elmClassName)) {
7118
6978
  // SSR contains a className but client-side VDOM does not
7119
6979
  nodesAreCompatible = false;
7120
- readableVnodeClassname = '';
6980
+ readableVnodeClassname = '""';
7121
6981
  }
7122
6982
  if (!nodesAreCompatible) {
7123
6983
  if (process.env.NODE_ENV !== 'production') {
7124
- logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${readableVnodeClassname}" but found "${elmClassName}"`, vnode.owner);
6984
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected ${readableVnodeClassname} but found ${JSON.stringify(elmClassName)}`, vnode.owner);
7125
6985
  }
7126
6986
  }
7127
6987
  return nodesAreCompatible;
@@ -7462,12 +7322,12 @@ var LWC = (function (exports) {
7462
7322
  if (process.env.NODE_ENV !== 'production') {
7463
7323
  // TODO [#1292]: Remove the readonly decorator
7464
7324
  if (arguments.length !== 1) {
7465
- 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.');
7325
+ 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.');
7466
7326
  }
7467
7327
  }
7468
7328
  return getReadOnlyProxy(obj);
7469
7329
  }
7470
- /* version: 2.42.0 */
7330
+ /* version: 2.44.0 */
7471
7331
 
7472
7332
  /*
7473
7333
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7895,7 +7755,7 @@ var LWC = (function (exports) {
7895
7755
  function isNull(obj) {
7896
7756
  return obj === null;
7897
7757
  }
7898
- /** version: 2.42.0 */
7758
+ /** version: 2.44.0 */
7899
7759
 
7900
7760
  /*
7901
7761
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8514,7 +8374,7 @@ var LWC = (function (exports) {
8514
8374
  });
8515
8375
  }));
8516
8376
  }
8517
- /* version: 2.42.0 */
8377
+ /* version: 2.44.0 */
8518
8378
 
8519
8379
  exports.LightningElement = LightningElement;
8520
8380
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8535,6 +8395,7 @@ var LWC = (function (exports) {
8535
8395
  exports.register = register;
8536
8396
  exports.registerComponent = registerComponent;
8537
8397
  exports.registerDecorators = registerDecorators;
8398
+ exports.registerStylesheet = registerStylesheet;
8538
8399
  exports.registerTemplate = registerTemplate;
8539
8400
  exports.renderer = renderer;
8540
8401
  exports.rendererFactory = rendererFactory;