lwc 2.45.1 → 2.45.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.
Files changed (66) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +63 -15
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +63 -15
  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 +64 -13
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +70 -13
  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 +71 -11
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +63 -15
  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 +64 -13
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +70 -13
  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 +71 -11
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +7 -7
  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 +7 -7
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
  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 +4 -4
  34. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  38. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +4 -4
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  42. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
  43. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  46. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  47. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  48. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  49. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  50. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  51. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  52. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  53. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  54. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  55. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  56. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  57. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  58. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  59. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  60. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  61. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  62. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  63. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  64. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  65. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  66. package/package.json +7 -7
@@ -49,7 +49,16 @@
49
49
  */
50
50
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
51
51
  const { isArray: isArray$1 } = Array;
52
- 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;
52
+ const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, 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;
53
+ // The type of the return value of Array.prototype.every is `this is T[]`. However, once this
54
+ // Array method is pulled out of the prototype, the function is now referencing `this` where
55
+ // `this` is meaningless, resulting in a TypeScript compilation error.
56
+ //
57
+ // Exposing this helper function is the closest we can get to preserving the usage patterns
58
+ // of Array.prototype methods used elsewhere in the codebase.
59
+ function arrayEvery(arr, predicate) {
60
+ return ArrayEvery.call(arr, predicate);
61
+ }
53
62
  const { fromCharCode: StringFromCharCode } = String;
54
63
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
55
64
  function isUndefined$1(obj) {
@@ -335,9 +344,9 @@
335
344
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
336
345
  */
337
346
  // Increment whenever the LWC template compiler changes
338
- const LWC_VERSION = "2.45.1";
347
+ const LWC_VERSION = "2.45.2";
339
348
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
340
- /** version: 2.45.1 */
349
+ /** version: 2.45.2 */
341
350
 
342
351
  /**
343
352
  * Copyright (C) 2018 salesforce.com, inc.
@@ -415,7 +424,7 @@
415
424
  setFeatureFlag(name, value);
416
425
  }
417
426
  }
418
- /** version: 2.45.1 */
427
+ /** version: 2.45.2 */
419
428
 
420
429
  /**
421
430
  * Copyright (C) 2018 salesforce.com, inc.
@@ -479,7 +488,7 @@
479
488
  }
480
489
  }
481
490
  }
482
- /** version: 2.45.1 */
491
+ /** version: 2.45.2 */
483
492
 
484
493
  /*
485
494
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6708,6 +6717,27 @@
6708
6717
  }
6709
6718
  return false;
6710
6719
  }
6720
+ // The validationOptOut static property can be an array of attribute names.
6721
+ // Any attribute names specified in that array will not be validated, and the
6722
+ // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
6723
+ function getValidationPredicate(optOutStaticProp) {
6724
+ if (isUndefined$1(optOutStaticProp)) {
6725
+ return (_attrName) => true;
6726
+ }
6727
+ // If validationOptOut is true, no attributes will be checked for correctness
6728
+ // and the runtime will assume VDOM attrs and DOM attrs are in sync.
6729
+ if (isTrue(optOutStaticProp)) {
6730
+ return (_attrName) => false;
6731
+ }
6732
+ // If validationOptOut is an array of strings, attributes specified in the
6733
+ // array will be "opted out". Attributes not specified in the array will still
6734
+ // be validated.
6735
+ if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
6736
+ return (attrName) => !ArrayIncludes.call(optOutStaticProp, attrName);
6737
+ }
6738
+ logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
6739
+ return (_attrName) => true;
6740
+ }
6711
6741
  function hydrateText(node, vnode, renderer) {
6712
6742
  var _a;
6713
6743
  if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
@@ -6786,8 +6816,19 @@
6786
6816
  return elm;
6787
6817
  }
6788
6818
  function hydrateCustomElement(elm, vnode, renderer) {
6819
+ const { validationOptOut } = vnode.ctor;
6820
+ const shouldValidateAttr = getValidationPredicate(validationOptOut);
6821
+ // The validationOptOut static property can be an array of attribute names.
6822
+ // Any attribute names specified in that array will not be validated, and the
6823
+ // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
6824
+ //
6825
+ // If validationOptOut is true, no attributes will be checked for correctness
6826
+ // and the runtime will assume VDOM attrs and DOM attrs are in sync.
6827
+ //
6828
+ // Therefore, if validationOptOut is falsey or an array of strings, we need to
6829
+ // examine some or all of the custom element's attributes.
6789
6830
  if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
6790
- !isMatchingElement(vnode, elm, renderer)) {
6831
+ !isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
6791
6832
  return handleMismatch(elm, vnode, renderer);
6792
6833
  }
6793
6834
  const { sel, mode, ctor, owner } = vnode;
@@ -6881,7 +6922,7 @@
6881
6922
  }
6882
6923
  return true;
6883
6924
  }
6884
- function isMatchingElement(vnode, elm, renderer) {
6925
+ function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true) {
6885
6926
  const { getProperty } = renderer;
6886
6927
  if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
6887
6928
  if (process.env.NODE_ENV !== 'production') {
@@ -6889,10 +6930,14 @@
6889
6930
  }
6890
6931
  return false;
6891
6932
  }
6892
- const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
6893
- const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
6894
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
6895
- return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6933
+ const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
6934
+ const hasCompatibleClass = shouldValidateAttr('class')
6935
+ ? validateClassAttr(vnode, elm, renderer)
6936
+ : true;
6937
+ const hasCompatibleStyle = shouldValidateAttr('style')
6938
+ ? validateStyleAttr(vnode, elm, renderer)
6939
+ : true;
6940
+ return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
6896
6941
  }
6897
6942
  function attributeValuesAreEqual(vnodeValue, value) {
6898
6943
  const vnodeValueAsString = String(vnodeValue);
@@ -6907,12 +6952,15 @@
6907
6952
  // In all other cases, the two values are not considered equal
6908
6953
  return false;
6909
6954
  }
6910
- function validateAttrs(vnode, elm, renderer) {
6955
+ function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
6911
6956
  const { data: { attrs = {} }, } = vnode;
6912
6957
  let nodesAreCompatible = true;
6913
6958
  // Validate attributes, though we could always recovery from those by running the update mods.
6914
6959
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6915
6960
  for (const [attrName, attrValue] of Object.entries(attrs)) {
6961
+ if (!shouldValidateAttr(attrName)) {
6962
+ continue;
6963
+ }
6916
6964
  const { owner } = vnode;
6917
6965
  const { getAttribute } = renderer;
6918
6966
  const elmAttrValue = getAttribute(elm, attrName);
@@ -7336,7 +7384,7 @@
7336
7384
  }
7337
7385
  return getReadOnlyProxy(obj);
7338
7386
  }
7339
- /* version: 2.45.1 */
7387
+ /* version: 2.45.2 */
7340
7388
 
7341
7389
  /*
7342
7390
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7764,7 +7812,7 @@
7764
7812
  function isNull(obj) {
7765
7813
  return obj === null;
7766
7814
  }
7767
- /** version: 2.45.1 */
7815
+ /** version: 2.45.2 */
7768
7816
 
7769
7817
  /*
7770
7818
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8383,7 +8431,7 @@
8383
8431
  });
8384
8432
  }));
8385
8433
  }
8386
- /* version: 2.45.1 */
8434
+ /* version: 2.45.2 */
8387
8435
 
8388
8436
  exports.LightningElement = LightningElement;
8389
8437
  exports.__unstable__ProfilerControl = profilerControl;