@lwrjs/everywhere 0.22.12 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/66cee26a86a5cee16ca4b90b9ade6846/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_22_12 → 0_23_0}/s/d4022ae1b3a47f5bb62c600fd6b8f139/@lwrjs_app-service_amd-bootstrap_module_amd.js +5 -5
  3. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{8_22_6/s/21cb42e66f1f2b4362fe6203653b692f → 9_1_2/s/0ab8cd8f94e09eb7da6a47fe0f3b6391}/lwc.js +173 -149
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_22_12 → 0_23_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_22_12 → 0_23_0}/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js +22 -22
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_22_12/s/e5539130565e08d311bee05ff47797a5 → 0_23_0/s/b54ec6129b3ac74009e31768a140c50b}/lwr_loader.js +161 -10
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_22_12 → 0_23_0}/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_22_12 → 0_23_0}/s/9120455810adf1ca6b429479490a4b0d/lwr_preInit.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_22_12 → 0_23_0}/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/scheduler/v/{0_22_12 → 0_23_0}/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_22_12 → 0_23_0}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_22_12 → 0_23_0}/lwr-error-shim.js +1 -1
  13. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_22_12 → 0_23_0}/lwr-loader-shim.bundle.js +191 -19
  14. package/build/assets/amd/lwr-everywhere-debug.js +185 -15
  15. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  16. package/build/assets/amd/lwr-everywhere.js +185 -15
  17. package/build/assets/core/lwr-everywhere-debug.js +181 -11
  18. package/build/assets/core/lwr-everywhere-min.js +2 -2
  19. package/build/assets/core/lwr-everywhere.js +181 -11
  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/package.json +6 -6
  24. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/ef04a79964a62c2d675f744778da4f9b/config.js +0 -12
@@ -1,10 +1,10 @@
1
- LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/9_1_2', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
- * Copyright (c) 2025 Salesforce, Inc.
4
+ * Copyright (c) 2026 Salesforce, Inc.
5
5
  */
6
6
  /**
7
- * Copyright (c) 2025 Salesforce, Inc.
7
+ * Copyright (c) 2026 Salesforce, Inc.
8
8
  */
9
9
  /*
10
10
  * Copyright (c) 2018, salesforce.com, inc.
@@ -564,7 +564,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
564
564
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
565
565
  */
566
566
  // Increment whenever the LWC template compiler changes
567
- const LWC_VERSION = "8.22.6";
567
+ const LWC_VERSION = "9.1.2";
568
568
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
569
569
 
570
570
  /*
@@ -678,7 +678,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
678
678
  function setTrustedSignalSet(signals) {
679
679
  isFalse$1(trustedSignals, 'Trusted Signal Set is already set!');
680
680
  trustedSignals = signals;
681
- // Only used in LWC's Karma. Contained within the set function as there are multiple imports of
681
+ // Only used in LWC's integration tests. Contained within the set function as there are multiple imports of
682
682
  // this module. Placing it here ensures we reference the import where the trustedSignals set is maintained
683
683
  if (process.env.NODE_ENV === 'test-lwc-integration') {
684
684
  // Used to reset the global state between test runs
@@ -708,10 +708,10 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
708
708
  }
709
709
  return trustedSignals.has(target);
710
710
  }
711
- /** version: 8.22.6 */
711
+ /** version: 9.1.2 */
712
712
 
713
713
  /**
714
- * Copyright (c) 2025 Salesforce, Inc.
714
+ * Copyright (c) 2026 Salesforce, Inc.
715
715
  */
716
716
 
717
717
  /*
@@ -735,8 +735,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
735
735
  ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION: null,
736
736
  DISABLE_SYNTHETIC_SHADOW: null,
737
737
  DISABLE_SCOPE_TOKEN_VALIDATION: null,
738
- LEGACY_LOCKER_ENABLED: null,
739
- DISABLE_LEGACY_VALIDATION: null,
738
+ DISABLE_STRICT_VALIDATION: null,
740
739
  DISABLE_DETACHED_REHYDRATION: null,
741
740
  ENABLE_LEGACY_CONTEXT_CONNECTION: null,
742
741
  };
@@ -770,7 +769,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
770
769
  console.info(`Attempt to set a value on an unknown feature flag "${name}" resulted in a NOOP.`);
771
770
  return;
772
771
  }
773
- // This may seem redundant, but `process.env.NODE_ENV === 'test-lwc-integration'` is replaced by Karma tests
772
+ // This may seem redundant, but `process.env.NODE_ENV === 'test-lwc-integration'` is replaced by integration tests
774
773
  if (process.env.NODE_ENV === 'test-lwc-integration' || process.env.NODE_ENV !== 'production') {
775
774
  // Allow the same flag to be set more than once outside of production to enable testing
776
775
  flags[name] = value;
@@ -799,13 +798,13 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
799
798
  setFeatureFlag(name, value);
800
799
  }
801
800
  }
802
- /** version: 8.22.6 */
801
+ /** version: 9.1.2 */
803
802
 
804
803
  /**
805
- * Copyright (c) 2025 Salesforce, Inc.
804
+ * Copyright (c) 2026 Salesforce, Inc.
806
805
  */
807
806
  /**
808
- * Copyright (c) 2025 Salesforce, Inc.
807
+ * Copyright (c) 2026 Salesforce, Inc.
809
808
  */
810
809
  /*
811
810
  * Copyright (c) 2018, salesforce.com, inc.
@@ -823,7 +822,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
823
822
  * @param value
824
823
  * @param msg
825
824
  */
826
- /** version: 8.22.6 */
825
+ /** version: 9.1.2 */
827
826
 
828
827
  /*
829
828
  * Copyright (c) 2023, salesforce.com, inc.
@@ -847,10 +846,10 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
847
846
  }
848
847
  }
849
848
  }
850
- /** version: 8.22.6 */
849
+ /** version: 9.1.2 */
851
850
 
852
851
  /**
853
- * Copyright (c) 2025 Salesforce, Inc.
852
+ * Copyright (c) 2026 Salesforce, Inc.
854
853
  */
855
854
 
856
855
  /*
@@ -983,7 +982,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
983
982
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
984
983
  */
985
984
  const alreadyLoggedMessages = new Set();
986
- // Only used in LWC's Karma tests
985
+ // Only used in LWC's integration tests
987
986
  if (process.env.NODE_ENV === 'test-lwc-integration') {
988
987
  window.__lwcResetAlreadyLoggedMessages = () => {
989
988
  alreadyLoggedMessages.clear();
@@ -1384,6 +1383,18 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
1384
1383
  signalTracker.reset();
1385
1384
  }
1386
1385
  }
1386
+ /**
1387
+ * A normalized string representation of an error, because browsers behave differently
1388
+ */
1389
+ const errorWithStack = (err) => {
1390
+ if (typeof err !== 'object' || err === null) {
1391
+ return String(err);
1392
+ }
1393
+ const stack = 'stack' in err ? String(err.stack) : '';
1394
+ const message = 'message' in err ? String(err.message) : '';
1395
+ const constructor = err.constructor.name;
1396
+ return stack.includes(message) ? stack : `${constructor}: ${message}\n${stack}`;
1397
+ };
1387
1398
  /**
1388
1399
  * This class is used to keep track of the signals associated to a given object.
1389
1400
  * It is used to prevent the LWC engine from subscribing duplicate callbacks multiple times
@@ -1407,7 +1418,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
1407
1418
  }
1408
1419
  }
1409
1420
  catch (err) {
1410
- logWarnOnce(`Attempted to subscribe to an object that has the shape of a signal but received the following error: ${err?.stack ?? err}`);
1421
+ logWarnOnce(`Attempted to subscribe to an object that has the shape of a signal but received the following error: ${errorWithStack(err)}`);
1411
1422
  }
1412
1423
  }
1413
1424
  unsubscribeFromSignals() {
@@ -1415,7 +1426,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
1415
1426
  this.signalToUnsubscribeMap.forEach((unsubscribe) => unsubscribe());
1416
1427
  }
1417
1428
  catch (err) {
1418
- logWarnOnce(`Attempted to call a signal's unsubscribe callback but received the following error: ${err?.stack ?? err}`);
1429
+ logWarnOnce(`Attempted to call a signal's unsubscribe callback but received the following error: ${errorWithStack(err)}`);
1419
1430
  }
1420
1431
  }
1421
1432
  reset() {
@@ -2558,16 +2569,35 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
2558
2569
  },
2559
2570
  attachInternals() {
2560
2571
  const vm = getAssociatedVM(this);
2561
- const { elm, apiVersion, renderer: { attachInternals }, } = vm;
2572
+ const { def: { ctor }, elm, apiVersion, renderer: { attachInternals }, } = vm;
2562
2573
  if (!isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
2563
2574
  throw new Error(`The attachInternals API is only supported in API version 61 and above. ` +
2564
2575
  `The current version is ${apiVersion}. ` +
2565
2576
  `To use this API, update the LWC component API version. https://lwc.dev/guide/versioning`);
2566
2577
  }
2567
- if (vm.shadowMode === 1 /* ShadowMode.Synthetic */) {
2578
+ const internals = attachInternals(elm);
2579
+ if (vm.shadowMode === 1 /* ShadowMode.Synthetic */ && supportsSyntheticElementInternals(ctor)) {
2580
+ const handler = {
2581
+ get(target, prop) {
2582
+ if (prop === 'shadowRoot') {
2583
+ return vm.shadowRoot;
2584
+ }
2585
+ const value = Reflect.get(target, prop);
2586
+ if (typeof value === 'function') {
2587
+ return value.bind(target);
2588
+ }
2589
+ return value;
2590
+ },
2591
+ set(target, prop, value) {
2592
+ return Reflect.set(target, prop, value);
2593
+ },
2594
+ };
2595
+ return new Proxy(internals, handler);
2596
+ }
2597
+ else if (vm.shadowMode === 1 /* ShadowMode.Synthetic */) {
2568
2598
  throw new Error('attachInternals API is not supported in synthetic shadow.');
2569
2599
  }
2570
- return attachInternals(elm);
2600
+ return internals;
2571
2601
  },
2572
2602
  get isConnected() {
2573
2603
  const vm = getAssociatedVM(this);
@@ -3125,10 +3155,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3125
3155
  value,
3126
3156
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3127
3157
  context) {
3128
- if (process.env.NODE_ENV !== 'production') {
3129
- assert.fail(`@api decorator can only be used as a decorator function.`);
3130
- }
3131
- throw new Error();
3158
+ assert.fail(`@api decorator can only be used as a decorator function.`);
3132
3159
  }
3133
3160
  function createPublicPropertyDescriptor(key) {
3134
3161
  return {
@@ -3208,10 +3235,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3208
3235
  if (arguments.length === 1) {
3209
3236
  return getReactiveProxy(target);
3210
3237
  }
3211
- if (process.env.NODE_ENV !== 'production') {
3212
- assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
3213
- }
3214
- throw new Error();
3238
+ assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
3215
3239
  }
3216
3240
  function internalTrackDecorator(key) {
3217
3241
  return {
@@ -3251,6 +3275,10 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3251
3275
  */
3252
3276
  /**
3253
3277
  * Decorator factory to wire a property or method to a wire adapter data source.
3278
+ *
3279
+ * TypeScript users: Due to limitations of the type system, some edge cases are
3280
+ * not fully type checked. See the type definition for {@linkcode ConfigWithReactiveProps}
3281
+ * for details.
3254
3282
  * @param adapter the adapter used to provision data
3255
3283
  * @param config configuration object for the adapter
3256
3284
  * @returns A decorator function
@@ -3265,10 +3293,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3265
3293
  adapter,
3266
3294
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3267
3295
  config) {
3268
- if (process.env.NODE_ENV !== 'production') {
3269
- assert.fail('@wire(adapter, config?) may only be used as a decorator.');
3270
- }
3271
- throw new Error();
3296
+ assert.fail('@wire(adapter, config?) may only be used as a decorator.');
3272
3297
  }
3273
3298
  function internalWireFieldDecorator(key) {
3274
3299
  return {
@@ -3314,7 +3339,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3314
3339
  if (!isUndefined$1(descriptor)) {
3315
3340
  const type = getClassDescriptorType(descriptor);
3316
3341
  const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
3317
- // TODO [#3408]: this should throw, not log
3342
+ // TODO [#4450]: this should throw, not log
3318
3343
  logError(message);
3319
3344
  }
3320
3345
  }
@@ -3322,7 +3347,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3322
3347
  assertNotProd(); // this method should never leak to prod
3323
3348
  if (!isUndefined$1(descriptor)) {
3324
3349
  const type = getClassDescriptorType(descriptor);
3325
- // TODO [#3408]: this should throw, not log
3350
+ // TODO [#4450]: this should throw, not log
3326
3351
  logError(`Invalid @track ${fieldName} field. Found a duplicate ${type} with the same name.`);
3327
3352
  }
3328
3353
  }
@@ -3330,14 +3355,14 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3330
3355
  assertNotProd(); // this method should never leak to prod
3331
3356
  if (!isUndefined$1(descriptor)) {
3332
3357
  const type = getClassDescriptorType(descriptor);
3333
- // TODO [#3408]: this should throw, not log
3358
+ // TODO [#4450]: this should throw, not log
3334
3359
  logError(`Invalid @wire ${fieldName} field. Found a duplicate ${type} with the same name.`);
3335
3360
  }
3336
3361
  }
3337
3362
  function validateMethodDecoratedWithWire(Ctor, methodName, descriptor) {
3338
3363
  assertNotProd(); // this method should never leak to prod
3339
3364
  if (isUndefined$1(descriptor) || !isFunction$1(descriptor.value) || isFalse(descriptor.writable)) {
3340
- // TODO [#3441]: This line of code does not seem possible to reach.
3365
+ // TODO [#4450]: This line of code does not seem possible to reach.
3341
3366
  logError(`Invalid @wire ${methodName} field. The field should have a valid writable descriptor.`);
3342
3367
  }
3343
3368
  }
@@ -3346,7 +3371,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3346
3371
  if (!isUndefined$1(descriptor)) {
3347
3372
  const type = getClassDescriptorType(descriptor);
3348
3373
  const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
3349
- // TODO [#3408]: this should throw, not log
3374
+ // TODO [#4450]: this should throw, not log
3350
3375
  logError(message);
3351
3376
  }
3352
3377
  }
@@ -3354,7 +3379,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3354
3379
  assertNotProd(); // this method should never leak to prod
3355
3380
  if (isFunction$1(descriptor.set)) {
3356
3381
  if (!isFunction$1(descriptor.get)) {
3357
- // TODO [#3441]: This line of code does not seem possible to reach.
3382
+ // TODO [#4450]: This line of code does not seem possible to reach.
3358
3383
  logError(`Missing getter for property ${fieldName} decorated with @api in ${Ctor}. You cannot have a setter without the corresponding getter.`);
3359
3384
  }
3360
3385
  }
@@ -3440,7 +3465,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3440
3465
  if (method === 1) {
3441
3466
  if (process.env.NODE_ENV !== 'production') {
3442
3467
  if (!adapter) {
3443
- // TODO [#3408]: this should throw, not log
3468
+ // TODO [#4450]: this should throw, not log
3444
3469
  logError(`@wire on method "${fieldOrMethodName}": adapter id must be truthy.`);
3445
3470
  }
3446
3471
  validateMethodDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
@@ -3454,7 +3479,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3454
3479
  else {
3455
3480
  if (process.env.NODE_ENV !== 'production') {
3456
3481
  if (!adapter) {
3457
- // TODO [#3408]: this should throw, not log
3482
+ // TODO [#4450]: this should throw, not log
3458
3483
  logError(`@wire on field "${fieldOrMethodName}": adapter id must be truthy.`);
3459
3484
  }
3460
3485
  validateFieldDecoratedWithWire(Ctor, fieldOrMethodName, descriptor);
@@ -3526,7 +3551,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3526
3551
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3527
3552
  */
3528
3553
  let warned = false;
3529
- // Only used in LWC's Karma tests
3554
+ // Only used in LWC's integration tests
3530
3555
  if (process.env.NODE_ENV === 'test-lwc-integration') {
3531
3556
  window.__lwcResetWarnedOnVersionMismatch = () => {
3532
3557
  warned = false;
@@ -3807,7 +3832,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3807
3832
  // The "pure" annotations are so that Rollup knows for sure it can remove these from prod mode
3808
3833
  let stylesheetsToCssContent = /*@__PURE__@*/ new WeakMap();
3809
3834
  let cssContentToAbortControllers = /*@__PURE__@*/ new Map();
3810
- // Only used in LWC's Karma tests
3835
+ // Only used in LWC's integration tests
3811
3836
  if (process.env.NODE_ENV === 'test-lwc-integration') {
3812
3837
  // Used to reset the global state between test runs
3813
3838
  window.__lwcResetStylesheetCache = () => {
@@ -3991,6 +4016,9 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
3991
4016
  function getStylesheetsContent(vm, template) {
3992
4017
  const { stylesheets, stylesheetToken } = template;
3993
4018
  const { stylesheets: vmStylesheets } = vm;
4019
+ if (!isUndefined$1(stylesheetToken) && !isValidScopeToken(stylesheetToken)) {
4020
+ throw new Error('stylesheet token must be a valid string');
4021
+ }
3994
4022
  const hasTemplateStyles = hasStyles(stylesheets);
3995
4023
  const hasVmStyles = hasStyles(vmStylesheets);
3996
4024
  if (hasTemplateStyles) {
@@ -4104,34 +4132,16 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
4104
4132
  * SPDX-License-Identifier: MIT
4105
4133
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4106
4134
  */
4107
- const supportsWeakRefs = typeof WeakRef === 'function' && typeof FinalizationRegistry === 'function';
4108
- // In browsers that doesn't support WeakRefs, the values will still leak, but at least the keys won't
4109
- class LegacyWeakMultiMap {
4110
- constructor() {
4111
- this._map = new WeakMap();
4112
- }
4113
- _getValues(key) {
4114
- let values = this._map.get(key);
4115
- if (isUndefined$1(values)) {
4116
- values = new Set();
4117
- this._map.set(key, values);
4118
- }
4119
- return values;
4120
- }
4121
- get(key) {
4122
- return this._getValues(key);
4123
- }
4124
- add(key, vm) {
4125
- const set = this._getValues(key);
4126
- set.add(vm);
4127
- }
4128
- delete(key) {
4129
- this._map.delete(key);
4130
- }
4131
- }
4132
- // This implementation relies on the WeakRef/FinalizationRegistry proposal.
4133
- // For some background, see: https://github.com/tc39/proposal-weakrefs
4134
- class ModernWeakMultiMap {
4135
+ /**
4136
+ * A map where the keys are weakly held and the values are a Set that are also each weakly held.
4137
+ * The goal is to avoid leaking the values, which is what would happen with a WeakMap<K, Set<V>>.
4138
+ *
4139
+ * Note that this is currently only intended to be used in dev/PRODDEBUG environments.
4140
+ *
4141
+ * This implementation relies on WeakRefs and FinalizationRegistry.
4142
+ * For some background, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef
4143
+ */
4144
+ class WeakMultiMap {
4135
4145
  constructor() {
4136
4146
  this._map = new WeakMap();
4137
4147
  this._registry = new FinalizationRegistry((weakRefs) => {
@@ -4167,8 +4177,12 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
4167
4177
  }
4168
4178
  add(key, value) {
4169
4179
  const weakRefs = this._getWeakRefs(key);
4170
- // We could check for duplicate values here, but it doesn't seem worth it.
4171
- // We transform the output into a Set anyway
4180
+ // Skip adding if already present
4181
+ for (const weakRef of weakRefs) {
4182
+ if (weakRef.deref() === value) {
4183
+ return;
4184
+ }
4185
+ }
4172
4186
  ArrayPush$1.call(weakRefs, new WeakRef(value));
4173
4187
  // It's important here not to leak the second argument, which is the "held value." The FinalizationRegistry
4174
4188
  // effectively creates a strong reference between the first argument (the "target") and the held value. When
@@ -4183,7 +4197,6 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
4183
4197
  this._map.delete(key);
4184
4198
  }
4185
4199
  }
4186
- const WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
4187
4200
 
4188
4201
  /*
4189
4202
  * Copyright (c) 2020, salesforce.com, inc.
@@ -4204,7 +4217,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
4204
4217
  let activeComponents =
4205
4218
  /*@__PURE__@*/ new WeakMultiMap();
4206
4219
  let activeStyles = /*@__PURE__@*/ new WeakMultiMap();
4207
- // Only used in LWC's Karma tests
4220
+ // Only used in LWC's integration tests
4208
4221
  if (process.env.NODE_ENV === 'test-lwc-integration') {
4209
4222
  // Used to reset the global state between test runs
4210
4223
  window.__lwcResetHotSwaps = () => {
@@ -4419,6 +4432,13 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
4419
4432
  return proto;
4420
4433
  }
4421
4434
  function createComponentDef(Ctor) {
4435
+ // Enforce component-level feature flag if provided at compile time
4436
+ if (!isComponentFeatureEnabled(Ctor)) {
4437
+ const metadata = getComponentMetadata(Ctor);
4438
+ const componentName = Ctor.name || metadata?.sel || 'Unknown';
4439
+ const componentFeatureFlagPath = metadata?.componentFeatureFlag?.path || 'Unknown';
4440
+ throw new Error(`Component ${componentName} is disabled by the feature flag at ${componentFeatureFlagPath}.`);
4441
+ }
4422
4442
  const { shadowSupportMode: ctorShadowSupportMode, renderMode: ctorRenderMode, formAssociated: ctorFormAssociated, } = Ctor;
4423
4443
  if (process.env.NODE_ENV !== 'production') {
4424
4444
  const ctorName = Ctor.name;
@@ -5877,7 +5897,6 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
5877
5897
  }
5878
5898
  function createKeyToOldIdx(children, beginIdx, endIdx) {
5879
5899
  const map = {};
5880
- // TODO [#1637]: simplify this by assuming that all vnodes has keys
5881
5900
  for (let j = beginIdx; j <= endIdx; ++j) {
5882
5901
  const ch = children[j];
5883
5902
  if (isVNode(ch)) {
@@ -6299,20 +6318,19 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
6299
6318
  }
6300
6319
  }
6301
6320
  const { key, slotAssignment } = data;
6302
- let elm, aChildren, vm;
6303
6321
  const vnode = {
6304
6322
  type: 3 /* VNodeType.CustomElement */,
6305
6323
  sel,
6306
6324
  data,
6307
6325
  children,
6308
- elm,
6326
+ elm: undefined,
6309
6327
  key,
6310
6328
  slotAssignment,
6311
6329
  ctor: Ctor,
6312
6330
  owner: vmBeingRendered,
6313
6331
  mode: 'open', // TODO [#1294]: this should be defined in Ctor
6314
- aChildren,
6315
- vm,
6332
+ aChildren: undefined,
6333
+ vm: undefined,
6316
6334
  };
6317
6335
  addVNodeToChildLWC(vnode);
6318
6336
  return vnode;
@@ -6414,25 +6432,23 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
6414
6432
  }
6415
6433
  // [t]ext node
6416
6434
  function t(text) {
6417
- let key, elm;
6418
6435
  return {
6419
6436
  type: 0 /* VNodeType.Text */,
6420
6437
  sel: '__text__',
6421
6438
  text,
6422
- elm,
6423
- key,
6439
+ elm: undefined,
6440
+ key: undefined,
6424
6441
  owner: getVMBeingRendered(),
6425
6442
  };
6426
6443
  }
6427
6444
  // [co]mment node
6428
6445
  function co(text) {
6429
- let elm, key;
6430
6446
  return {
6431
6447
  type: 1 /* VNodeType.Comment */,
6432
6448
  sel: '__comment__',
6433
6449
  text,
6434
- elm,
6435
- key,
6450
+ elm: undefined,
6451
+ key: undefined,
6436
6452
  owner: getVMBeingRendered(),
6437
6453
  };
6438
6454
  }
@@ -6866,7 +6882,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
6866
6882
  // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates
6867
6883
  // Also note that this array only needs to be large enough to account for the maximum possible cache key
6868
6884
  const fragmentCache = ArrayFrom({ length: MAX_CACHE_KEY + 1 }, () => new WeakMap());
6869
- // Only used in LWC's Karma tests
6885
+ // Only used in LWC's integration tests
6870
6886
  if (process.env.NODE_ENV === 'test-lwc-integration') {
6871
6887
  window.__lwcResetFragmentCache = () => {
6872
6888
  for (let i = 0; i < fragmentCache.length; i++) {
@@ -7170,16 +7186,11 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
7170
7186
  try {
7171
7187
  // job
7172
7188
  const result = new Ctor();
7173
- // Check indirectly if the constructor result is an instance of LightningElement.
7174
- // When Locker is enabled, the "instanceof" operator would not work since Locker Service
7175
- // provides its own implementation of LightningElement, so we indirectly check
7176
- // if the base constructor is invoked by accessing the component on the vm.
7177
- // When the DISABLE_LOCKER_VALIDATION gate is false or LEGACY_LOCKER_ENABLED is false,
7178
- // then the instanceof LightningElement can be used.
7179
- const useLegacyConstructorCheck = !lwcRuntimeFlags.DISABLE_LEGACY_VALIDATION || lwcRuntimeFlags.LEGACY_LOCKER_ENABLED;
7180
- const isInvalidConstructor = useLegacyConstructorCheck
7181
- ? vmBeingConstructed.component !== result
7182
- : !(result instanceof LightningElement);
7189
+ // When strict, reject when the constructor returns a *native* HTMLElement that is,
7190
+ // result instanceof HTMLElement.
7191
+ const useStrictValidation = !lwcRuntimeFlags.DISABLE_STRICT_VALIDATION && true;
7192
+ const isMismatchedConstructor = vmBeingConstructed.component !== result;
7193
+ const isInvalidConstructor = isMismatchedConstructor || (useStrictValidation && result instanceof HTMLElement);
7183
7194
  if (isInvalidConstructor) {
7184
7195
  throw new TypeError('Invalid component constructor, the class should extend LightningElement.');
7185
7196
  }
@@ -7271,13 +7282,24 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
7271
7282
  const metadata = registeredComponentMap.get(Ctor);
7272
7283
  const apiVersion = metadata?.apiVersion;
7273
7284
  if (isUndefined$1(apiVersion)) {
7274
- // This should only occur in our Karma tests; in practice every component
7285
+ // This should only occur in our integration tests; in practice every component
7275
7286
  // is registered, and so this code path should not get hit. But to be safe,
7276
7287
  // return the lowest possible version.
7277
7288
  return LOWEST_API_VERSION;
7278
7289
  }
7279
7290
  return apiVersion;
7280
7291
  }
7292
+ function supportsSyntheticElementInternals(Ctor) {
7293
+ return registeredComponentMap.get(Ctor)?.enableSyntheticElementInternals || false;
7294
+ }
7295
+ function isComponentFeatureEnabled(Ctor) {
7296
+ const flag = registeredComponentMap.get(Ctor)?.componentFeatureFlag;
7297
+ // Default to true if not provided
7298
+ return flag?.value !== false;
7299
+ }
7300
+ function getComponentMetadata(Ctor) {
7301
+ return registeredComponentMap.get(Ctor);
7302
+ }
7281
7303
  function getTemplateReactiveObserver(vm) {
7282
7304
  const reactiveObserver = createReactiveObserver(() => {
7283
7305
  const { isDirty } = vm;
@@ -8080,8 +8102,10 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
8080
8102
  }
8081
8103
  }
8082
8104
  function runFormAssociatedCustomElementCallback(vm, faceCb, args) {
8083
- const { renderMode, shadowMode } = vm;
8084
- if (shadowMode === 1 /* ShadowMode.Synthetic */ && renderMode !== 0 /* RenderMode.Light */) {
8105
+ const { renderMode, shadowMode, def: { ctor }, } = vm;
8106
+ if (shadowMode === 1 /* ShadowMode.Synthetic */ &&
8107
+ renderMode !== 0 /* RenderMode.Light */ &&
8108
+ !supportsSyntheticElementInternals(ctor)) {
8085
8109
  throw new Error('Form associated lifecycle methods are not available in synthetic shadow. Please use native shadow or light DOM.');
8086
8110
  }
8087
8111
  invokeComponentCallback(vm, faceCb, args);
@@ -9287,7 +9311,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
9287
9311
  }
9288
9312
  return getReadOnlyProxy(obj);
9289
9313
  }
9290
- /** version: 8.22.6 */
9314
+ /** version: 9.1.2 */
9291
9315
 
9292
9316
  /*
9293
9317
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9385,7 +9409,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
9385
9409
  //
9386
9410
  // Test utilities
9387
9411
  //
9388
- // Only used in LWC's Karma tests
9412
+ // Only used in LWC's integration tests
9389
9413
  if (process.env.NODE_ENV === 'test-lwc-integration') {
9390
9414
  window.__lwcResetGlobalStylesheets = () => {
9391
9415
  stylesheetCache.clear();
@@ -9646,10 +9670,10 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
9646
9670
  function rendererFactory(baseRenderer) {
9647
9671
  // Type assertion because this is replaced by rollup with an object, not a string.
9648
9672
  // See `injectInlineRenderer` in /scripts/rollup/rollup.config.js
9649
- const renderer = (function (exports) {
9673
+ const renderer = (function (exports$1) {
9650
9674
 
9651
9675
  /**
9652
- * Copyright (c) 2025 Salesforce, Inc.
9676
+ * Copyright (c) 2026 Salesforce, Inc.
9653
9677
  */
9654
9678
  /*
9655
9679
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9728,7 +9752,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
9728
9752
  function isNull(obj) {
9729
9753
  return obj === null;
9730
9754
  }
9731
- /** version: 8.22.6 */
9755
+ /** version: 9.1.2 */
9732
9756
 
9733
9757
  /*
9734
9758
  * Copyright (c) 2024, Salesforce, Inc.
@@ -9930,49 +9954,49 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
9930
9954
  throw new Error('attachInternals API is not supported in this browser environment.');
9931
9955
  };
9932
9956
 
9933
- exports.addEventListener = addEventListener;
9934
- exports.assertInstanceOfHTMLElement = assertInstanceOfHTMLElement;
9935
- exports.attachInternals = attachInternals;
9936
- exports.attachShadow = attachShadow;
9937
- exports.cloneNode = cloneNode;
9938
- exports.createComment = createComment;
9939
- exports.createElement = createElement;
9940
- exports.createFragment = createFragment;
9941
- exports.createText = createText;
9942
- exports.dispatchEvent = dispatchEvent;
9943
- exports.getAttribute = getAttribute;
9944
- exports.getBoundingClientRect = getBoundingClientRect;
9945
- exports.getChildNodes = getChildNodes;
9946
- exports.getChildren = getChildren;
9947
- exports.getClassList = getClassList;
9948
- exports.getElementsByClassName = getElementsByClassName;
9949
- exports.getElementsByTagName = getElementsByTagName;
9950
- exports.getFirstChild = getFirstChild;
9951
- exports.getFirstElementChild = getFirstElementChild;
9952
- exports.getLastChild = getLastChild;
9953
- exports.getLastElementChild = getLastElementChild;
9954
- exports.getParentNode = getParentNode;
9955
- exports.getProperty = getProperty;
9956
- exports.getStyle = getStyle;
9957
- exports.getTagName = getTagName;
9958
- exports.insert = insert;
9959
- exports.isConnected = isConnected;
9960
- exports.nextSibling = nextSibling;
9961
- exports.ownerDocument = ownerDocument;
9962
- exports.previousSibling = previousSibling;
9963
- exports.querySelector = querySelector;
9964
- exports.querySelectorAll = querySelectorAll;
9965
- exports.registerContextConsumer = registerContextConsumer;
9966
- exports.registerContextProvider = registerContextProvider;
9967
- exports.remove = remove;
9968
- exports.removeAttribute = removeAttribute;
9969
- exports.removeEventListener = removeEventListener;
9970
- exports.setAttribute = setAttribute;
9971
- exports.setCSSStyleProperty = setCSSStyleProperty;
9972
- exports.setProperty = setProperty;
9973
- exports.setText = setText;
9957
+ exports$1.addEventListener = addEventListener;
9958
+ exports$1.assertInstanceOfHTMLElement = assertInstanceOfHTMLElement;
9959
+ exports$1.attachInternals = attachInternals;
9960
+ exports$1.attachShadow = attachShadow;
9961
+ exports$1.cloneNode = cloneNode;
9962
+ exports$1.createComment = createComment;
9963
+ exports$1.createElement = createElement;
9964
+ exports$1.createFragment = createFragment;
9965
+ exports$1.createText = createText;
9966
+ exports$1.dispatchEvent = dispatchEvent;
9967
+ exports$1.getAttribute = getAttribute;
9968
+ exports$1.getBoundingClientRect = getBoundingClientRect;
9969
+ exports$1.getChildNodes = getChildNodes;
9970
+ exports$1.getChildren = getChildren;
9971
+ exports$1.getClassList = getClassList;
9972
+ exports$1.getElementsByClassName = getElementsByClassName;
9973
+ exports$1.getElementsByTagName = getElementsByTagName;
9974
+ exports$1.getFirstChild = getFirstChild;
9975
+ exports$1.getFirstElementChild = getFirstElementChild;
9976
+ exports$1.getLastChild = getLastChild;
9977
+ exports$1.getLastElementChild = getLastElementChild;
9978
+ exports$1.getParentNode = getParentNode;
9979
+ exports$1.getProperty = getProperty;
9980
+ exports$1.getStyle = getStyle;
9981
+ exports$1.getTagName = getTagName;
9982
+ exports$1.insert = insert;
9983
+ exports$1.isConnected = isConnected;
9984
+ exports$1.nextSibling = nextSibling;
9985
+ exports$1.ownerDocument = ownerDocument;
9986
+ exports$1.previousSibling = previousSibling;
9987
+ exports$1.querySelector = querySelector;
9988
+ exports$1.querySelectorAll = querySelectorAll;
9989
+ exports$1.registerContextConsumer = registerContextConsumer;
9990
+ exports$1.registerContextProvider = registerContextProvider;
9991
+ exports$1.remove = remove;
9992
+ exports$1.removeAttribute = removeAttribute;
9993
+ exports$1.removeEventListener = removeEventListener;
9994
+ exports$1.setAttribute = setAttribute;
9995
+ exports$1.setCSSStyleProperty = setCSSStyleProperty;
9996
+ exports$1.setProperty = setProperty;
9997
+ exports$1.setText = setText;
9974
9998
 
9975
- return exports;
9999
+ return exports$1;
9976
10000
 
9977
10001
  })({});
9978
10002
  // Meant to inherit any properties passed via the base renderer as the argument to the factory.
@@ -10438,7 +10462,7 @@ LWR.define('lwc/v/8_22_6', ['exports'], (function (exports) { 'use strict';
10438
10462
  }
10439
10463
  }));
10440
10464
  }
10441
- /** version: 8.22.6 */
10465
+ /** version: 9.1.2 */
10442
10466
 
10443
10467
  exports.LightningElement = LightningElement;
10444
10468
  exports.SignalBaseClass = SignalBaseClass;