@lwrjs/everywhere 0.15.0-alpha.14 → 0.15.0-alpha.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/5c068641cc7fba28a6a2b9a0bbc1231e/config.js +12 -0
  2. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_15_0-alpha_16/s/272183c0b6e02561b7c96a1b23473837/@lwrjs_app-service_amd-bootstrap_module_amd.js +14 -0
  3. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{7_2_6/s/2c1a453f5aacf4954c53d3b64f4de7ee → 8_1_0/s/3b58f0c81f8eab543240d6ba477144fd}/lwc.js +411 -131
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -3
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/d7186d4fbbc58762dab0d51cc1f0afb8/lwr_init.js +21 -21
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_15_0-alpha_14/s/c5e8a68db2215662439b0e7df74fd3b0 → 0_15_0-alpha_16/s/4a5bf9e9f79210694ac9055d66782894}/lwr_loader.js +3 -3
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js +1 -1
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/lwr-error-shim.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_15_0-alpha_14 → 0_15_0-alpha_16}/lwr-loader-shim.bundle.js +6 -6
  13. package/build/assets/amd/lwr-everywhere-debug.js +8 -8
  14. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  15. package/build/assets/amd/lwr-everywhere.js +8 -8
  16. package/build/assets/core/lwr-everywhere-debug.js +4 -4
  17. package/build/assets/core/lwr-everywhere.js +4 -4
  18. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  19. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  20. package/build/assets/esm/lwr-everywhere.js +1 -1
  21. package/package.json +6 -6
  22. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/607c9bf73b094159bf201e7121406cc1/config.js +0 -12
  23. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_15_0-alpha_14/s/272183c0b6e02561b7c96a1b23473837/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/8_1_0', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (c) 2024 Salesforce, Inc.
@@ -82,6 +82,8 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
82
82
  getOwnPropertyDescriptors,
83
83
  /** Detached {@linkcode Object.getOwnPropertyNames}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames MDN Reference}. */
84
84
  getOwnPropertyNames: getOwnPropertyNames$1,
85
+ /** Detached {@linkcode Object.getOwnPropertySymbols}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols MDN Reference}. */
86
+ getOwnPropertySymbols: getOwnPropertySymbols$1,
85
87
  /** Detached {@linkcode Object.getPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf MDN Reference}. */
86
88
  getPrototypeOf: getPrototypeOf$1,
87
89
  /** Detached {@linkcode Object.hasOwnProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty MDN Reference}. */
@@ -295,7 +297,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
295
297
  // These must be updated when the enum is updated.
296
298
  // It's a bit annoying to do have to do this manually, but this makes the file tree-shakeable,
297
299
  // passing the `verify-treeshakeable.js` test.
298
- const allVersions = [58 /* APIVersion.V58_244_SUMMER_23 */, 59 /* APIVersion.V59_246_WINTER_24 */, 60 /* APIVersion.V60_248_SPRING_24 */, 61 /* APIVersion.V61_250_SUMMER_24 */, 62 /* APIVersion.V62_252_WINTER_25 */];
300
+ const allVersions = [58 /* APIVersion.V58_244_SUMMER_23 */, 59 /* APIVersion.V59_246_WINTER_24 */, 60 /* APIVersion.V60_248_SPRING_24 */, 61 /* APIVersion.V61_250_SUMMER_24 */, 62 /* APIVersion.V62_252_WINTER_25 */, 63 /* APIVersion.V63_254_SPRING_25 */];
299
301
  const LOWEST_API_VERSION = allVersions[0];
300
302
  /**
301
303
  *
@@ -319,6 +321,8 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
319
321
  case 9 /* APIFeature.ENABLE_THIS_DOT_STYLE */:
320
322
  case 10 /* APIFeature.TEMPLATE_CLASS_NAME_OBJECT_BINDING */:
321
323
  return apiVersion >= 62 /* APIVersion.V62_252_WINTER_25 */;
324
+ case 11 /* APIFeature.ENABLE_COMPLEX_TEMPLATE_EXPRESSIONS */:
325
+ return apiVersion >= 63 /* APIVersion.V63_254_SPRING_25 */;
322
326
  }
323
327
  }
324
328
 
@@ -448,9 +452,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
448
452
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
449
453
  */
450
454
  // Increment whenever the LWC template compiler changes
451
- const LWC_VERSION = "7.2.6";
455
+ const LWC_VERSION = "8.1.0";
452
456
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
453
- /** version: 7.2.6 */
457
+ /** version: 8.1.0 */
454
458
 
455
459
  /**
456
460
  * Copyright (c) 2024 Salesforce, Inc.
@@ -537,7 +541,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
537
541
  setFeatureFlag(name, value);
538
542
  }
539
543
  }
540
- /** version: 7.2.6 */
544
+ /** version: 8.1.0 */
541
545
 
542
546
  /**
543
547
  * Copyright (c) 2024 Salesforce, Inc.
@@ -712,7 +716,220 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
712
716
  }
713
717
 
714
718
  /*
715
- * Copyright (c) 2019, salesforce.com, inc.
719
+ * Copyright (c) 2018, salesforce.com, inc.
720
+ * All rights reserved.
721
+ * SPDX-License-Identifier: MIT
722
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
723
+ */
724
+ let nextTickCallbackQueue = [];
725
+ const SPACE_CHAR = 32;
726
+ const EmptyObject = seal(create(null));
727
+ const EmptyArray = seal([]);
728
+ function flushCallbackQueue() {
729
+ if (process.env.NODE_ENV !== 'production') {
730
+ if (nextTickCallbackQueue.length === 0) {
731
+ throw new Error(`Internal Error: If callbackQueue is scheduled, it is because there must be at least one callback on this pending queue.`);
732
+ }
733
+ }
734
+ const callbacks = nextTickCallbackQueue;
735
+ nextTickCallbackQueue = []; // reset to a new queue
736
+ for (let i = 0, len = callbacks.length; i < len; i += 1) {
737
+ callbacks[i]();
738
+ }
739
+ }
740
+ function addCallbackToNextTick(callback) {
741
+ if (process.env.NODE_ENV !== 'production') {
742
+ if (!isFunction$1(callback)) {
743
+ throw new Error(`Internal Error: addCallbackToNextTick() can only accept a function callback`);
744
+ }
745
+ }
746
+ if (nextTickCallbackQueue.length === 0) {
747
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
748
+ Promise.resolve().then(flushCallbackQueue);
749
+ }
750
+ ArrayPush$1.call(nextTickCallbackQueue, callback);
751
+ }
752
+ function guid() {
753
+ function s4() {
754
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
755
+ }
756
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
757
+ }
758
+ // Borrowed from Vue template compiler.
759
+ // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
760
+ const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
761
+ const PROPERTY_DELIMITER = /:(.+)/;
762
+ function parseStyleText(cssText) {
763
+ const styleMap = {};
764
+ const declarations = cssText.split(DECLARATION_DELIMITER);
765
+ for (const declaration of declarations) {
766
+ if (declaration) {
767
+ const [prop, value] = declaration.split(PROPERTY_DELIMITER);
768
+ if (prop !== undefined && value !== undefined) {
769
+ styleMap[prop.trim()] = value.trim();
770
+ }
771
+ }
772
+ }
773
+ return styleMap;
774
+ }
775
+ // Make a shallow copy of an object but omit the given key
776
+ function cloneAndOmitKey(object, keyToOmit) {
777
+ const result = {};
778
+ for (const key of keys(object)) {
779
+ if (key !== keyToOmit) {
780
+ result[key] = object[key];
781
+ }
782
+ }
783
+ return result;
784
+ }
785
+ function flattenStylesheets(stylesheets) {
786
+ const list = [];
787
+ for (const stylesheet of stylesheets) {
788
+ if (!isArray$1(stylesheet)) {
789
+ list.push(stylesheet);
790
+ } else {
791
+ list.push(...flattenStylesheets(stylesheet));
792
+ }
793
+ }
794
+ return list;
795
+ }
796
+ // Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
797
+ function assertNotProd() {
798
+ /* istanbul ignore if */
799
+ if (process.env.NODE_ENV === 'production') {
800
+ // this method should never leak to prod
801
+ throw new ReferenceError();
802
+ }
803
+ }
804
+ function shouldBeFormAssociated(Ctor) {
805
+ const ctorFormAssociated = Boolean(Ctor.formAssociated);
806
+ const apiVersion = getComponentAPIVersion(Ctor);
807
+ const apiFeatureEnabled = isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
808
+ if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
809
+ const tagName = getComponentRegisteredName(Ctor);
810
+ logWarnOnce(`Component <${tagName}> set static formAssociated to true, but form ` + `association is not enabled because the API version is ${apiVersion}. To enable form association, ` + `update the LWC component API version to 61 or above. https://lwc.dev/guide/versioning`);
811
+ }
812
+ return ctorFormAssociated && apiFeatureEnabled;
813
+ }
814
+
815
+ /*
816
+ * Copyright (c) 2024, Salesforce, Inc.
817
+ * All rights reserved.
818
+ * SPDX-License-Identifier: MIT
819
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
820
+ */
821
+ //
822
+ // Do additional mutation tracking for DevTools performance profiling, in dev mode only.
823
+ //
824
+ const reactiveObserversToVMs = new WeakMap();
825
+ const targetsToPropertyKeys = new WeakMap();
826
+ let mutationLogs = [];
827
+ // Create a human-readable member access notation like `obj.foo` or `arr[1]`,
828
+ // handling edge cases like `obj[Symbol("bar")]` and `obj["spaces here"]`
829
+ function toPrettyMemberNotation(parent, child) {
830
+ if (isUndefined$1(parent)) {
831
+ // Bare prop, just stringify the child
832
+ return toString$1(child);
833
+ } else if (!isString(child)) {
834
+ // Symbol/number, e.g. `obj[Symbol("foo")]` or `obj[1234]`
835
+ return `${toString$1(parent)}[${toString$1(child)}]`;
836
+ } else if (/^\w+$/.test(child)) {
837
+ // Dot-notation-safe string, e.g. `obj.foo`
838
+ return `${toString$1(parent)}.${child}`;
839
+ } else {
840
+ // Bracket-notation-requiring string, e.g. `obj["prop with spaces"]`
841
+ return `${toString$1(parent)}[${JSON.stringify(child)}]`;
842
+ }
843
+ }
844
+ /**
845
+ * Flush all the logs we've written so far and return the current logs.
846
+ */
847
+ function getAndFlushMutationLogs() {
848
+ assertNotProd();
849
+ const result = mutationLogs;
850
+ mutationLogs = [];
851
+ return result;
852
+ }
853
+ /**
854
+ * Log a new mutation for this reactive observer.
855
+ * @param reactiveObserver - relevant ReactiveObserver
856
+ * @param target - target object that is being observed
857
+ * @param key - key (property) that was mutated
858
+ */
859
+ function logMutation(reactiveObserver, target, key) {
860
+ assertNotProd();
861
+ const parentKey = targetsToPropertyKeys.get(target);
862
+ const vm = reactiveObserversToVMs.get(reactiveObserver);
863
+ /* istanbul ignore if */
864
+ if (isUndefined$1(vm)) {
865
+ // VM should only be undefined in Vitest tests, where a reactive observer is not always associated with a VM
866
+ // because the unit tests just create Reactive Observers on-the-fly.
867
+ // Note we could explicitly target Vitest with `process.env.NODE_ENV === 'test'`, but then that would also
868
+ // affect our downstream consumers' Jest/Vitest tests, and we don't want to throw an error just for a logger.
869
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
870
+ throw new Error('The VM should always be defined except possibly in unit tests');
871
+ }
872
+ } else {
873
+ const prop = toPrettyMemberNotation(parentKey, key);
874
+ ArrayPush$1.call(mutationLogs, {
875
+ vm,
876
+ prop
877
+ });
878
+ }
879
+ }
880
+ /**
881
+ * Flush logs associated with a given VM.
882
+ * @param vm - given VM
883
+ */
884
+ function flushMutationLogsForVM(vm) {
885
+ assertNotProd();
886
+ mutationLogs = ArrayFilter.call(mutationLogs, log => log.vm !== vm);
887
+ }
888
+ /**
889
+ * Mark this ReactiveObserver as related to this VM. This is only needed for mutation tracking in dev mode.
890
+ * @param reactiveObserver
891
+ * @param vm
892
+ */
893
+ function associateReactiveObserverWithVM(reactiveObserver, vm) {
894
+ assertNotProd();
895
+ reactiveObserversToVMs.set(reactiveObserver, vm);
896
+ }
897
+ /**
898
+ * Deeply track all objects in a target and associate with a given key.
899
+ * @param key - key associated with the object in the component
900
+ * @param target - tracked target object
901
+ */
902
+ function trackTargetForMutationLogging(key, target) {
903
+ assertNotProd();
904
+ if (targetsToPropertyKeys.has(target)) {
905
+ // Guard against recursive objects - don't traverse forever
906
+ return;
907
+ }
908
+ if (isObject(target) && !isNull(target)) {
909
+ // only track non-primitives; others are invalid as WeakMap keys
910
+ targetsToPropertyKeys.set(target, key);
911
+ // Deeply traverse arrays and objects to track every object within
912
+ if (isArray$1(target)) {
913
+ for (let i = 0; i < target.length; i++) {
914
+ trackTargetForMutationLogging(toPrettyMemberNotation(key, i), target[i]);
915
+ }
916
+ } else {
917
+ // Track only own property names and symbols (including non-enumerated)
918
+ // This is consistent with what observable-membrane does:
919
+ // https://github.com/salesforce/observable-membrane/blob/b85417f/src/base-handler.ts#L142-L143
920
+ // Note this code path is very hot, hence doing two separate for-loops rather than creating a new array.
921
+ for (const prop of getOwnPropertyNames$1(target)) {
922
+ trackTargetForMutationLogging(toPrettyMemberNotation(key, prop), target[prop]);
923
+ }
924
+ for (const prop of getOwnPropertySymbols$1(target)) {
925
+ trackTargetForMutationLogging(toPrettyMemberNotation(key, prop), target[prop]);
926
+ }
927
+ }
928
+ }
929
+ }
930
+
931
+ /*
932
+ * Copyright (c) 2024, Salesforce, Inc.
716
933
  * All rights reserved.
717
934
  * SPDX-License-Identifier: MIT
718
935
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -735,6 +952,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
735
952
  if (!isUndefined$1(reactiveObservers)) {
736
953
  for (let i = 0, len = reactiveObservers.length; i < len; i += 1) {
737
954
  const ro = reactiveObservers[i];
955
+ if (process.env.NODE_ENV !== 'production') {
956
+ logMutation(ro, target, key);
957
+ }
738
958
  ro.notify();
739
959
  }
740
960
  }
@@ -920,103 +1140,6 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
920
1140
  return new ReactiveObserver(callback);
921
1141
  }
922
1142
 
923
- /*
924
- * Copyright (c) 2018, salesforce.com, inc.
925
- * All rights reserved.
926
- * SPDX-License-Identifier: MIT
927
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
928
- */
929
- let nextTickCallbackQueue = [];
930
- const SPACE_CHAR = 32;
931
- const EmptyObject = seal(create(null));
932
- const EmptyArray = seal([]);
933
- function flushCallbackQueue() {
934
- if (process.env.NODE_ENV !== 'production') {
935
- if (nextTickCallbackQueue.length === 0) {
936
- throw new Error(`Internal Error: If callbackQueue is scheduled, it is because there must be at least one callback on this pending queue.`);
937
- }
938
- }
939
- const callbacks = nextTickCallbackQueue;
940
- nextTickCallbackQueue = []; // reset to a new queue
941
- for (let i = 0, len = callbacks.length; i < len; i += 1) {
942
- callbacks[i]();
943
- }
944
- }
945
- function addCallbackToNextTick(callback) {
946
- if (process.env.NODE_ENV !== 'production') {
947
- if (!isFunction$1(callback)) {
948
- throw new Error(`Internal Error: addCallbackToNextTick() can only accept a function callback`);
949
- }
950
- }
951
- if (nextTickCallbackQueue.length === 0) {
952
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
953
- Promise.resolve().then(flushCallbackQueue);
954
- }
955
- ArrayPush$1.call(nextTickCallbackQueue, callback);
956
- }
957
- function guid() {
958
- function s4() {
959
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
960
- }
961
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
962
- }
963
- // Borrowed from Vue template compiler.
964
- // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
965
- const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
966
- const PROPERTY_DELIMITER = /:(.+)/;
967
- function parseStyleText(cssText) {
968
- const styleMap = {};
969
- const declarations = cssText.split(DECLARATION_DELIMITER);
970
- for (const declaration of declarations) {
971
- if (declaration) {
972
- const [prop, value] = declaration.split(PROPERTY_DELIMITER);
973
- if (prop !== undefined && value !== undefined) {
974
- styleMap[prop.trim()] = value.trim();
975
- }
976
- }
977
- }
978
- return styleMap;
979
- }
980
- // Make a shallow copy of an object but omit the given key
981
- function cloneAndOmitKey(object, keyToOmit) {
982
- const result = {};
983
- for (const key of keys(object)) {
984
- if (key !== keyToOmit) {
985
- result[key] = object[key];
986
- }
987
- }
988
- return result;
989
- }
990
- function flattenStylesheets(stylesheets) {
991
- const list = [];
992
- for (const stylesheet of stylesheets) {
993
- if (!isArray$1(stylesheet)) {
994
- list.push(stylesheet);
995
- } else {
996
- list.push(...flattenStylesheets(stylesheet));
997
- }
998
- }
999
- return list;
1000
- }
1001
- // Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
1002
- function assertNotProd() {
1003
- /* istanbul ignore if */
1004
- if (process.env.NODE_ENV === 'production') {
1005
- // this method should never leak to prod
1006
- throw new ReferenceError();
1007
- }
1008
- }
1009
- function shouldBeFormAssociated(Ctor) {
1010
- const ctorFormAssociated = Boolean(Ctor.formAssociated);
1011
- const apiVersion = getComponentAPIVersion(Ctor);
1012
- const apiFeatureEnabled = isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
1013
- if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
1014
- const tagName = getComponentRegisteredName(Ctor);
1015
- logWarnOnce(`Component <${tagName}> set static formAssociated to true, but form ` + `association is not enabled because the API version is ${apiVersion}. To enable form association, ` + `update the LWC component API version to 61 or above. https://lwc.dev/guide/versioning`);
1016
- }
1017
- return ctorFormAssociated && apiFeatureEnabled;
1018
- }
1019
-
1020
1143
  /*
1021
1144
  * Copyright (c) 2020, salesforce.com, inc.
1022
1145
  * All rights reserved.
@@ -1721,7 +1844,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
1721
1844
  valueMutated(originalTarget, key);
1722
1845
  return true;
1723
1846
  }
1724
- /*LWC compiler v7.2.6*/
1847
+ /*LWC compiler v8.1.0*/
1725
1848
  }
1726
1849
  const getterMap = new WeakMap();
1727
1850
  const setterMap = new WeakMap();
@@ -1814,7 +1937,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
1814
1937
  /* istanbul ignore next */
1815
1938
  return false;
1816
1939
  }
1817
- /*LWC compiler v7.2.6*/
1940
+ /*LWC compiler v8.1.0*/
1818
1941
  }
1819
1942
  function extract(objectOrArray) {
1820
1943
  if (isArray(objectOrArray)) {
@@ -2813,6 +2936,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
2813
2936
  });
2814
2937
  }
2815
2938
  });
2939
+ if (process.env.NODE_ENV !== 'production') {
2940
+ associateReactiveObserverWithVM(ro, getAssociatedVM(component));
2941
+ }
2816
2942
  const computeConfigAndUpdate = () => {
2817
2943
  let config;
2818
2944
  ro.observe(() => config = configCallback(component));
@@ -3094,7 +3220,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
3094
3220
  * SPDX-License-Identifier: MIT
3095
3221
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3096
3222
  */
3097
- function track(target) {
3223
+ function track(target,
3224
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3225
+ context) {
3098
3226
  if (arguments.length === 1) {
3099
3227
  return getReactiveProxy(target);
3100
3228
  }
@@ -3123,6 +3251,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
3123
3251
  }
3124
3252
  }
3125
3253
  const reactiveOrAnyValue = getReactiveProxy(newValue);
3254
+ if (process.env.NODE_ENV !== 'production') {
3255
+ trackTargetForMutationLogging(key, newValue);
3256
+ }
3126
3257
  updateComponentValue(vm, key, reactiveOrAnyValue);
3127
3258
  },
3128
3259
  enumerable: true,
@@ -3567,7 +3698,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
3567
3698
  }
3568
3699
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3569
3700
  const HTMLBridgeElement = class extends SuperClass {
3570
- /*LWC compiler v7.2.6*/
3701
+ /*LWC compiler v8.1.0*/
3571
3702
  };
3572
3703
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3573
3704
  // and false positives in case of inheritance.
@@ -6581,20 +6712,48 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
6581
6712
  });
6582
6713
 
6583
6714
  /*
6584
- * Copyright (c) 2018, salesforce.com, inc.
6715
+ * Copyright (c) 2024, Salesforce, Inc.
6585
6716
  * All rights reserved.
6586
6717
  * SPDX-License-Identifier: MIT
6587
6718
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6588
6719
  */
6589
6720
  const operationIdNameMapping = ['constructor', 'render', 'patch', 'connectedCallback', 'renderedCallback', 'disconnectedCallback', 'errorCallback', 'lwc-hydrate', 'lwc-rehydrate'];
6721
+ const operationTooltipMapping = [
6722
+ // constructor
6723
+ 'component constructor()',
6724
+ // render
6725
+ 'component render() and virtual DOM rendered',
6726
+ // patch
6727
+ 'component DOM rendered',
6728
+ // connectedCallback
6729
+ 'component connectedCallback()',
6730
+ // renderedCallback
6731
+ 'component renderedCallback()',
6732
+ // disconnectedCallback
6733
+ 'component disconnectedCallback()',
6734
+ // errorCallback
6735
+ 'component errorCallback()',
6736
+ // lwc-hydrate
6737
+ 'component first rendered',
6738
+ // lwc-rehydrate
6739
+ 'component re-rendered'];
6590
6740
  // Even if all the browser the engine supports implements the UserTiming API, we need to guard the measure APIs.
6591
6741
  // JSDom (used in Jest) for example doesn't implement the UserTiming APIs.
6592
6742
  const isUserTimingSupported = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
6593
6743
  const start = !isUserTimingSupported ? noop : markName => {
6594
6744
  performance.mark(markName);
6595
6745
  };
6596
- const end = !isUserTimingSupported ? noop : (measureName, markName) => {
6597
- performance.measure(measureName, markName);
6746
+ const end = !isUserTimingSupported ? noop : (measureName, markName, devtools) => {
6747
+ performance.measure(measureName, {
6748
+ start: markName,
6749
+ detail: {
6750
+ devtools: {
6751
+ dataType: 'track-entry',
6752
+ track: '⚡️ Lightning Web Components',
6753
+ ...devtools
6754
+ }
6755
+ }
6756
+ });
6598
6757
  // Clear the created marks and measure to avoid filling the performance entries buffer.
6599
6758
  // Note: Even if the entries get deleted, existing PerformanceObservers preserve a copy of those entries.
6600
6759
  performance.clearMarks(markName);
@@ -6611,6 +6770,85 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
6611
6770
  // the right measures for components that are recursive.
6612
6771
  return `${getMeasureName(opId, vm)} - ${vm.idx}`;
6613
6772
  }
6773
+ function getProperties(vm) {
6774
+ return [['Tag Name', vm.tagName], ['Component ID', String(vm.idx)], ['Render Mode', vm.renderMode === 0 /* RenderMode.Light */ ? 'light DOM' : 'shadow DOM'], ['Shadow Mode', vm.shadowMode === 0 /* ShadowMode.Native */ ? 'native' : 'synthetic']];
6775
+ }
6776
+ function getColor(opId) {
6777
+ // As of Sept 2024: primary (dark blue), secondary (light blue), tertiary (green)
6778
+ switch (opId) {
6779
+ // GlobalHydrate and Constructor tend to occur at the top level
6780
+ case 7 /* OperationId.GlobalHydrate */:
6781
+ case 0 /* OperationId.Constructor */:
6782
+ return 'primary';
6783
+ // GlobalRehydrate also occurs at the top level, but we want to use tertiary (green) because it's easier to
6784
+ // distinguish from primary, and at a glance you should be able to easily tell re-renders from first renders.
6785
+ case 8 /* OperationId.GlobalRehydrate */:
6786
+ return 'tertiary';
6787
+ // Everything else (patch/render/callbacks)
6788
+ default:
6789
+ return 'secondary';
6790
+ }
6791
+ }
6792
+ // Create a list of tag names to the properties that were mutated, to help answer the question of
6793
+ // "why did this component re-render?"
6794
+ function getMutationProperties(mutationLogs) {
6795
+ // `mutationLogs` should never have length 0, but bail out if it does for whatever reason
6796
+ if (isUndefined$1(mutationLogs)) {
6797
+ return EmptyArray;
6798
+ }
6799
+ if (!mutationLogs.length) {
6800
+ // Currently this only occurs for experimental signals, because those mutations are not triggered by accessors
6801
+ // TODO [#4546]: support signals in mutation logging
6802
+ return EmptyArray;
6803
+ }
6804
+ // Keep track of unique IDs per tag name so we can just report a raw count at the end, e.g.
6805
+ // `<x-foo> (x2)` to indicate that two instances of `<x-foo>` were rendered.
6806
+ const tagNamesToIdsAndProps = new Map();
6807
+ for (const {
6808
+ vm: {
6809
+ tagName,
6810
+ idx
6811
+ },
6812
+ prop
6813
+ } of mutationLogs) {
6814
+ let idsAndProps = tagNamesToIdsAndProps.get(tagName);
6815
+ if (isUndefined$1(idsAndProps)) {
6816
+ idsAndProps = {
6817
+ ids: new Set(),
6818
+ keys: new Set()
6819
+ };
6820
+ tagNamesToIdsAndProps.set(tagName, idsAndProps);
6821
+ }
6822
+ idsAndProps.ids.add(idx);
6823
+ idsAndProps.keys.add(prop);
6824
+ }
6825
+ // Sort by tag name
6826
+ const entries = ArraySort.call([...tagNamesToIdsAndProps], (a, b) => a[0].localeCompare(b[0]));
6827
+ const tagNames = ArrayMap.call(entries, item => item[0]);
6828
+ // Show e.g. `<x-foo>` for one instance, or `<x-foo> (x2)` for two instances. (\u00D7 is multiplication symbol)
6829
+ const tagNamesToDisplayTagNames = new Map();
6830
+ for (const tagName of tagNames) {
6831
+ const {
6832
+ ids
6833
+ } = tagNamesToIdsAndProps.get(tagName);
6834
+ const displayTagName = `<${tagName}>${ids.size > 1 ? ` (\u00D7${ids.size})` : ''}`;
6835
+ tagNamesToDisplayTagNames.set(tagName, displayTagName);
6836
+ }
6837
+ // Summary row
6838
+ const usePlural = tagNames.length > 1 || tagNamesToIdsAndProps.get(tagNames[0]).ids.size > 1;
6839
+ const result = [[`Component${usePlural ? 's' : ''}`, ArrayJoin.call(ArrayMap.call(tagNames, _ => tagNamesToDisplayTagNames.get(_)), ', ')]];
6840
+ // Detail rows
6841
+ for (const [prettyTagName, {
6842
+ keys
6843
+ }] of entries) {
6844
+ const displayTagName = tagNamesToDisplayTagNames.get(prettyTagName);
6845
+ ArrayPush$1.call(result, [displayTagName, ArrayJoin.call(ArraySort.call([...keys]), ', ')]);
6846
+ }
6847
+ return result;
6848
+ }
6849
+ function getTooltipText(measureName, opId) {
6850
+ return `${measureName} - ${operationTooltipMapping[opId]}`;
6851
+ }
6614
6852
  /** Indicates if operations should be logged via the User Timing API. */
6615
6853
  const isMeasureEnabled = process.env.NODE_ENV !== 'production';
6616
6854
  /** Indicates if operations should be logged by the profiler. */
@@ -6648,30 +6886,60 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
6648
6886
  if (isMeasureEnabled) {
6649
6887
  const markName = getMarkName(opId, vm);
6650
6888
  const measureName = getMeasureName(opId, vm);
6651
- end(measureName, markName);
6889
+ end(measureName, markName, {
6890
+ color: getColor(opId),
6891
+ tooltipText: getTooltipText(measureName, opId),
6892
+ properties: getProperties(vm)
6893
+ });
6652
6894
  }
6653
6895
  if (isProfilerEnabled) {
6654
6896
  currentDispatcher(opId, 1 /* Phase.Stop */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6655
6897
  }
6656
6898
  }
6657
- function logGlobalOperationStart(opId, vm) {
6899
+ function logGlobalOperationStart(opId) {
6658
6900
  if (isMeasureEnabled) {
6659
- const opName = getOperationName(opId);
6660
- const markName = isUndefined$1(vm) ? opName : getMarkName(opId, vm);
6901
+ const markName = getOperationName(opId);
6902
+ start(markName);
6903
+ }
6904
+ if (isProfilerEnabled) {
6905
+ currentDispatcher(opId, 0 /* Phase.Start */);
6906
+ }
6907
+ }
6908
+ function logGlobalOperationStartWithVM(opId, vm) {
6909
+ if (isMeasureEnabled) {
6910
+ const markName = getMarkName(opId, vm);
6661
6911
  start(markName);
6662
6912
  }
6663
6913
  if (isProfilerEnabled) {
6664
- currentDispatcher(opId, 0 /* Phase.Start */, vm?.tagName, vm?.idx, vm?.renderMode, vm?.shadowMode);
6914
+ currentDispatcher(opId, 0 /* Phase.Start */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6915
+ }
6916
+ }
6917
+ function logGlobalOperationEnd(opId, mutationLogs) {
6918
+ if (isMeasureEnabled) {
6919
+ const opName = getOperationName(opId);
6920
+ const markName = opName;
6921
+ end(opName, markName, {
6922
+ color: getColor(opId),
6923
+ tooltipText: getTooltipText(opName, opId),
6924
+ properties: getMutationProperties(mutationLogs)
6925
+ });
6926
+ }
6927
+ if (isProfilerEnabled) {
6928
+ currentDispatcher(opId, 1 /* Phase.Stop */);
6665
6929
  }
6666
6930
  }
6667
- function logGlobalOperationEnd(opId, vm) {
6931
+ function logGlobalOperationEndWithVM(opId, vm) {
6668
6932
  if (isMeasureEnabled) {
6669
6933
  const opName = getOperationName(opId);
6670
- const markName = isUndefined$1(vm) ? opName : getMarkName(opId, vm);
6671
- end(opName, markName);
6934
+ const markName = getMarkName(opId, vm);
6935
+ end(opName, markName, {
6936
+ color: getColor(opId),
6937
+ tooltipText: getTooltipText(opName, opId),
6938
+ properties: getProperties(vm)
6939
+ });
6672
6940
  }
6673
6941
  if (isProfilerEnabled) {
6674
- currentDispatcher(opId, 1 /* Phase.Stop */, vm?.tagName, vm?.idx, vm?.renderMode, vm?.shadowMode);
6942
+ currentDispatcher(opId, 1 /* Phase.Stop */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6675
6943
  }
6676
6944
  }
6677
6945
 
@@ -7123,7 +7391,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7123
7391
  return apiVersion;
7124
7392
  }
7125
7393
  function getTemplateReactiveObserver(vm) {
7126
- return createReactiveObserver(() => {
7394
+ const reactiveObserver = createReactiveObserver(() => {
7127
7395
  const {
7128
7396
  isDirty
7129
7397
  } = vm;
@@ -7132,6 +7400,10 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7132
7400
  scheduleRehydration(vm);
7133
7401
  }
7134
7402
  });
7403
+ if (process.env.NODE_ENV !== 'production') {
7404
+ associateReactiveObserverWithVM(reactiveObserver, vm);
7405
+ }
7406
+ return reactiveObserver;
7135
7407
  }
7136
7408
  function resetTemplateObserverAndUnsubscribe(vm) {
7137
7409
  const {
@@ -7209,7 +7481,12 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7209
7481
  }
7210
7482
  function connectRootElement(elm) {
7211
7483
  const vm = getAssociatedVM(elm);
7212
- logGlobalOperationStart(7 /* OperationId.GlobalHydrate */, vm);
7484
+ if (process.env.NODE_ENV !== 'production') {
7485
+ // Flush any logs for this VM so that the initial properties from the constructor don't "count"
7486
+ // in subsequent re-renders (lwc-rehydrate). Right now we're at the first render (lwc-hydrate).
7487
+ flushMutationLogsForVM(vm);
7488
+ }
7489
+ logGlobalOperationStartWithVM(7 /* OperationId.GlobalHydrate */, vm);
7213
7490
  // Usually means moving the element from one place to another, which is observable via
7214
7491
  // life-cycle hooks.
7215
7492
  if (vm.state === 1 /* VMState.connected */) {
@@ -7217,7 +7494,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7217
7494
  }
7218
7495
  runConnectedCallback(vm);
7219
7496
  rehydrate(vm);
7220
- logGlobalOperationEnd(7 /* OperationId.GlobalHydrate */, vm);
7497
+ logGlobalOperationEndWithVM(7 /* OperationId.GlobalHydrate */, vm);
7221
7498
  }
7222
7499
  function disconnectRootElement(elm) {
7223
7500
  const vm = getAssociatedVM(elm);
@@ -7538,6 +7815,9 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7538
7815
  }
7539
7816
  let rehydrateQueue = [];
7540
7817
  function flushRehydrationQueue() {
7818
+ // Gather the logs before rehydration starts so they can be reported at the end of rehydration.
7819
+ // Note that we also clear all existing logs at this point so that subsequent re-renders start from a clean slate.
7820
+ const mutationLogs = process.env.NODE_ENV === 'production' ? undefined : getAndFlushMutationLogs();
7541
7821
  logGlobalOperationStart(8 /* OperationId.GlobalRehydrate */);
7542
7822
  if (process.env.NODE_ENV !== 'production') {
7543
7823
  assert.invariant(rehydrateQueue.length, `If rehydrateQueue was scheduled, it is because there must be at least one VM on this pending queue instead of ${rehydrateQueue}.`);
@@ -7557,13 +7837,13 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
7557
7837
  ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, i + 1));
7558
7838
  }
7559
7839
  // we need to end the measure before throwing.
7560
- logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
7840
+ logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */, mutationLogs);
7561
7841
  // re-throwing the original error will break the current tick, but since the next tick is
7562
7842
  // already scheduled, it should continue patching the rest.
7563
7843
  throw error;
7564
7844
  }
7565
7845
  }
7566
- logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
7846
+ logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */, mutationLogs);
7567
7847
  }
7568
7848
  function runConnectedCallback(vm) {
7569
7849
  const {
@@ -8989,7 +9269,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
8989
9269
  }
8990
9270
  return getReadOnlyProxy(obj);
8991
9271
  }
8992
- /** version: 7.2.6 */
9272
+ /** version: 8.1.0 */
8993
9273
 
8994
9274
  /*
8995
9275
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9283,7 +9563,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
9283
9563
  formStateRestoreCallback(state, reason) {
9284
9564
  runFormStateRestoreCallback(this, state, reason);
9285
9565
  }
9286
- /*LWC compiler v7.2.6*/
9566
+ /*LWC compiler v8.1.0*/
9287
9567
  };
9288
9568
  BaseHTMLElement = HTMLElement; // cache to track if it changes
9289
9569
  }
@@ -9298,7 +9578,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
9298
9578
  // Using a BaseUpgradableConstructor superclass here is a perf optimization to avoid
9299
9579
  // re-defining the same logic (connectedCallback, disconnectedCallback, etc.) over and over.
9300
9580
  class UpgradableConstructor extends BaseUpgradableConstructor {
9301
- /*LWC compiler v7.2.6*/
9581
+ /*LWC compiler v8.1.0*/
9302
9582
  }
9303
9583
  if (isFormAssociated) {
9304
9584
  // Perf optimization - the vast majority of components have formAssociated=false,
@@ -9421,7 +9701,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
9421
9701
  function isNull(obj) {
9422
9702
  return obj === null;
9423
9703
  }
9424
- /** version: 7.2.6 */
9704
+ /** version: 8.1.0 */
9425
9705
 
9426
9706
  /*
9427
9707
  * Copyright (c) 2023, salesforce.com, inc.
@@ -9441,7 +9721,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
9441
9721
  this.setNewContext = setNewContext;
9442
9722
  this.setDisconnectedCallback = setDisconnectedCallback;
9443
9723
  }
9444
- /*LWC compiler v7.2.6*/
9724
+ /*LWC compiler v8.1.0*/
9445
9725
  }
9446
9726
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
9447
9727
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -9864,7 +10144,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
9864
10144
  formStateRestoreCallback(state, reason) {
9865
10145
  runFormStateRestoreCallback(this, state, reason);
9866
10146
  }
9867
- /*LWC compiler v7.2.6*/
10147
+ /*LWC compiler v8.1.0*/
9868
10148
  }, _a.observedAttributes = observedAttributes,
9869
10149
  // Note CustomElementConstructor is not upgraded by LWC and inherits directly from HTMLElement which means it calls the native
9870
10150
  // attachInternals API.
@@ -10110,7 +10390,7 @@ LWR.define('lwc/v/7_2_6', ['exports'], (function (exports) { 'use strict';
10110
10390
  });
10111
10391
  });
10112
10392
  }
10113
- /** version: 7.2.6 */
10393
+ /** version: 8.1.0 */
10114
10394
 
10115
10395
  exports.LightningElement = LightningElement;
10116
10396
  exports.__unstable__ProfilerControl = profilerControl;