@lwrjs/everywhere 0.12.0-alpha.23 → 0.12.0-alpha.25

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 (24) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/455e087012048ea585019c70eb00752f/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_12_0-alpha_25/s/8bce578258518655194bd71d1d72aad5/@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_2_1/s/2670f5386c68fa67ae710174187505e9 → 6_3_2/s/23bea0d197119b82d9452baf31b2d156}/lwc.js +143 -144
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/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_12_0-alpha_23 → 0_12_0-alpha_25}/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js +21 -21
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/0_12_0-alpha_25/s/2115e9304d87c9926770b16f31a63742/lwr_loader.js +1396 -0
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/s/274c8343f810353bbad085a79709395f/lwr_metrics.js +1 -1
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/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_12_0-alpha_25/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +99 -0
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/lwr-error-shim.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_12_0-alpha_23 → 0_12_0-alpha_25}/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 +7 -7
  22. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/d3ebffef815f2de48bd6aa16b9a1be8e/config.js +0 -7
  23. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_23/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
  24. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/0_12_0-alpha_23/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +0 -89
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/6_3_2', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (c) 2024 Salesforce, Inc.
@@ -302,13 +302,14 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
302
302
  case 0 /* APIFeature.LOWERCASE_SCOPE_TOKENS */:
303
303
  case 1 /* APIFeature.TREAT_ALL_PARSE5_ERRORS_AS_ERRORS */:
304
304
  return apiVersion >= 59 /* APIVersion.V59_246_WINTER_24 */;
305
- case 2 /* APIFeature.USE_FRAGMENTS_FOR_LIGHT_DOM_SLOTS */:
306
305
  case 3 /* APIFeature.DISABLE_OBJECT_REST_SPREAD_TRANSFORMATION */:
307
306
  case 4 /* APIFeature.SKIP_UNNECESSARY_REGISTER_DECORATORS */:
308
307
  case 5 /* APIFeature.USE_COMMENTS_FOR_FRAGMENT_BOOKENDS */:
308
+ case 2 /* APIFeature.USE_FRAGMENTS_FOR_LIGHT_DOM_SLOTS */:
309
309
  return apiVersion >= 60 /* APIVersion.V60_248_SPRING_24 */;
310
- case 6 /* APIFeature.USE_LIGHT_DOM_SLOT_FORWARDING */:
310
+ case 8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */:
311
311
  case 7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */:
312
+ case 6 /* APIFeature.USE_LIGHT_DOM_SLOT_FORWARDING */:
312
313
  return apiVersion >= 61 /* APIVersion.V61_250_SUMMER_24 */;
313
314
  }
314
315
  }
@@ -439,9 +440,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
439
440
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
440
441
  */
441
442
  // Increment whenever the LWC template compiler changes
442
- const LWC_VERSION = "6.2.1";
443
+ const LWC_VERSION = "6.3.2";
443
444
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
444
- /** version: 6.2.1 */
445
+ /** version: 6.3.2 */
445
446
 
446
447
  /**
447
448
  * Copyright (c) 2024 Salesforce, Inc.
@@ -455,6 +456,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
455
456
  */
456
457
  // When deprecating a feature flag, ensure that it is also no longer set in the application. For
457
458
  // example, in core, the flag should be removed from LwcPermAndPrefUtilImpl.java
459
+ /** List of all feature flags available, with the default value `null`. */
458
460
  const features = {
459
461
  PLACEHOLDER_TEST_FLAG: null,
460
462
  ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
@@ -472,6 +474,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
472
474
  value: create(null)
473
475
  });
474
476
  }
477
+ /** Feature flags that have been set. */
475
478
  const flags = globalThis.lwcRuntimeFlags;
476
479
  /**
477
480
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
@@ -527,7 +530,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
527
530
  setFeatureFlag(name, value);
528
531
  }
529
532
  }
530
- /** version: 6.2.1 */
533
+ /** version: 6.3.2 */
531
534
 
532
535
  /**
533
536
  * Copyright (c) 2024 Salesforce, Inc.
@@ -655,7 +658,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
655
658
  }
656
659
 
657
660
  /*
658
- * Copyright (c) 2018, salesforce.com, inc.
661
+ * Copyright (c) 2024, Salesforce, Inc.
659
662
  * All rights reserved.
660
663
  * SPDX-License-Identifier: MIT
661
664
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -663,7 +666,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
663
666
  const alreadyLoggedMessages = new Set();
664
667
  // Only used in LWC's Karma tests
665
668
  if (process.env.NODE_ENV === 'test-karma-lwc') {
666
- // @ts-ignore
667
669
  window.__lwcResetAlreadyLoggedMessages = () => {
668
670
  alreadyLoggedMessages.clear();
669
671
  };
@@ -1030,6 +1032,16 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1030
1032
  }
1031
1033
  return data;
1032
1034
  }
1035
+ function shouldBeFormAssociated(Ctor) {
1036
+ const ctorFormAssociated = Boolean(Ctor.formAssociated);
1037
+ const apiVersion = getComponentAPIVersion(Ctor);
1038
+ const apiFeatureEnabled = isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
1039
+ if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
1040
+ const tagName = getComponentRegisteredName(Ctor);
1041
+ 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`);
1042
+ }
1043
+ return ctorFormAssociated && apiFeatureEnabled;
1044
+ }
1033
1045
 
1034
1046
  /*
1035
1047
  * Copyright (c) 2020, salesforce.com, inc.
@@ -1295,7 +1307,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1295
1307
  logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
1296
1308
  }
1297
1309
  // Typescript does not like it when you treat the `arguments` object as an array
1298
- // @ts-ignore type-mismatch
1310
+ // @ts-expect-error type-mismatch
1299
1311
  return originalAddEventListener.apply(this, arguments);
1300
1312
  }
1301
1313
  })
@@ -1344,7 +1356,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1344
1356
  logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
1345
1357
  }
1346
1358
  // Typescript does not like it when you treat the `arguments` object as an array
1347
- // @ts-ignore type-mismatch
1359
+ // @ts-expect-error type-mismatch
1348
1360
  return originalAddEventListener.apply(this, arguments);
1349
1361
  }
1350
1362
  })
@@ -1736,7 +1748,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1736
1748
  valueMutated(originalTarget, key);
1737
1749
  return true;
1738
1750
  }
1739
- /*LWC compiler v6.2.1*/
1751
+ /*LWC compiler v6.3.2*/
1740
1752
  }
1741
1753
  const getterMap = new WeakMap();
1742
1754
  const setterMap = new WeakMap();
@@ -1829,7 +1841,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1829
1841
  /* istanbul ignore next */
1830
1842
  return false;
1831
1843
  }
1832
- /*LWC compiler v6.2.1*/
1844
+ /*LWC compiler v6.3.2*/
1833
1845
  }
1834
1846
  function extract(objectOrArray) {
1835
1847
  if (isArray(objectOrArray)) {
@@ -2186,7 +2198,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2186
2198
  * This class is the base class for any LWC element.
2187
2199
  * Some elements directly extends this class, others implement it via inheritance.
2188
2200
  */
2189
- // @ts-ignore
2201
+ // @ts-expect-error When exported, it will conform, but we need to build it first!
2190
2202
  const LightningElement = function () {
2191
2203
  // This should be as performant as possible, while any initialization should be done lazily
2192
2204
  if (isNull(vmBeingConstructed)) {
@@ -2273,69 +2285,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2273
2285
  logError(`this.${methodOrPropName} should not be called during the construction of the custom element for ${getComponentTag(vm)} because the element is not yet in the DOM or has no children yet.`);
2274
2286
  }
2275
2287
  }
2276
- // List of properties on ElementInternals that are formAssociated can be found in the spec:
2277
- // https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements
2278
- const formAssociatedProps = new Set(['setFormValue', 'form', 'setValidity', 'willValidate', 'validity', 'validationMessage', 'checkValidity', 'reportValidity', 'labels']);
2279
- // Verify that access to a form-associated property of the ElementInternals proxy has formAssociated set in the LWC.
2280
- function verifyPropForFormAssociation(propertyKey, isFormAssociated) {
2281
- if (isString(propertyKey) && formAssociatedProps.has(propertyKey) && !isFormAssociated) {
2282
- //Note this error message mirrors Chrome and Firefox error messages, in Safari the error is slightly different.
2283
- throw new DOMException(`Failed to execute '${propertyKey}' on 'ElementInternals': The target element is not a form-associated custom element.`);
2284
- }
2285
- }
2286
- const elementInternalsAccessorAllowList = new Set(['shadowRoot', 'role', ...formAssociatedProps]);
2287
- // Prevent access to properties not defined in the HTML spec in case browsers decide to
2288
- // provide new APIs that provide access to form associated properties.
2289
- // This can be removed along with UpgradeableConstructor.
2290
- function isAllowedElementInternalAccessor(propertyKey) {
2291
- let isAllowedAccessor = false;
2292
- // As of this writing all ElementInternal property keys as described in the spec are implemented with strings
2293
- // in Chrome, Firefox, and Safari
2294
- if (isString(propertyKey)) {
2295
- // Allow list is based on HTML spec:
2296
- // https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface
2297
- isAllowedAccessor = elementInternalsAccessorAllowList.has(propertyKey) || /^aria/.test(propertyKey);
2298
- if (!isAllowedAccessor && process.env.NODE_ENV !== 'production') {
2299
- logWarn('Only properties defined in the ElementInternals HTML spec are available.');
2300
- }
2301
- }
2302
- return isAllowedAccessor;
2303
- }
2304
- // Wrap all ElementInternal objects in a proxy to prevent form association when `formAssociated` is not set on an LWC.
2305
- // This is needed because the 1UpgradeableConstructor1 always sets `formAssociated=true`, which means all
2306
- // ElementInternal objects will have form-associated properties set when an LWC is placed in a form.
2307
- // We are doing this to guard against customers taking a dependency on form elements being associated to ElementInternals
2308
- // when 'formAssociated' has not been set on the LWC.
2309
- function createElementInternalsProxy(elementInternals, isFormAssociated) {
2310
- const elementInternalsProxy = new Proxy(elementInternals, {
2311
- set(target, propertyKey, newValue) {
2312
- if (isAllowedElementInternalAccessor(propertyKey)) {
2313
- // Verify that formAssociated is set for form associated properties
2314
- verifyPropForFormAssociation(propertyKey, isFormAssociated);
2315
- return Reflect.set(target, propertyKey, newValue);
2316
- }
2317
- // As of this writing ElementInternals do not have non-string properties that can be set.
2318
- return false;
2319
- },
2320
- get(target, propertyKey) {
2321
- if (
2322
- // Pass through Object.prototype methods such as toString()
2323
- hasOwnProperty$1.call(Object.prototype, propertyKey) ||
2324
- // As of this writing, ElementInternals only uses Symbol.toStringTag which is called
2325
- // on Object.hasOwnProperty invocations
2326
- Symbol.for('Symbol.toStringTag') === propertyKey ||
2327
- // ElementInternals allow listed properties
2328
- isAllowedElementInternalAccessor(propertyKey)) {
2329
- // Verify that formAssociated is set for form associated properties
2330
- verifyPropForFormAssociation(propertyKey, isFormAssociated);
2331
- const propertyValue = Reflect.get(target, propertyKey);
2332
- return isFunction$1(propertyValue) ? propertyValue.bind(target) : propertyValue;
2333
- }
2334
- }
2335
- });
2336
- return elementInternalsProxy;
2337
- }
2338
- // @ts-ignore
2288
+ // Type assertion because we need to build the prototype before it satisfies the interface.
2339
2289
  LightningElement.prototype = {
2340
2290
  constructor: LightningElement,
2341
2291
  dispatchEvent(event) {
@@ -2488,19 +2438,18 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2488
2438
  const vm = getAssociatedVM(this);
2489
2439
  const {
2490
2440
  elm,
2491
- def: {
2492
- formAssociated
2493
- },
2441
+ apiVersion,
2494
2442
  renderer: {
2495
2443
  attachInternals
2496
2444
  }
2497
2445
  } = vm;
2446
+ if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
2447
+ 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`);
2448
+ }
2498
2449
  if (vm.shadowMode === 1 /* ShadowMode.Synthetic */) {
2499
- throw new Error('attachInternals API is not supported in light DOM or synthetic shadow.');
2450
+ throw new Error('attachInternals API is not supported in synthetic shadow.');
2500
2451
  }
2501
- const internals = attachInternals(elm);
2502
- // #TODO[2970]: remove proxy once `UpgradeableConstructor` has been removed
2503
- return createElementInternalsProxy(internals, Boolean(formAssociated));
2452
+ return attachInternals(elm);
2504
2453
  },
2505
2454
  get isConnected() {
2506
2455
  const vm = getAssociatedVM(this);
@@ -2612,6 +2561,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2612
2561
  if (process.env.NODE_ENV !== 'production') {
2613
2562
  warnIfInvokedDuringConstruction(vm, 'childNodes');
2614
2563
  }
2564
+ // getChildNodes returns a NodeList, which has `item(index: number): Node | null`.
2565
+ // NodeListOf<T> extends NodeList, but claims to not return null. That seems inaccurate,
2566
+ // but these are built-in types, so ultimately not our problem.
2615
2567
  return renderer.getChildNodes(vm.elm);
2616
2568
  },
2617
2569
  get firstChild() {
@@ -2739,11 +2691,10 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2739
2691
  */
2740
2692
  const AdapterToTokenMap = new Map();
2741
2693
  function createContextProviderWithRegister(adapter, registerContextProvider) {
2742
- let adapterContextToken = AdapterToTokenMap.get(adapter);
2743
- if (!isUndefined$1(adapterContextToken)) {
2694
+ if (AdapterToTokenMap.has(adapter)) {
2744
2695
  throw new Error(`Adapter already has a context provider.`);
2745
2696
  }
2746
- adapterContextToken = guid();
2697
+ const adapterContextToken = guid();
2747
2698
  AdapterToTokenMap.set(adapter, adapterContextToken);
2748
2699
  const providers = new WeakSet();
2749
2700
  return (elmOrComponent, options) => {
@@ -2863,7 +2814,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2863
2814
  ro.observe(() => config = configCallback(component));
2864
2815
  // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
2865
2816
  // TODO: dev-mode validation of config based on the adapter.configSchema
2866
- // @ts-ignore it is assigned in the observe() callback
2817
+ // @ts-expect-error it is assigned in the observe() callback
2867
2818
  callbackWhenConfigIsReady(config);
2868
2819
  };
2869
2820
  return {
@@ -2947,7 +2898,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2947
2898
  });
2948
2899
  }
2949
2900
  return {
2950
- // @ts-ignore the boundary protection executes sync, connector is always defined
2901
+ // @ts-expect-error the boundary protection executes sync, connector is always defined
2951
2902
  connector,
2952
2903
  computeConfigAndUpdate,
2953
2904
  resetConfigWatcher: () => ro.reset()
@@ -3448,7 +3399,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3448
3399
  let warned = false;
3449
3400
  // Only used in LWC's Karma tests
3450
3401
  if (process.env.NODE_ENV === 'test-karma-lwc') {
3451
- // @ts-ignore
3452
3402
  window.__lwcResetWarnedOnVersionMismatch = () => {
3453
3403
  warned = false;
3454
3404
  };
@@ -3572,7 +3522,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3572
3522
  if (!isUndefined$1(superAttributeChangedCallback)) {
3573
3523
  // delegate unknown attributes to the super.
3574
3524
  // Typescript does not like it when you treat the `arguments` object as an array
3575
- // @ts-ignore type-mismatch
3525
+ // @ts-expect-error type-mismatch
3576
3526
  superAttributeChangedCallback.apply(this, arguments);
3577
3527
  }
3578
3528
  return;
@@ -3598,7 +3548,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3598
3548
  }
3599
3549
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3600
3550
  const HTMLBridgeElement = class extends SuperClass {
3601
- /*LWC compiler v6.2.1*/
3551
+ /*LWC compiler v6.3.2*/
3602
3552
  };
3603
3553
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3604
3554
  // and false positives in case of inheritance.
@@ -5161,7 +5111,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
5161
5111
  // compatibility, we lower case the tagname here.
5162
5112
  const normalizedTagname = sel.toLowerCase();
5163
5113
  const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(ctor);
5164
- const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle);
5114
+ const isFormAssociated = shouldBeFormAssociated(ctor);
5115
+ const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle, isFormAssociated);
5165
5116
  vnode.elm = elm;
5166
5117
  vnode.vm = vm;
5167
5118
  linkNodeToShadow(elm, owner, renderer);
@@ -6471,9 +6422,27 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
6471
6422
  }
6472
6423
  }
6473
6424
  }
6425
+ // This should be a no-op outside of LWC's Karma tests, where it's not needed
6426
+ let registerFragmentCache = noop;
6427
+ // Only used in LWC's Karma tests
6428
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
6429
+ // Keep track of fragmentCaches, so we can clear them in LWC's Karma tests
6430
+ const fragmentCaches = [];
6431
+ registerFragmentCache = fragmentCache => {
6432
+ fragmentCaches.push(fragmentCache);
6433
+ };
6434
+ window.__lwcResetFragmentCaches = () => {
6435
+ for (const fragmentCache of fragmentCaches) {
6436
+ for (const key of keys(fragmentCache)) {
6437
+ delete fragmentCache[key];
6438
+ }
6439
+ }
6440
+ };
6441
+ }
6474
6442
  function buildParseFragmentFn(createFragmentFn) {
6475
6443
  return (strings, ...keys) => {
6476
6444
  const cache = create(null);
6445
+ registerFragmentCache(cache);
6477
6446
  return function () {
6478
6447
  const {
6479
6448
  context: {
@@ -6494,11 +6463,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
6494
6463
  if (hasStyleToken && isSyntheticShadow) {
6495
6464
  cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
6496
6465
  }
6497
- if (hasLegacyToken) {
6498
- // This isn't strictly required for prod, but it's required for our karma tests
6499
- // since the lwcRuntimeFlag may change over time
6500
- cacheKey |= 4 /* FragmentCache.HAS_LEGACY_SCOPE_TOKEN */;
6501
- }
6502
6466
  if (!isUndefined$1(cache[cacheKey])) {
6503
6467
  return cache[cacheKey];
6504
6468
  }
@@ -7463,18 +7427,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
7463
7427
  function runFormAssociatedCustomElementCallback(vm, faceCb) {
7464
7428
  const {
7465
7429
  renderMode,
7466
- shadowMode,
7467
- def: {
7468
- formAssociated
7469
- }
7430
+ shadowMode
7470
7431
  } = vm;
7471
- // Technically the UpgradableConstructor always sets `static formAssociated = true` but silently fail here to match browser behavior.
7472
- if (isUndefined$1(formAssociated) || isFalse(formAssociated)) {
7473
- if (process.env.NODE_ENV !== 'production') {
7474
- logWarn(`Form associated lifecycle methods must have the 'static formAssociated' value set in the component's prototype chain.`);
7475
- }
7476
- return;
7477
- }
7478
7432
  if (shadowMode === 1 /* ShadowMode.Synthetic */ && renderMode !== 0 /* RenderMode.Light */) {
7479
7433
  throw new Error('Form associated lifecycle methods are not available in synthetic shadow. Please use native shadow or light DOM.');
7480
7434
  }
@@ -7750,7 +7704,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
7750
7704
  throw new Error('detect-non-standard-aria.ts loaded before @lwc/aria-reflection');
7751
7705
  }
7752
7706
  }
7753
- // @ts-ignore
7754
7707
  const {
7755
7708
  get,
7756
7709
  set
@@ -8005,7 +7958,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8005
7958
  defineCustomElement,
8006
7959
  getTagName
8007
7960
  } = renderer;
8008
- defineCustomElement(StringToLowerCase.call(getTagName(elm)));
7961
+ const isFormAssociated = shouldBeFormAssociated(ctor);
7962
+ defineCustomElement(StringToLowerCase.call(getTagName(elm)), isFormAssociated);
8009
7963
  const vm = createVM(elm, ctor, renderer, {
8010
7964
  mode,
8011
7965
  owner,
@@ -8421,7 +8375,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8421
8375
  const originalArrayMethod = getOriginalArrayMethod(prop);
8422
8376
  stylesheets[prop] = function arrayMutationWarningWrapper() {
8423
8377
  reportTemplateViolation('stylesheets');
8424
- // @ts-ignore
8378
+ // @ts-expect-error can't properly determine the right `this`
8425
8379
  return originalArrayMethod.apply(this, arguments);
8426
8380
  };
8427
8381
  }
@@ -8603,7 +8557,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8603
8557
  }
8604
8558
  return getReadOnlyProxy(obj);
8605
8559
  }
8606
- /** version: 6.2.1 */
8560
+ /** version: 6.3.2 */
8607
8561
 
8608
8562
  /*
8609
8563
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8700,7 +8654,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8700
8654
  //
8701
8655
  // Only used in LWC's Karma tests
8702
8656
  if (process.env.NODE_ENV === 'test-karma-lwc') {
8703
- // @ts-ignore
8704
8657
  window.__lwcResetGlobalStylesheets = () => {
8705
8658
  stylesheetCache.clear();
8706
8659
  };
@@ -8833,11 +8786,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8833
8786
  // Another benefit is that only LWC can create components that actually do anything – if you do
8834
8787
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
8835
8788
  // This class should be created once per tag name.
8836
- const createUpgradableConstructor = () => {
8789
+ const createUpgradableConstructor = isFormAssociated => {
8837
8790
  // TODO [#2972]: this class should expose observedAttributes as necessary
8838
8791
  class UpgradableConstructor extends HTMLElement {
8839
- // TODO [#3983]: Re-enable formAssociated once there is a solution for the observable behavior it introduces.
8840
- // static formAssociated = true;
8841
8792
  constructor(upgradeCallback, useNativeLifecycle) {
8842
8793
  super();
8843
8794
  if (useNativeLifecycle) {
@@ -8854,8 +8805,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8854
8805
  // TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
8855
8806
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
8856
8807
  }
8857
- /*LWC compiler v6.2.1*/
8808
+ /*LWC compiler v6.3.2*/
8858
8809
  }
8810
+ UpgradableConstructor.formAssociated = isFormAssociated;
8859
8811
  for (const [propName, callback] of entries(LIFECYCLE_CALLBACKS)) {
8860
8812
  UpgradableConstructor.prototype[propName] = function () {
8861
8813
  // If the element is in the WeakMap (i.e. it's marked as native lifecycle), and if it was upgraded by LWC,
@@ -8867,22 +8819,25 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8867
8819
  }
8868
8820
  return UpgradableConstructor;
8869
8821
  };
8870
- function getUpgradableConstructor(tagName) {
8822
+ function getUpgradableConstructor(tagName, isFormAssociated) {
8871
8823
  let UpgradableConstructor = cachedConstructors.get(tagName);
8872
8824
  if (isUndefined$1(UpgradableConstructor)) {
8873
8825
  if (!isUndefined$1(customElements.get(tagName))) {
8874
8826
  throw new Error(`Unexpected tag name "${tagName}". This name is a registered custom element, preventing LWC to upgrade the element.`);
8875
8827
  }
8876
- UpgradableConstructor = createUpgradableConstructor();
8828
+ UpgradableConstructor = createUpgradableConstructor(isFormAssociated);
8877
8829
  customElements.define(tagName, UpgradableConstructor);
8878
8830
  cachedConstructors.set(tagName, UpgradableConstructor);
8879
8831
  }
8880
8832
  return UpgradableConstructor;
8881
8833
  }
8882
- const createCustomElement = (tagName, upgradeCallback, useNativeLifecycle) => {
8883
- const UpgradableConstructor = getUpgradableConstructor(tagName);
8834
+ const createCustomElement = (tagName, upgradeCallback, useNativeLifecycle, isFormAssociated) => {
8835
+ const UpgradableConstructor = getUpgradableConstructor(tagName, isFormAssociated);
8884
8836
  elementBeingUpgradedByLWC = true;
8885
8837
  try {
8838
+ if (UpgradableConstructor.formAssociated !== isFormAssociated) {
8839
+ throw new Error(`<${tagName}> was already registered with formAssociated=${UpgradableConstructor.formAssociated}. It cannot be re-registered with formAssociated=${isFormAssociated}. Please rename your component to have a different name than <${tagName}>`);
8840
+ }
8886
8841
  return new UpgradableConstructor(upgradeCallback, useNativeLifecycle);
8887
8842
  } finally {
8888
8843
  elementBeingUpgradedByLWC = false;
@@ -8899,12 +8854,15 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8899
8854
  * A factory function that produces a renderer.
8900
8855
  * Renderer encapsulates operations that are required to render an LWC component into the underlying
8901
8856
  * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
8902
- * Example usage:
8857
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8858
+ * @returns The created renderer
8859
+ * @example
8903
8860
  * import { renderer, rendererFactory } from 'lwc';
8904
8861
  * const customRenderer = rendererFactory(renderer);
8905
- * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8906
8862
  */
8907
8863
  function rendererFactory(baseRenderer) {
8864
+ // Type assertion because this is replaced by rollup with an object, not a string.
8865
+ // See `injectInlineRenderer` in /scripts/rollup/rollup.config.js
8908
8866
  const renderer = function (exports) {
8909
8867
  /**
8910
8868
  * Copyright (c) 2024 Salesforce, Inc.
@@ -8975,7 +8933,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8975
8933
  function isNull(obj) {
8976
8934
  return obj === null;
8977
8935
  }
8978
- /** version: 6.2.1 */
8936
+ /** version: 6.3.2 */
8979
8937
 
8980
8938
  /*
8981
8939
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8995,7 +8953,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8995
8953
  this.setNewContext = setNewContext;
8996
8954
  this.setDisconnectedCallback = setDisconnectedCallback;
8997
8955
  }
8998
- /*LWC compiler v6.2.1*/
8956
+ /*LWC compiler v6.3.2*/
8999
8957
  }
9000
8958
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
9001
8959
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -9254,6 +9212,18 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9254
9212
  }
9255
9213
  return vm;
9256
9214
  }
9215
+ /**
9216
+ * Replaces an existing DOM node with an LWC component.
9217
+ * @param element The existing node in the DOM that where the root component should be attached.
9218
+ * @param Ctor The LWC class to use as the root component.
9219
+ * @param props Any props for the root component as part of initial client-side rendering. The props must be identical to those passed to renderComponent during SSR.
9220
+ * @throws Throws when called with invalid parameters.
9221
+ * @example
9222
+ * import { hydrateComponent } from 'lwc';
9223
+ * import App from 'x/App';
9224
+ * const elm = document.querySelector('x-app');
9225
+ * hydrateComponent(elm, App, { name: 'Hello World' });
9226
+ */
9257
9227
  function hydrateComponent(element, Ctor, props = {}) {
9258
9228
  if (!(element instanceof Element)) {
9259
9229
  throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
@@ -9274,7 +9244,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9274
9244
  defineCustomElement,
9275
9245
  getTagName
9276
9246
  } = renderer;
9277
- defineCustomElement(StringToLowerCase.call(getTagName(element)));
9247
+ const isFormAssociated = shouldBeFormAssociated(Ctor);
9248
+ defineCustomElement(StringToLowerCase.call(getTagName(element)), isFormAssociated);
9278
9249
  const vm = createVMWithProps(element, Ctor, props);
9279
9250
  hydrateRoot(vm);
9280
9251
  } catch (e) {
@@ -9299,15 +9270,14 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9299
9270
  /**
9300
9271
  * This function builds a Web Component class from a LWC constructor so it can be
9301
9272
  * registered as a new element via customElements.define() at any given time.
9302
- * @param Ctor
9273
+ * @param Ctor LWC constructor to build
9274
+ * @returns A Web Component class
9303
9275
  * @example
9304
- * ```
9305
9276
  * import { buildCustomElementConstructor } from 'lwc';
9306
9277
  * import Foo from 'ns/foo';
9307
9278
  * const WC = buildCustomElementConstructor(Foo);
9308
9279
  * customElements.define('x-foo', WC);
9309
9280
  * const elm = document.createElement('x-foo');
9310
- * ```
9311
9281
  * @deprecated since version 1.3.11
9312
9282
  */
9313
9283
  function deprecatedBuildCustomElementConstructor(Ctor) {
@@ -9323,6 +9293,13 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9323
9293
  renderer.remove(childNodes[i], node);
9324
9294
  }
9325
9295
  }
9296
+ /**
9297
+ * The real `buildCustomElementConstructor`. Should not be accessible to external users!
9298
+ * @internal
9299
+ * @param Ctor LWC constructor to build
9300
+ * @returns A Web Component class
9301
+ * @see {@linkcode deprecatedBuildCustomElementConstructor}
9302
+ */
9326
9303
  function buildCustomElementConstructor(Ctor) {
9327
9304
  var _a;
9328
9305
  const HtmlPrototype = getComponentHtmlPrototype(Ctor);
@@ -9374,8 +9351,23 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9374
9351
  attributeChangedCallback(name, oldValue, newValue) {
9375
9352
  attributeChangedCallback.call(this, name, oldValue, newValue);
9376
9353
  }
9377
- /*LWC compiler v6.2.1*/
9378
- }, _a.observedAttributes = observedAttributes, _a;
9354
+ formAssociatedCallback() {
9355
+ runFormAssociatedCallback(this);
9356
+ }
9357
+ formDisabledCallback() {
9358
+ runFormDisabledCallback(this);
9359
+ }
9360
+ formResetCallback() {
9361
+ runFormResetCallback(this);
9362
+ }
9363
+ formStateRestoreCallback() {
9364
+ runFormStateRestoreCallback(this);
9365
+ }
9366
+ /*LWC compiler v6.3.2*/
9367
+ }, _a.observedAttributes = observedAttributes,
9368
+ // Note CustomElementConstructor is not upgraded by LWC and inherits directly from HTMLElement which means it calls the native
9369
+ // attachInternals API.
9370
+ _a.formAssociated = Boolean(Ctor.formAssociated), _a;
9379
9371
  }
9380
9372
 
9381
9373
  /*
@@ -9443,17 +9435,17 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9443
9435
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
9444
9436
  * just a string value. The intent is to allow the creation of an element controlled by LWC without
9445
9437
  * having to register the element as a custom element.
9446
- * @param sel
9447
- * @param options
9448
- * @param options.is description
9449
- * @param options.mode
9438
+ * @param sel The tagname of the element to create
9439
+ * @param options Control the behavior of the created element
9440
+ * @param options.is The LWC component that the element should be
9441
+ * @param options.mode What kind of shadow root to use
9442
+ * @returns The created HTML element
9443
+ * @throws Throws when called with invalid parameters.
9450
9444
  * @example
9451
- * ```
9452
9445
  * const el = createElement('x-foo', { is: FooCtor });
9453
- * ```
9454
9446
  */
9455
- /* eslint-enable jsdoc/valid-types */
9456
- function createElement(sel, options) {
9447
+ function createElement( /* eslint-enable jsdoc/valid-types */
9448
+ sel, options) {
9457
9449
  if (!isObject(options) || isNull(options)) {
9458
9450
  throw new TypeError(`"createElement" function expects an object as second parameter but received "${toString$1(options)}".`);
9459
9451
  }
@@ -9472,13 +9464,13 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9472
9464
  const useNativeCustomElementLifecycle =
9473
9465
  // temporary "kill switch"
9474
9466
  !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE && isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
9467
+ const isFormAssociated = shouldBeFormAssociated(Ctor);
9475
9468
  // the custom element from the registry is expecting an upgrade callback
9476
- /**
9469
+ /*
9477
9470
  * Note: if the upgradable constructor does not expect, or throw when we new it
9478
9471
  * with a callback as the first argument, we could implement a more advanced
9479
9472
  * mechanism that only passes that argument if the constructor is known to be
9480
9473
  * an upgradable custom element.
9481
- * @param elm
9482
9474
  */
9483
9475
  const upgradeCallback = elm => {
9484
9476
  createVM(elm, Ctor, renderer, {
@@ -9494,7 +9486,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9494
9486
  DisconnectingSlot.set(elm, disconnectRootElement);
9495
9487
  }
9496
9488
  };
9497
- return createCustomElement(tagName, upgradeCallback, useNativeCustomElementLifecycle);
9489
+ return createCustomElement(tagName, upgradeCallback, useNativeCustomElementLifecycle, isFormAssociated);
9498
9490
  }
9499
9491
 
9500
9492
  /*
@@ -9509,7 +9501,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9509
9501
  /**
9510
9502
  * EXPERIMENTAL: The purpose of this function is to detect shadowed nodes. THIS API WILL BE REMOVED
9511
9503
  * ONCE LOCKER V1 IS NO LONGER SUPPORTED.
9512
- * @param node
9504
+ * @param node Node to check
9505
+ * @returns `true` if the the node is shadowed
9506
+ * @example isNodeShadowed(document.querySelector('my-component'))
9513
9507
  */
9514
9508
  function isNodeShadowed(node) {
9515
9509
  if (isFalse(node instanceof _Node)) {
@@ -9581,6 +9575,11 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9581
9575
  * SPDX-License-Identifier: MIT
9582
9576
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
9583
9577
  */
9578
+ /**
9579
+ * Creates a context provider, given a wire adapter constructor.
9580
+ * @param adapter The wire adapter to create a context provider for.
9581
+ * @returns A new context provider.
9582
+ */
9584
9583
  function createContextProvider(adapter) {
9585
9584
  return createContextProviderWithRegister(adapter, registerContextProvider);
9586
9585
  }
@@ -9597,7 +9596,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9597
9596
  });
9598
9597
  });
9599
9598
  }
9600
- /** version: 6.2.1 */
9599
+ /** version: 6.3.2 */
9601
9600
 
9602
9601
  exports.LightningElement = LightningElement;
9603
9602
  exports.__unstable__ProfilerControl = profilerControl;