@lwrjs/everywhere 0.13.0-alpha.8 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/ab29f69e1f2a5d9eb36f43b3ffe25b15/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_13_0/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/{6_6_3/s/58be00f9ece0d8c0a817bddb6ae6b439 → 7_1_2/s/027fc9cd750ae64e43070ae2b597fad0}/lwc.js +231 -98
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_13_0-alpha_8 → 0_13_0}/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_13_0-alpha_8/s/f30361ad8ff7af505bf4d465c8499181 → 0_13_0/s/d7186d4fbbc58762dab0d51cc1f0afb8}/lwr_init.js +21 -25
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_13_0-alpha_8/s/93ed759b78ad5d85a81258993da51177 → 0_13_0/s/a4ce234eff00f57b1a2d6e7bce8337de}/lwr_loader.js +17 -9
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_13_0-alpha_8/s/274c8343f810353bbad085a79709395f → 0_13_0/s/fb8c5dd340c69fdf7ded52d3eba633b9}/lwr_metrics.js +2 -2
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_13_0-alpha_8 → 0_13_0}/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_13_0-alpha_8 → 0_13_0}/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_13_0-alpha_8 → 0_13_0}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/0_13_0/lwr-error-shim.js +8 -0
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_13_0-alpha_8 → 0_13_0}/lwr-loader-shim.bundle.js +41 -22
  13. package/build/amd-client.js +1 -1
  14. package/build/assets/amd/lwr-everywhere-debug.js +26 -18
  15. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  16. package/build/assets/amd/lwr-everywhere.js +26 -18
  17. package/build/assets/core/lwr-everywhere-debug.js +22 -14
  18. package/build/assets/core/lwr-everywhere-min.js +2 -2
  19. package/build/assets/core/lwr-everywhere.js +22 -14
  20. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  21. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  22. package/build/assets/esm/lwr-everywhere.js +1 -1
  23. package/build/esm-client.js +1 -1
  24. package/build/generate.d.ts +1 -1
  25. package/build/modules/lwr/everywhere/everywhere.js +1 -1
  26. package/build/modules/lwr/host/host.js +1 -1
  27. package/build/modules/lwr/setupLDS/setupLDS.js +1 -1
  28. package/package.json +10 -10
  29. package/src/amd-client.ts +2 -2
  30. package/src/esm-client.ts +2 -2
  31. package/src/generate.ts +1 -1
  32. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/77b94097c2f300f6c2a2d64b775d196a/config.js +0 -12
  33. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_13_0-alpha_8/s/272183c0b6e02561b7c96a1b23473837/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
  34. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/0_13_0-alpha_8/lwr-error-shim.js +0 -8
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/7_1_2', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (c) 2024 Salesforce, Inc.
@@ -153,7 +153,8 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
153
153
  replace: StringReplace,
154
154
  split: StringSplit,
155
155
  slice: StringSlice,
156
- toLowerCase: StringToLowerCase
156
+ toLowerCase: StringToLowerCase,
157
+ trim: StringTrim
157
158
  } = String.prototype;
158
159
  /**
159
160
  * Determines whether the argument is `undefined`.
@@ -309,10 +310,13 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
309
310
  case 5 /* APIFeature.USE_COMMENTS_FOR_FRAGMENT_BOOKENDS */:
310
311
  case 2 /* APIFeature.USE_FRAGMENTS_FOR_LIGHT_DOM_SLOTS */:
311
312
  return apiVersion >= 60 /* APIVersion.V60_248_SPRING_24 */;
312
- case 8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */:
313
- case 7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */:
313
+ case 7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */:
314
314
  case 6 /* APIFeature.USE_LIGHT_DOM_SLOT_FORWARDING */:
315
315
  return apiVersion >= 61 /* APIVersion.V61_250_SUMMER_24 */;
316
+ case 8 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */:
317
+ case 9 /* APIFeature.ENABLE_THIS_DOT_STYLE */:
318
+ case 10 /* APIFeature.TEMPLATE_CLASS_NAME_OBJECT_BINDING */:
319
+ return apiVersion >= 62 /* APIVersion.V62_252_WINTER_25 */;
316
320
  }
317
321
  }
318
322
 
@@ -442,9 +446,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
442
446
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
443
447
  */
444
448
  // Increment whenever the LWC template compiler changes
445
- const LWC_VERSION = "6.6.3";
449
+ const LWC_VERSION = "7.1.2";
446
450
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
447
- /** version: 6.6.3 */
451
+ /** version: 7.1.2 */
448
452
 
449
453
  /**
450
454
  * Copyright (c) 2024 Salesforce, Inc.
@@ -530,7 +534,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
530
534
  setFeatureFlag(name, value);
531
535
  }
532
536
  }
533
- /** version: 6.6.3 */
537
+ /** version: 7.1.2 */
534
538
 
535
539
  /**
536
540
  * Copyright (c) 2024 Salesforce, Inc.
@@ -953,14 +957,6 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
953
957
  }
954
958
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
955
959
  }
956
- function shouldUseNativeCustomElementLifecycle(ctor) {
957
- if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
958
- // temporary "kill switch"
959
- return false;
960
- }
961
- const apiVersion = getComponentAPIVersion(ctor);
962
- return isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
963
- }
964
960
  // Borrowed from Vue template compiler.
965
961
  // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
966
962
  const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
@@ -1010,7 +1006,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
1010
1006
  function shouldBeFormAssociated(Ctor) {
1011
1007
  const ctorFormAssociated = Boolean(Ctor.formAssociated);
1012
1008
  const apiVersion = getComponentAPIVersion(Ctor);
1013
- const apiFeatureEnabled = isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
1009
+ const apiFeatureEnabled = isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
1014
1010
  if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
1015
1011
  const tagName = getComponentRegisteredName(Ctor);
1016
1012
  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`);
@@ -1722,7 +1718,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
1722
1718
  valueMutated(originalTarget, key);
1723
1719
  return true;
1724
1720
  }
1725
- /*LWC compiler v6.6.3*/
1721
+ /*LWC compiler v7.1.2*/
1726
1722
  }
1727
1723
  const getterMap = new WeakMap();
1728
1724
  const setterMap = new WeakMap();
@@ -1815,7 +1811,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
1815
1811
  /* istanbul ignore next */
1816
1812
  return false;
1817
1813
  }
1818
- /*LWC compiler v6.6.3*/
1814
+ /*LWC compiler v7.1.2*/
1819
1815
  }
1820
1816
  function extract(objectOrArray) {
1821
1817
  if (isArray(objectOrArray)) {
@@ -2097,7 +2093,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
2097
2093
  }
2098
2094
 
2099
2095
  /*
2100
- * Copyright (c) 2018, salesforce.com, inc.
2096
+ * Copyright (c) 2024, Salesforce, Inc.
2101
2097
  * All rights reserved.
2102
2098
  * SPDX-License-Identifier: MIT
2103
2099
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2417,7 +2413,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
2417
2413
  attachInternals
2418
2414
  }
2419
2415
  } = vm;
2420
- if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
2416
+ if (!isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
2421
2417
  throw new Error(`The attachInternals API is only supported in API version 61 and above. ` + `The current version is ${apiVersion}. ` + `To use this API, update the LWC component API version. https://lwc.dev/guide/versioning`);
2422
2418
  }
2423
2419
  if (vm.shadowMode === 1 /* ShadowMode.Synthetic */) {
@@ -2459,6 +2455,21 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
2459
2455
  }
2460
2456
  return vm.shadowRoot;
2461
2457
  },
2458
+ get hostElement() {
2459
+ const vm = getAssociatedVM(this);
2460
+ const apiVersion = getComponentAPIVersion(vm.def.ctor);
2461
+ if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */, apiVersion)) {
2462
+ if (process.env.NODE_ENV !== 'production') {
2463
+ logWarnOnce('The `this.hostElement` API within LightningElement is ' + 'only supported in API version 62 and above. Increase the API version to use it.');
2464
+ }
2465
+ // Simulate the old behavior for `this.hostElement` to avoid a breaking change
2466
+ return undefined;
2467
+ }
2468
+ if (process.env.NODE_ENV !== 'production') {
2469
+ assert.isTrue(vm.elm instanceof Element, `this.hostElement should be an Element, found: ${vm.elm}`);
2470
+ }
2471
+ return vm.elm;
2472
+ },
2462
2473
  get refs() {
2463
2474
  const vm = getAssociatedVM(this);
2464
2475
  if (isUpdatingTemplate) {
@@ -2587,6 +2598,22 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
2587
2598
  } = getAssociatedVM(this);
2588
2599
  return renderer.getTagName(elm);
2589
2600
  },
2601
+ get style() {
2602
+ const {
2603
+ elm,
2604
+ renderer,
2605
+ def
2606
+ } = getAssociatedVM(this);
2607
+ const apiVersion = getComponentAPIVersion(def.ctor);
2608
+ if (!isAPIFeatureEnabled(9 /* APIFeature.ENABLE_THIS_DOT_STYLE */, apiVersion)) {
2609
+ if (process.env.NODE_ENV !== 'production') {
2610
+ logWarnOnce('The `this.style` API within LightningElement returning the CSSStyleDeclaration is ' + 'only supported in API version 62 and above. Increase the API version to use it.');
2611
+ }
2612
+ // Simulate the old behavior for `this.style` to avoid a breaking change
2613
+ return undefined;
2614
+ }
2615
+ return renderer.getStyle(elm);
2616
+ },
2590
2617
  render() {
2591
2618
  const vm = getAssociatedVM(this);
2592
2619
  return vm.def.template;
@@ -2968,12 +2995,21 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
2968
2995
  }
2969
2996
 
2970
2997
  /*
2971
- * Copyright (c) 2018, salesforce.com, inc.
2998
+ * Copyright (c) 2024, Salesforce, Inc.
2972
2999
  * All rights reserved.
2973
3000
  * SPDX-License-Identifier: MIT
2974
3001
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2975
3002
  */
2976
- function api$1() {
3003
+ /**
3004
+ * The `@api` decorator marks public fields and public methods in
3005
+ * LWC Components. This function implements the internals of this
3006
+ * decorator.
3007
+ */
3008
+ function api$1(
3009
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3010
+ value,
3011
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3012
+ context) {
2977
3013
  if (process.env.NODE_ENV !== 'production') {
2978
3014
  assert.fail(`@api decorator can only be used as a decorator function.`);
2979
3015
  }
@@ -3050,7 +3086,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3050
3086
  }
3051
3087
 
3052
3088
  /*
3053
- * Copyright (c) 2018, salesforce.com, inc.
3089
+ * Copyright (c) 2024, Salesforce, Inc.
3054
3090
  * All rights reserved.
3055
3091
  * SPDX-License-Identifier: MIT
3056
3092
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -3092,19 +3128,27 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3092
3128
  }
3093
3129
 
3094
3130
  /*
3095
- * Copyright (c) 2018, salesforce.com, inc.
3131
+ * Copyright (c) 2024, Salesforce, Inc.
3096
3132
  * All rights reserved.
3097
3133
  * SPDX-License-Identifier: MIT
3098
3134
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3099
3135
  */
3100
3136
  /**
3101
- * The @wire decorator wires fields and methods to a wire adapter in
3102
- * LWC Components. This function implements the internals of this
3103
- * decorator.
3104
- * @param _adapter
3105
- * @param _config
3106
- */
3107
- function wire(_adapter, _config) {
3137
+ * Decorator factory to wire a property or method to a wire adapter data source.
3138
+ * @param adapter the adapter used to provision data
3139
+ * @param config configuration object for the adapter
3140
+ * @returns A decorator function
3141
+ * @example
3142
+ * export default class WireExample extends LightningElement {
3143
+ * \@api bookId;
3144
+ * \@wire(getBook, { id: '$bookId'}) book;
3145
+ * }
3146
+ */
3147
+ function wire(
3148
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3149
+ adapter,
3150
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3151
+ config) {
3108
3152
  if (process.env.NODE_ENV !== 'production') {
3109
3153
  assert.fail('@wire(adapter, config?) may only be used as a decorator.');
3110
3154
  }
@@ -3140,11 +3184,11 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3140
3184
  */
3141
3185
  function getClassDescriptorType(descriptor) {
3142
3186
  if (isFunction$1(descriptor.value)) {
3143
- return "method" /* DescriptorType.Method */;
3187
+ return 'method';
3144
3188
  } else if (isFunction$1(descriptor.set) || isFunction$1(descriptor.get)) {
3145
- return "accessor" /* DescriptorType.Accessor */;
3189
+ return 'accessor';
3146
3190
  } else {
3147
- return "field" /* DescriptorType.Field */;
3191
+ return 'field';
3148
3192
  }
3149
3193
  }
3150
3194
  function validateObservedField(Ctor, fieldName, descriptor) {
@@ -3381,9 +3425,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3381
3425
  const versionMatcher = func.toString().match(LWC_VERSION_COMMENT_REGEX);
3382
3426
  if (!isNull(versionMatcher) && !warned) {
3383
3427
  const version = versionMatcher[1];
3384
- const [major, minor] = version.split('.');
3385
- const [expectedMajor, expectedMinor] = LWC_VERSION.split('.');
3386
- if (major !== expectedMajor || minor !== expectedMinor) {
3428
+ if (version !== LWC_VERSION) {
3387
3429
  warned = true; // only warn once to avoid flooding the console
3388
3430
  // stylesheets and templates do not have user-meaningful names, but components do
3389
3431
  const friendlyName = type === 'component' ? `${type} ${func.name}` : type;
@@ -3522,7 +3564,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3522
3564
  }
3523
3565
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3524
3566
  const HTMLBridgeElement = class extends SuperClass {
3525
- /*LWC compiler v6.6.3*/
3567
+ /*LWC compiler v7.1.2*/
3526
3568
  };
3527
3569
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3528
3570
  // and false positives in case of inheritance.
@@ -3932,9 +3974,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
3932
3974
  }
3933
3975
  for (const cssContent of cssContents) {
3934
3976
  const abortController = cssContentToAbortControllers.get(cssContent);
3935
- /* istanbul ignore if */
3936
3977
  if (isUndefined$1(abortController)) {
3937
- throw new Error('Cannot find AbortController for CSS content');
3978
+ // Two stylesheets with the same content will share an abort controller, in which case it only needs to be called once.
3979
+ continue;
3938
3980
  }
3939
3981
  abortController.abort();
3940
3982
  // remove association with AbortController in case stylesheet is rendered again
@@ -4040,7 +4082,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4040
4082
  let swappedStyleMap = /*@__PURE__@*/new WeakMap();
4041
4083
  // The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
4042
4084
  // so we don't want to create strong references to them.
4043
- // The weak keys are kind of useless, because Templates, LightningElementConstructors, and StylesheetFactories are
4085
+ // The weak keys are kind of useless, because Templates, LightningElementConstructors, and Stylesheets are
4044
4086
  // never GC'ed. But maybe they will be someday, so we may as well use weak keys too.
4045
4087
  // The "pure" annotations are so that Rollup knows for sure it can remove these from prod mode
4046
4088
  let activeTemplates = /*@__PURE__@*/new WeakMultiMap();
@@ -4074,6 +4116,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4074
4116
  }
4075
4117
  function rehydrateHotStyle(style) {
4076
4118
  const activeVMs = activeStyles.get(style);
4119
+ if (!activeVMs.size) {
4120
+ return true;
4121
+ }
4077
4122
  unrenderStylesheet(style);
4078
4123
  for (const vm of activeVMs) {
4079
4124
  // if a style definition is swapped, we must reset
@@ -4188,11 +4233,22 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4188
4233
  }
4189
4234
  function swapComponent(oldComponent, newComponent) {
4190
4235
  if (process.env.NODE_ENV !== 'production') {
4191
- if (isComponentConstructor(oldComponent) && isComponentConstructor(newComponent)) {
4236
+ const isOldCtorAComponent = isComponentConstructor(oldComponent);
4237
+ const isNewCtorAComponent = isComponentConstructor(newComponent);
4238
+ if (isOldCtorAComponent && isNewCtorAComponent) {
4192
4239
  swappedComponentMap.set(oldComponent, newComponent);
4193
4240
  return rehydrateHotComponent(oldComponent);
4241
+ } else if (isOldCtorAComponent === false && isNewCtorAComponent === true) {
4242
+ throw new TypeError(`Invalid Component: Attempting to swap a non-component with a component`);
4243
+ } else if (isOldCtorAComponent === true && isNewCtorAComponent === false) {
4244
+ throw new TypeError(`Invalid Component: Attempting to swap a component with a non-component`);
4194
4245
  } else {
4195
- throw new TypeError(`Invalid Component`);
4246
+ // The dev-server relies on the presence of registerComponent() as a way to determine a
4247
+ // component module. However, the compiler cannot definitively add registerComponent()
4248
+ // transformation only to a component constructor. Hence the dev-server may attempt to
4249
+ // hot swap javascript modules that look like a component and should not cause the app
4250
+ // to fail. To allow that, this api ignores such hot swap attempts.
4251
+ return false;
4196
4252
  }
4197
4253
  }
4198
4254
  return false;
@@ -4258,11 +4314,11 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4258
4314
  // But we keep it here just in case.
4259
4315
  logError(`Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4260
4316
  }
4261
- if (!isUndefined$1(ctorShadowSupportMode) && ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ && ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */ && ctorShadowSupportMode !== "native" /* ShadowSupportMode.Native */) {
4317
+ if (!isUndefined$1(ctorShadowSupportMode) && ctorShadowSupportMode !== 'any' && ctorShadowSupportMode !== 'reset' && ctorShadowSupportMode !== 'native') {
4262
4318
  logError(`Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
4263
4319
  }
4264
4320
  // TODO [#3971]: Completely remove shadowSupportMode "any"
4265
- if (ctorShadowSupportMode === "any" /* ShadowSupportMode.Any */) {
4321
+ if (ctorShadowSupportMode === 'any') {
4266
4322
  logWarn(`Invalid value 'any' for static property shadowSupportMode. 'any' is deprecated and will be removed in a future release--use 'native' instead.`);
4267
4323
  }
4268
4324
  if (!isUndefined$1(ctorRenderMode) && ctorRenderMode !== 'light' && ctorRenderMode !== 'shadow') {
@@ -4310,7 +4366,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4310
4366
  let shadowSupportMode = superDef.shadowSupportMode;
4311
4367
  if (!isUndefined$1(ctorShadowSupportMode)) {
4312
4368
  shadowSupportMode = ctorShadowSupportMode;
4313
- if (isReportingEnabled() && (shadowSupportMode === "any" /* ShadowSupportMode.Any */ || shadowSupportMode === "native" /* ShadowSupportMode.Native */)) {
4369
+ if (isReportingEnabled() && (shadowSupportMode === 'any' || shadowSupportMode === 'native')) {
4314
4370
  report("ShadowSupportModeUsage" /* ReportingEventId.ShadowSupportModeUsage */, {
4315
4371
  tagName: Ctor.name,
4316
4372
  mode: shadowSupportMode
@@ -4425,7 +4481,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4425
4481
  propsConfig: EmptyObject,
4426
4482
  methods: EmptyObject,
4427
4483
  renderMode: 1 /* RenderMode.Shadow */,
4428
- shadowSupportMode: "reset" /* ShadowSupportMode.Default */,
4484
+ shadowSupportMode: 'reset',
4429
4485
  formAssociated: undefined,
4430
4486
  wire: EmptyObject,
4431
4487
  bridge: BaseBridgeElement,
@@ -4456,7 +4512,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
4456
4512
  publicProps[key] = {
4457
4513
  config: propsConfig[key] || 0,
4458
4514
  // a property by default
4459
- type: "any" /* PropDefType.any */,
4515
+ type: 'any',
4460
4516
  // no type inference for public services
4461
4517
  attr: htmlPropertyToAttribute(key)
4462
4518
  };
@@ -5299,7 +5355,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
5299
5355
  // compiler may generate tagnames with uppercase letters so - for backwards
5300
5356
  // compatibility, we lower case the tagname here.
5301
5357
  const normalizedTagname = sel.toLowerCase();
5302
- const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(ctor);
5358
+ const useNativeLifecycle = !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE;
5303
5359
  const isFormAssociated = shouldBeFormAssociated(ctor);
5304
5360
  const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle, isFormAssociated);
5305
5361
  vnode.elm = elm;
@@ -5552,14 +5608,14 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
5552
5608
  context
5553
5609
  }
5554
5610
  } = vnode;
5555
- if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && context?.lwc?.dom === "manual" /* LwcDomMode.Manual */) {
5611
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && context?.lwc?.dom === 'manual') {
5556
5612
  elm.$domManual$ = true;
5557
5613
  }
5558
5614
  }
5559
5615
  function applyElementRestrictions(elm, vnode) {
5560
5616
  if (process.env.NODE_ENV !== 'production') {
5561
5617
  const isSynthetic = vnode.owner.shadowMode === 1 /* ShadowMode.Synthetic */;
5562
- const isPortal = vnode.type === 2 /* VNodeType.Element */ && vnode.data.context?.lwc?.dom === "manual" /* LwcDomMode.Manual */;
5618
+ const isPortal = vnode.type === 2 /* VNodeType.Element */ && vnode.data.context?.lwc?.dom === 'manual';
5563
5619
  const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
5564
5620
  patchElementWithRestrictions(elm, {
5565
5621
  isPortal,
@@ -5933,7 +5989,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
5933
5989
  factory,
5934
5990
  owner: getVMBeingRendered(),
5935
5991
  elm: undefined,
5936
- sel: undefined,
5992
+ sel: '__scoped_slot_fragment__',
5937
5993
  key: undefined,
5938
5994
  slotName
5939
5995
  };
@@ -5944,7 +6000,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
5944
6000
  const fragment = fragmentFactory(parts);
5945
6001
  const vnode = {
5946
6002
  type: 4 /* VNodeType.Static */,
5947
- sel: undefined,
6003
+ sel: '__static__',
5948
6004
  key,
5949
6005
  elm: undefined,
5950
6006
  fragment,
@@ -5962,7 +6018,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
5962
6018
  const trailing = useCommentNodes ? co('') : t('');
5963
6019
  return {
5964
6020
  type: 5 /* VNodeType.Fragment */,
5965
- sel: undefined,
6021
+ sel: '__fragment__',
5966
6022
  key,
5967
6023
  elm: undefined,
5968
6024
  children: [leading, ...children, trailing],
@@ -6077,10 +6133,18 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
6077
6133
  // to the vnode because the current way the diffing algo works, it will replace the original reference
6078
6134
  // to the host element with a new one. This means the new element will be mounted and immediately unmounted.
6079
6135
  // Creating a copy of the vnode to preserve a reference to the previous host element.
6080
- clonedVNode = {
6081
- ...vnode,
6082
- slotAssignment: data.slotAssignment
6083
- };
6136
+ if (isUndefined$1(vnode.elm)) {
6137
+ // vnode.elm is undefined during initial render.
6138
+ // We don't need to clone at this point because it doesn't need to be unmounted.
6139
+ vnode.slotAssignment = data.slotAssignment;
6140
+ } else {
6141
+ // Clone when the vnode.elm is defined to ensure we don't lose reference to the previous element.
6142
+ // This is specifically for slot forwarding.
6143
+ clonedVNode = {
6144
+ ...vnode,
6145
+ slotAssignment: data.slotAssignment
6146
+ };
6147
+ }
6084
6148
  }
6085
6149
  // If the slot content is standard type, the content is static, no additional
6086
6150
  // processing needed on the vnode
@@ -6254,10 +6318,10 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
6254
6318
  }
6255
6319
  // [t]ext node
6256
6320
  function t(text) {
6257
- let sel, key, elm;
6321
+ let key, elm;
6258
6322
  return {
6259
6323
  type: 0 /* VNodeType.Text */,
6260
- sel,
6324
+ sel: '__text__',
6261
6325
  text,
6262
6326
  elm,
6263
6327
  key,
@@ -6266,13 +6330,13 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
6266
6330
  }
6267
6331
  // [co]mment node
6268
6332
  function co(text) {
6269
- let sel, elm;
6333
+ let elm, key;
6270
6334
  return {
6271
6335
  type: 1 /* VNodeType.Comment */,
6272
- sel,
6336
+ sel: '__comment__',
6273
6337
  text,
6274
6338
  elm,
6275
- key: 'c',
6339
+ key,
6276
6340
  owner: getVMBeingRendered()
6277
6341
  };
6278
6342
  }
@@ -6445,6 +6509,43 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
6445
6509
  function shc(content) {
6446
6510
  return sanitizeHtmlContentHook(content);
6447
6511
  }
6512
+ /**
6513
+ * [ncls] - Normalize class name attribute.
6514
+ *
6515
+ * Transforms the provided class property value from an object/string into a string the diffing algo
6516
+ * can operate on.
6517
+ *
6518
+ * This implementation is borrowed from Vue:
6519
+ * https://github.com/vuejs/core/blob/e790e1bdd7df7be39e14780529db86e4da47a3db/packages/shared/src/normalizeProp.ts#L63-L82
6520
+ */
6521
+ function ncls(value) {
6522
+ if (isUndefined$1(value) || isNull(value)) {
6523
+ // Returning undefined here improves initial render cost, because the old vnode's class will be considered
6524
+ // undefined in the `patchClassAttribute` routine, so `oldClass === newClass` will be true so we return early
6525
+ return undefined;
6526
+ }
6527
+ let res = '';
6528
+ if (isString(value)) {
6529
+ res = value;
6530
+ } else if (isArray$1(value)) {
6531
+ for (let i = 0; i < value.length; i++) {
6532
+ const normalized = ncls(value[i]);
6533
+ if (normalized) {
6534
+ res += normalized + ' ';
6535
+ }
6536
+ }
6537
+ } else if (isObject(value) && !isNull(value)) {
6538
+ // Iterate own enumerable keys of the object
6539
+ const keys$1 = keys(value);
6540
+ for (let i = 0; i < keys$1.length; i += 1) {
6541
+ const key = keys$1[i];
6542
+ if (value[key]) {
6543
+ res += key + ' ';
6544
+ }
6545
+ }
6546
+ }
6547
+ return StringTrim.call(res);
6548
+ }
6448
6549
  const api = freeze({
6449
6550
  s,
6450
6551
  h,
@@ -6465,7 +6566,8 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
6465
6566
  shc,
6466
6567
  ssf,
6467
6568
  ddc,
6468
- sp
6569
+ sp,
6570
+ ncls
6469
6571
  });
6470
6572
 
6471
6573
  /*
@@ -7107,7 +7209,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
7107
7209
  // old vnode.children is removed from the DOM.
7108
7210
  function removeVM(vm) {
7109
7211
  if (process.env.NODE_ENV !== 'production') {
7110
- if (!shouldUseNativeCustomElementLifecycle(vm.component.constructor)) {
7212
+ if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
7111
7213
  // With native lifecycle, we cannot be certain that connectedCallback was called before a component
7112
7214
  // was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
7113
7215
  // in native mode, although it will fire in synthetic mode due to appendChild triggering it.
@@ -7300,7 +7402,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
7300
7402
  // ShadowMode.Native implies "not synthetic shadow" which is consistent with how
7301
7403
  // everything defaults to native when the synthetic shadow polyfill is unavailable.
7302
7404
  shadowMode = 0 /* ShadowMode.Native */;
7303
- } else if (def.shadowSupportMode === "native" /* ShadowSupportMode.Native */) {
7405
+ } else if (def.shadowSupportMode === 'native') {
7304
7406
  shadowMode = 0 /* ShadowMode.Native */;
7305
7407
  } else {
7306
7408
  const shadowAncestor = getNearestShadowAncestor(owner);
@@ -7446,7 +7548,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
7446
7548
  }
7447
7549
  // This test only makes sense in the browser, with synthetic lifecycle, and when reporting is enabled or
7448
7550
  // we're in dev mode. This is to detect a particular issue with synthetic lifecycle.
7449
- if (!shouldUseNativeCustomElementLifecycle(vm.component.constructor) && (process.env.NODE_ENV !== 'production' || isReportingEnabled())) {
7551
+ if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE && (process.env.NODE_ENV !== 'production' || isReportingEnabled())) {
7450
7552
  if (!vm.renderer.isConnected(vm.elm)) {
7451
7553
  if (process.env.NODE_ENV !== 'production') {
7452
7554
  logWarnOnce(`Element <${vm.tagName}> ` + `fired a \`connectedCallback\` and rendered, but was not connected to the DOM. ` + `Please ensure all components are actually connected to the DOM, e.g. using ` + `\`document.body.appendChild(element)\`. This will not be supported in future versions of ` + `LWC and could cause component errors. For details, see: https://sfdc.co/synthetic-lifecycle`);
@@ -8030,7 +8132,14 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8030
8132
  // The validationOptOut static property can be an array of attribute names.
8031
8133
  // Any attribute names specified in that array will not be validated, and the
8032
8134
  // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
8033
- function getValidationPredicate(optOutStaticProp) {
8135
+ function getValidationPredicate(elm, renderer, optOutStaticProp) {
8136
+ // `data-lwc-host-mutated` is a special attribute added by the SSR engine itself,
8137
+ // which does the same thing as an explicit `static validationOptOut = ['attr1', 'attr2']`.
8138
+ const hostMutatedValue = renderer.getAttribute(elm, 'data-lwc-host-mutated');
8139
+ if (isString(hostMutatedValue)) {
8140
+ const mutatedAttrValues = new Set(StringSplit.call(hostMutatedValue, / /));
8141
+ return attrName => !mutatedAttrValues.has(attrName);
8142
+ }
8034
8143
  if (isUndefined$1(optOutStaticProp)) {
8035
8144
  return _attrName => true;
8036
8145
  }
@@ -8131,7 +8240,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8131
8240
  const {
8132
8241
  context
8133
8242
  } = vnode.data;
8134
- const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* LwcDomMode.Manual */);
8243
+ const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === 'manual');
8135
8244
  if (isDomManual) {
8136
8245
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
8137
8246
  // remove the innerHTML from props so it reuses the existing dom elements.
@@ -8170,7 +8279,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8170
8279
  const {
8171
8280
  validationOptOut
8172
8281
  } = vnode.ctor;
8173
- const shouldValidateAttr = getValidationPredicate(validationOptOut);
8282
+ const shouldValidateAttr = getValidationPredicate(elm, renderer, validationOptOut);
8174
8283
  // The validationOptOut static property can be an array of attribute names.
8175
8284
  // Any attribute names specified in that array will not be validated, and the
8176
8285
  // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
@@ -8552,6 +8661,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8552
8661
  if (isUndefined$1(parts)) {
8553
8662
  return true;
8554
8663
  }
8664
+ const shouldValidateAttr = (data, attrName) => attrName in data;
8555
8665
  // The validation here relies on 2 key invariants:
8556
8666
  // 1. It's never the case that `parts` is undefined on the server but defined on the client (or vice-versa)
8557
8667
  // 2. It's never the case that `parts` has one length on the server but another on the client
@@ -8567,8 +8677,11 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8567
8677
  data
8568
8678
  } = part;
8569
8679
  const hasMatchingAttrs = validateAttrs(vnode, elm, data, renderer, () => true);
8570
- const hasMatchingStyleAttr = validateStyleAttr(vnode, elm, data, renderer);
8571
- const hasMatchingClass = validateClassAttr(vnode, elm, data, renderer);
8680
+ // Explicitly skip hydration validation when static parts don't contain `style` or `className`.
8681
+ // This means the style/class attributes are either static or don't exist on the element and
8682
+ // cannot be affected by hydration.
8683
+ const hasMatchingStyleAttr = shouldValidateAttr(data, 'style') ? validateStyleAttr(vnode, elm, data, renderer) : true;
8684
+ const hasMatchingClass = shouldValidateAttr(data, 'className') ? validateClassAttr(vnode, elm, data, renderer) : true;
8572
8685
  if (isFalse(hasMatchingAttrs && hasMatchingStyleAttr && hasMatchingClass)) {
8573
8686
  return false;
8574
8687
  }
@@ -8838,7 +8951,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
8838
8951
  }
8839
8952
  return getReadOnlyProxy(obj);
8840
8953
  }
8841
- /** version: 6.6.3 */
8954
+ /** version: 7.1.2 */
8842
8955
 
8843
8956
  /*
8844
8957
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9109,36 +9222,30 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9109
9222
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
9110
9223
  }
9111
9224
  connectedCallback() {
9225
+ // native `connectedCallback`/`disconnectedCallback` are only enabled in native lifecycle mode
9112
9226
  if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9113
9227
  connectRootElement(this);
9114
9228
  }
9115
9229
  }
9116
9230
  disconnectedCallback() {
9231
+ // native `connectedCallback`/`disconnectedCallback` are only enabled in native lifecycle mode
9117
9232
  if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9118
9233
  disconnectRootElement(this);
9119
9234
  }
9120
9235
  }
9121
9236
  formAssociatedCallback(form) {
9122
- if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9123
- runFormAssociatedCallback(this, form);
9124
- }
9237
+ runFormAssociatedCallback(this, form);
9125
9238
  }
9126
9239
  formDisabledCallback(disabled) {
9127
- if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9128
- runFormDisabledCallback(this, disabled);
9129
- }
9240
+ runFormDisabledCallback(this, disabled);
9130
9241
  }
9131
9242
  formResetCallback() {
9132
- if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9133
- runFormResetCallback(this);
9134
- }
9243
+ runFormResetCallback(this);
9135
9244
  }
9136
9245
  formStateRestoreCallback(state, reason) {
9137
- if (isTrue(nativeLifecycleElementsToUpgradedByLWC.get(this))) {
9138
- runFormStateRestoreCallback(this, state, reason);
9139
- }
9246
+ runFormStateRestoreCallback(this, state, reason);
9140
9247
  }
9141
- /*LWC compiler v6.6.3*/
9248
+ /*LWC compiler v7.1.2*/
9142
9249
  };
9143
9250
  BaseHTMLElement = HTMLElement; // cache to track if it changes
9144
9251
  }
@@ -9153,7 +9260,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9153
9260
  // Using a BaseUpgradableConstructor superclass here is a perf optimization to avoid
9154
9261
  // re-defining the same logic (connectedCallback, disconnectedCallback, etc.) over and over.
9155
9262
  class UpgradableConstructor extends BaseUpgradableConstructor {
9156
- /*LWC compiler v6.6.3*/
9263
+ /*LWC compiler v7.1.2*/
9157
9264
  }
9158
9265
  if (isFormAssociated) {
9159
9266
  // Perf optimization - the vast majority of components have formAssociated=false,
@@ -9276,7 +9383,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9276
9383
  function isNull(obj) {
9277
9384
  return obj === null;
9278
9385
  }
9279
- /** version: 6.6.3 */
9386
+ /** version: 7.1.2 */
9280
9387
 
9281
9388
  /*
9282
9389
  * Copyright (c) 2023, salesforce.com, inc.
@@ -9296,7 +9403,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9296
9403
  this.setNewContext = setNewContext;
9297
9404
  this.setDisconnectedCallback = setDisconnectedCallback;
9298
9405
  }
9299
- /*LWC compiler v6.6.3*/
9406
+ /*LWC compiler v7.1.2*/
9300
9407
  }
9301
9408
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
9302
9409
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -9448,6 +9555,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9448
9555
  function getTagName(elm) {
9449
9556
  return elm.tagName;
9450
9557
  }
9558
+ function getStyle(elm) {
9559
+ return elm.style;
9560
+ }
9451
9561
  function attachInternals(elm) {
9452
9562
  return attachInternalsFunc.call(elm);
9453
9563
  }
@@ -9480,6 +9590,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9480
9590
  exports.getLastElementChild = getLastElementChild;
9481
9591
  exports.getParentNode = getParentNode;
9482
9592
  exports.getProperty = getProperty;
9593
+ exports.getStyle = getStyle;
9483
9594
  exports.getTagName = getTagName;
9484
9595
  exports.insert = insert;
9485
9596
  exports.isConnected = isConnected;
@@ -9510,6 +9621,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9510
9621
  * SPDX-License-Identifier: MIT
9511
9622
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
9512
9623
  */
9624
+ // Host element mutation tracking is for SSR only
9625
+ const startTrackingMutations = noop;
9626
+ const stopTrackingMutations = noop;
9513
9627
  /**
9514
9628
  * The base renderer that will be used by engine-core.
9515
9629
  * This will be used for DOM operations when lwc is running in a browser environment.
@@ -9525,7 +9639,9 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9525
9639
  // relies on a shared global cache
9526
9640
  createCustomElement,
9527
9641
  defineCustomElement: getUpgradableConstructor,
9528
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
9642
+ isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
9643
+ startTrackingMutations,
9644
+ stopTrackingMutations
9529
9645
  });
9530
9646
 
9531
9647
  /*
@@ -9710,7 +9826,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9710
9826
  formStateRestoreCallback(state, reason) {
9711
9827
  runFormStateRestoreCallback(this, state, reason);
9712
9828
  }
9713
- /*LWC compiler v6.6.3*/
9829
+ /*LWC compiler v7.1.2*/
9714
9830
  }, _a.observedAttributes = observedAttributes,
9715
9831
  // Note CustomElementConstructor is not upgraded by LWC and inherits directly from HTMLElement which means it calls the native
9716
9832
  // attachInternals API.
@@ -9759,6 +9875,10 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9759
9875
  return callNodeSlot(appendedNode, ConnectingSlot);
9760
9876
  },
9761
9877
  insertBefore(newChild, referenceNode) {
9878
+ if (process.env.NODE_ENV !== 'production' && arguments.length < 2) {
9879
+ // eslint-disable-next-line no-console
9880
+ console.warn('insertBefore should be called with 2 arguments. Calling with only 1 argument is not supported.');
9881
+ }
9762
9882
  const insertedNode = insertBefore.call(this, newChild, referenceNode);
9763
9883
  return callNodeSlot(insertedNode, ConnectingSlot);
9764
9884
  },
@@ -9774,11 +9894,27 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9774
9894
  }
9775
9895
  });
9776
9896
  }
9897
+ if (process.env.NODE_ENV !== 'production') {
9898
+ // In dev mode, we must eagerly patch these DOM APIs because `restrictions.ts` in `@lwc/engine-core` does
9899
+ // its own monkey-patching, and the assumption is that its monkey patches will apply on top of our own.
9900
+ // If we _don't_ eagerly monkey-patch, then APIs like `element.appendChild` could end up calling through
9901
+ // directly to the native DOM APIs instead, which would bypass synthetic custom element lifecycle
9902
+ // and cause rendering/`connectedCallback`/`disconnectedCallback` not to fire.
9903
+ // In prod mode, we avoid global patching as a slight perf optimization and because it's good practice
9904
+ // in general to avoid global patching.
9905
+ // See issue #4242 for details.
9906
+ monkeyPatchDomAPIs();
9907
+ }
9777
9908
  /**
9778
9909
  * EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
9779
9910
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
9780
9911
  * just a string value. The intent is to allow the creation of an element controlled by LWC without
9781
9912
  * having to register the element as a custom element.
9913
+ *
9914
+ * NOTE: The returned type incorrectly includes _all_ properties defined on the component class,
9915
+ * even though the runtime object only uses those decorated with `@api`. This is due to a
9916
+ * limitation of TypeScript. To avoid inferring incorrect properties, provide an explicit generic
9917
+ * parameter, e.g. `createElement<typeof LightningElement>('x-foo', { is: FooCtor })`.
9782
9918
  * @param sel The tagname of the element to create
9783
9919
  * @param options Control the behavior of the created element
9784
9920
  * @param options.is The LWC component that the element should be
@@ -9803,10 +9939,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9803
9939
  // passing `sel` as a camel-case, which makes them invalid custom elements name
9804
9940
  // the following line guarantees that this does not leaks beyond this point.
9805
9941
  const tagName = StringToLowerCase.call(sel);
9806
- const apiVersion = getComponentAPIVersion(Ctor);
9807
- const useNativeCustomElementLifecycle =
9808
- // temporary "kill switch"
9809
- !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE && isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
9942
+ const useNativeCustomElementLifecycle = !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE;
9810
9943
  const isFormAssociated = shouldBeFormAssociated(Ctor);
9811
9944
  // the custom element from the registry is expecting an upgrade callback
9812
9945
  /*
@@ -9822,8 +9955,8 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9822
9955
  owner: null
9823
9956
  });
9824
9957
  if (!useNativeCustomElementLifecycle) {
9825
- // Monkey-patch on-demand, because if there are no components on the page using an old API
9826
- // version, then we don't want to monkey patch at all
9958
+ // Monkey-patch on-demand, because `lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE` may be set to
9959
+ // `true` lazily, after `@lwc/engine-dom` has finished initializing but before a component has rendered.
9827
9960
  monkeyPatchDomAPIs();
9828
9961
  ConnectingSlot.set(elm, connectRootElement);
9829
9962
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -9939,7 +10072,7 @@ LWR.define('lwc/v/6_6_3', ['exports'], (function (exports) { 'use strict';
9939
10072
  });
9940
10073
  });
9941
10074
  }
9942
- /** version: 6.6.3 */
10075
+ /** version: 7.1.2 */
9943
10076
 
9944
10077
  exports.LightningElement = LightningElement;
9945
10078
  exports.__unstable__ProfilerControl = profilerControl;