@lwrjs/everywhere 0.12.0-alpha.2 → 0.12.0-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. package/README.md +1 -1
  2. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/1acd458a2d969105f87cecce5be6675c/config.js +11 -0
  3. 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_4/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +14 -0
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{5_1_0/s/aff256c8afef6eb76ff8626ad5f54e3b → 5_3_0/s/d6928cae62ba4c18e61fa9c234830c2a}/lwc.js +170 -71
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -3
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js +21 -21
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_12_0-alpha_2/s/e11ffe74ed86b1153c4eb8b001587909 → 0_12_0-alpha_4/s/5c5d9084a8557502d4eed0d5788db05d}/lwr_loader.js +4 -4
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/274c8343f810353bbad085a79709395f/lwr_metrics.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/lwr-error-shim.js +1 -1
  13. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_12_0-alpha_2 → 0_12_0-alpha_4}/lwr-loader-shim.bundle.js +7 -7
  14. package/build/assets/amd/lwr-everywhere-debug.js +9 -9
  15. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  16. package/build/assets/amd/lwr-everywhere.js +9 -9
  17. package/build/assets/core/lwr-everywhere-debug.js +5 -5
  18. package/build/assets/core/lwr-everywhere-min.js +1 -1
  19. package/build/assets/core/lwr-everywhere.js +5 -5
  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 +9 -9
  24. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/3f1cbc09dcda95f1f74fba817c81fa86/config.js +0 -11
  25. 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_2/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
package/README.md CHANGED
@@ -110,7 +110,7 @@ counter.properties = { count: 9 };
110
110
 
111
111
  ### Client-side Navigation
112
112
 
113
- If the embedded component uses the [LWR Client-side Router](https://github.com/salesforce-experience-platform-emu/lwr-recipes/blob/main/doc/navigation.md), turn on the `navigation` setting. Then you can navigate programmatically and subscribe to navigation events and errors. For example:
113
+ If the embedded component uses the [LWR Client-side Router](../router/README.md), turn on the `navigation` setting. Then you can navigate programmatically and subscribe to navigation events and errors. For example:
114
114
 
115
115
  ```js
116
116
  import { createComponent } from 'https://lwr-server.com/resource/path/lwr-everywhere.js';
@@ -0,0 +1,11 @@
1
+ /* This script is generated */
2
+ /* Client Bootstrap configuration */
3
+ globalThis.LWR = globalThis.LWR || {};
4
+ Object.assign(globalThis.LWR, {"appId":"amd-bootstrap","bootstrapModule":"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_4/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_4/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js":["lwr/preInit/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_4/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js":["lwr/init/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_4/s/274c8343f810353bbad085a79709395f/lwr_metrics.js":["lwr/metrics/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_4/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js":["lwr/profiler/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F5_3_0/s/d6928cae62ba4c18e61fa9c234830c2a/lwc.js":["lwc/v/5_3_0"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_4/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_12_0-alpha_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_4/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_12_0-alpha_4"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_4/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_4/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js","lwr/init/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_4/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js","lwr/metrics/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_4/s/274c8343f810353bbad085a79709395f/lwr_metrics.js","lwr/profiler/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_4/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js","lwc/v/5_3_0":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F5_3_0/s/d6928cae62ba4c18e61fa9c234830c2a/lwc.js","lwr/everywhereAmd/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_4/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_4/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_12_0-alpha_4"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4"],"preloadModules":["lwr/preInit/v/0_12_0-alpha_4","lwr/init/v/0_12_0-alpha_4","lwr/metrics/v/0_12_0-alpha_4","lwc/v/5_3_0","lwr/everywhereAmd/v/0_12_0-alpha_4"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
5
+ globalThis.process = { env: {"NODE_ENV":"compat","SSR":false,"basePath":"","locale":"en-US","assetBasePath":"","uiBasePath":""} };
6
+ globalThis.lwcRuntimeFlags = { ENABLE_MIXED_SHADOW_MODE: false };
7
+ // Appended by Static Site Generator
8
+ if (!globalThis.LWR.imports) { globalThis.LWR.imports = {}; }
9
+ Object.assign(globalThis.LWR.imports, {"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_12_0-alpha_4/s/5c5d9084a8557502d4eed0d5788db05d/lwr_loader.js":["lwr/loader/v/0_12_0-alpha_4"]})
10
+ if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
11
+ Object.assign(globalThis.LWR.index, {"lwr/loader/v/0_12_0-alpha_4":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_12_0-alpha_4/s/5c5d9084a8557502d4eed0d5788db05d/lwr_loader.js"})
@@ -0,0 +1,14 @@
1
+ LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4', ['lwr/loader/v/0_12_0-alpha_4', 'lwr/preInit/v/0_12_0-alpha_4', 'lwr/init/v/0_12_0-alpha_4'], (function (_0_12_0Alpha_4$2, _0_12_0Alpha_4, _0_12_0Alpha_4$1) { 'use strict';
2
+
3
+ const clientBootstrapConfig = _0_12_0Alpha_4.getClientBootstrapConfig();
4
+
5
+ // initialize additional non-configured root components
6
+ const { rootComponents, serverData } = clientBootstrapConfig;
7
+ Promise.all(rootComponents.map(async (rootSpecifier) => {
8
+ const element = _0_12_0Alpha_4$1.toKebabCase(rootSpecifier);
9
+ return _0_12_0Alpha_4$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_4').then(({default: Ctor}) => {
10
+ _0_12_0Alpha_4$1.init([[element, Ctor]], serverData);
11
+ });
12
+ }));
13
+
14
+ }));
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/5_3_0', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (C) 2023 salesforce.com, inc.
@@ -316,9 +316,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
316
316
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
317
317
  */
318
318
  // Increment whenever the LWC template compiler changes
319
- const LWC_VERSION = "5.1.0";
319
+ const LWC_VERSION = "5.3.0";
320
320
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
321
- /** version: 5.1.0 */
321
+ /** version: 5.3.0 */
322
322
 
323
323
  /**
324
324
  * Copyright (C) 2023 salesforce.com, inc.
@@ -340,7 +340,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
340
340
  ENABLE_WIRE_SYNC_EMIT: null,
341
341
  DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
342
342
  ENABLE_FROZEN_TEMPLATE: null,
343
- ENABLE_LEGACY_SCOPE_TOKENS: null
343
+ ENABLE_LEGACY_SCOPE_TOKENS: null,
344
+ ENABLE_FORCE_SHADOW_MIGRATE_MODE: null
344
345
  };
345
346
  // eslint-disable-next-line no-restricted-properties
346
347
  if (!_globalThis.lwcRuntimeFlags) {
@@ -397,7 +398,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
397
398
  setFeatureFlag(name, value);
398
399
  }
399
400
  }
400
- /** version: 5.1.0 */
401
+ /** version: 5.3.0 */
401
402
 
402
403
  /**
403
404
  * Copyright (C) 2023 salesforce.com, inc.
@@ -797,53 +798,52 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
797
798
  const instrumentInstance = (_b = _globalThis.__lwc_instrument_cmp_instance) !== null && _b !== void 0 ? _b : noop;
798
799
 
799
800
  /*
800
- * Copyright (c) 2023, salesforce.com, inc.
801
+ * Copyright (c) 2018, salesforce.com, inc.
801
802
  * All rights reserved.
802
803
  * SPDX-License-Identifier: MIT
803
804
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
804
805
  */
805
- // Apply ARIA string reflection behavior to a prototype.
806
- // This is deliberately kept separate from @lwc/aria-reflection. @lwc/aria-reflection is a global polyfill that is
807
- // needed for backwards compatibility in LEX, whereas `applyAriaReflection` is designed to only apply to our own
808
- // LightningElement/BaseBridgeElement prototypes.
809
- function applyAriaReflection(prototype) {
810
- for (const propName of keys(AriaPropNameToAttrNameMap)) {
811
- const attrName = AriaPropNameToAttrNameMap[propName];
812
- if (isUndefined$1(getOwnPropertyDescriptor$1(prototype, propName))) {
813
- // Note that we need to call this.{get,set,has,remove}Attribute rather than dereferencing
814
- // from Element.prototype, because these methods are overridden in LightningElement.
815
- defineProperty(prototype, propName, {
816
- get() {
817
- return this.getAttribute(attrName);
818
- },
819
- set(newValue) {
820
- // TODO [#3284]: there is disagreement between browsers and the spec on how to treat undefined
821
- // Our historical behavior is to only treat null as removing the attribute
822
- // See also https://github.com/w3c/aria/issues/1858
823
- if (isNull(newValue)) {
824
- this.removeAttribute(attrName);
825
- } else {
826
- this.setAttribute(attrName, newValue);
827
- }
828
- },
829
- // configurable and enumerable to allow it to be overridden – this mimics Safari's/Chrome's behavior
830
- configurable: true,
831
- enumerable: true
832
- });
833
- }
834
- }
835
- }
806
+ // This is a temporary workaround to get the @lwc/engine-server to evaluate in node without having
807
+ // to inject at runtime.
808
+ const HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
809
+ const HTMLElementPrototype = HTMLElementConstructor.prototype;
836
810
 
837
811
  /*
838
- * Copyright (c) 2018, salesforce.com, inc.
812
+ * Copyright (c) 2023, salesforce.com, inc.
839
813
  * All rights reserved.
840
814
  * SPDX-License-Identifier: MIT
841
815
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
842
816
  */
843
- // This is a temporary workaround to get the @lwc/engine-server to evaluate in node without having
844
- // to inject at runtime.
845
- const HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
846
- const HTMLElementPrototype = HTMLElementConstructor.prototype;
817
+ // Apply ARIA string reflection behavior to a prototype.
818
+ // This is deliberately kept separate from @lwc/aria-reflection. @lwc/aria-reflection is a global polyfill that is
819
+ // needed for backwards compatibility in LEX, whereas this is designed to only apply to our own
820
+ // LightningElement/BaseBridgeElement prototypes.
821
+ // Note we only need to handle ARIA reflections that aren't already in Element.prototype
822
+ const ariaReflectionPolyfillDescriptors = create(null);
823
+ for (const [propName, attrName] of entries(AriaPropNameToAttrNameMap)) {
824
+ if (isUndefined$1(getPropertyDescriptor(HTMLElementPrototype, propName))) {
825
+ // Note that we need to call this.{get,set,has,remove}Attribute rather than dereferencing
826
+ // from Element.prototype, because these methods are overridden in LightningElement.
827
+ ariaReflectionPolyfillDescriptors[propName] = {
828
+ get() {
829
+ return this.getAttribute(attrName);
830
+ },
831
+ set(newValue) {
832
+ // TODO [#3284]: there is disagreement between browsers and the spec on how to treat undefined
833
+ // Our historical behavior is to only treat null as removing the attribute
834
+ // See also https://github.com/w3c/aria/issues/1858
835
+ if (isNull(newValue)) {
836
+ this.removeAttribute(attrName);
837
+ } else {
838
+ this.setAttribute(attrName, newValue);
839
+ }
840
+ },
841
+ // configurable and enumerable to allow it to be overridden – this mimics Safari's/Chrome's behavior
842
+ configurable: true,
843
+ enumerable: true
844
+ };
845
+ }
846
+ }
847
847
 
848
848
  /*
849
849
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1504,7 +1504,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1504
1504
  valueMutated(originalTarget, key);
1505
1505
  return true;
1506
1506
  }
1507
- /*LWC compiler v5.1.0*/
1507
+ /*LWC compiler v5.3.0*/
1508
1508
  }
1509
1509
  const getterMap = new WeakMap();
1510
1510
  const setterMap = new WeakMap();
@@ -1597,7 +1597,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1597
1597
  /* istanbul ignore next */
1598
1598
  return false;
1599
1599
  }
1600
- /*LWC compiler v5.1.0*/
1600
+ /*LWC compiler v5.3.0*/
1601
1601
  }
1602
1602
  function extract(objectOrArray) {
1603
1603
  if (isArray(objectOrArray)) {
@@ -1805,6 +1805,77 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1805
1805
  }
1806
1806
  }
1807
1807
 
1808
+ /*
1809
+ * Copyright (c) 2023, salesforce.com, inc.
1810
+ * All rights reserved.
1811
+ * SPDX-License-Identifier: MIT
1812
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1813
+ */
1814
+ let globalStylesheet;
1815
+ function isStyleElement(elm) {
1816
+ return elm.tagName === 'STYLE';
1817
+ }
1818
+ async function fetchStylesheet(elm) {
1819
+ if (isStyleElement(elm)) {
1820
+ return elm.textContent;
1821
+ } else {
1822
+ // <link>
1823
+ const {
1824
+ href
1825
+ } = elm;
1826
+ try {
1827
+ return await (await fetch(href)).text();
1828
+ } catch (err) {
1829
+ logWarnOnce(`Ignoring cross-origin stylesheet in migrate mode: ${href}`);
1830
+ // ignore errors with cross-origin stylesheets - nothing we can do for those
1831
+ return '';
1832
+ }
1833
+ }
1834
+ }
1835
+ function initGlobalStylesheet() {
1836
+ const stylesheet = new CSSStyleSheet();
1837
+ const elmsToPromises = new Map();
1838
+ let lastSeenLength = 0;
1839
+ const copyToGlobalStylesheet = () => {
1840
+ const elms = document.head.querySelectorAll('style:not([data-rendered-by-lwc]),link[rel="stylesheet"]');
1841
+ if (elms.length === lastSeenLength) {
1842
+ return; // nothing to update
1843
+ }
1844
+ lastSeenLength = elms.length;
1845
+ const promises = [...elms].map(elm => {
1846
+ let promise = elmsToPromises.get(elm);
1847
+ if (!promise) {
1848
+ // Cache the promise
1849
+ promise = fetchStylesheet(elm);
1850
+ elmsToPromises.set(elm, promise);
1851
+ }
1852
+ return promise;
1853
+ });
1854
+ Promise.all(promises).then(stylesheetTexts => {
1855
+ // When replaceSync() is called, the entire contents of the constructable stylesheet are replaced
1856
+ // with the copied+concatenated styles. This means that any shadow root's adoptedStyleSheets that
1857
+ // contains this constructable stylesheet will immediately get the new styles.
1858
+ stylesheet.replaceSync(stylesheetTexts.join('\n'));
1859
+ });
1860
+ };
1861
+ const headObserver = new MutationObserver(copyToGlobalStylesheet);
1862
+ // By observing only the childList, note that we are not covering the case where someone changes an `href`
1863
+ // on an existing <link>`, or the textContent on an existing `<style>`. This is assumed to be an uncommon
1864
+ // case and not worth covering.
1865
+ headObserver.observe(document.head, {
1866
+ childList: true
1867
+ });
1868
+ copyToGlobalStylesheet();
1869
+ return stylesheet;
1870
+ }
1871
+ function applyShadowMigrateMode(shadowRoot) {
1872
+ if (!globalStylesheet) {
1873
+ globalStylesheet = initGlobalStylesheet();
1874
+ }
1875
+ shadowRoot.synthetic = true; // pretend to be synthetic mode
1876
+ shadowRoot.adoptedStyleSheets.push(globalStylesheet);
1877
+ }
1878
+
1808
1879
  /*
1809
1880
  * Copyright (c) 2018, salesforce.com, inc.
1810
1881
  * All rights reserved.
@@ -1957,6 +2028,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1957
2028
  if (process.env.NODE_ENV !== 'production') {
1958
2029
  patchShadowRootWithRestrictions(shadowRoot);
1959
2030
  }
2031
+ if (lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE && vm.shadowMigrateMode) {
2032
+ applyShadowMigrateMode(shadowRoot);
2033
+ }
1960
2034
  return shadowRoot;
1961
2035
  }
1962
2036
  function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
@@ -2387,11 +2461,17 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
2387
2461
  for (const propName in HTMLElementOriginalDescriptors) {
2388
2462
  lightningBasedDescriptors[propName] = createBridgeToElementDescriptor(propName, HTMLElementOriginalDescriptors[propName]);
2389
2463
  }
2390
- defineProperties(LightningElement.prototype, lightningBasedDescriptors);
2391
2464
  // Apply ARIA reflection to LightningElement.prototype, on both the browser and server.
2392
2465
  // This allows `this.aria*` property accessors to work from inside a component, and to reflect `aria-*` attrs.
2393
2466
  // Note this works regardless of whether the global ARIA reflection polyfill is applied or not.
2394
- applyAriaReflection(LightningElement.prototype);
2467
+ {
2468
+ // In the browser, we use createBridgeToElementDescriptor, so we can get the normal reactivity lifecycle for
2469
+ // aria* properties
2470
+ for (const [propName, descriptor] of entries(ariaReflectionPolyfillDescriptors)) {
2471
+ lightningBasedDescriptors[propName] = createBridgeToElementDescriptor(propName, descriptor);
2472
+ }
2473
+ }
2474
+ defineProperties(LightningElement.prototype, lightningBasedDescriptors);
2395
2475
  defineProperty(LightningElement, 'CustomElementConstructor', {
2396
2476
  get() {
2397
2477
  // If required, a runtime-specific implementation must be defined.
@@ -3272,7 +3352,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3272
3352
  }
3273
3353
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3274
3354
  const HTMLBridgeElement = class extends SuperClass {
3275
- /*LWC compiler v5.1.0*/
3355
+ /*LWC compiler v5.3.0*/
3276
3356
  };
3277
3357
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3278
3358
  // and false positives in case of inheritance.
@@ -3297,7 +3377,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3297
3377
  // and can break tooling that expects it to be iterable or defined, e.g. Jest:
3298
3378
  // https://github.com/jestjs/jest/blob/b4c9587/packages/pretty-format/src/plugins/DOMElement.ts#L95
3299
3379
  // It also doesn't make sense to override e.g. "constructor".
3300
- .filter(propName => !(propName in HTMLElementPrototype)));
3380
+ .filter(propName => !(propName in HTMLElementPrototype) && !(propName in ariaReflectionPolyfillDescriptors)));
3301
3381
  for (const propName of nonPublicPropertiesToWarnOn) {
3302
3382
  if (ArrayIndexOf.call(publicProperties, propName) === -1) {
3303
3383
  descriptors[propName] = createAccessorThatWarns(propName);
@@ -3367,21 +3447,19 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3367
3447
  defineProperties(HTMLBridgeElement.prototype, descriptors);
3368
3448
  return HTMLBridgeElement;
3369
3449
  }
3370
- const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), [], [], null, false);
3371
- {
3372
- // This ARIA reflection only really makes sense in the browser. On the server, there is no `renderedCallback()`,
3373
- // so you cannot do e.g. `this.template.querySelector('x-child').ariaBusy = 'true'`. So we don't need to expose
3374
- // ARIA props outside the LightningElement
3375
- //
3376
- // Apply ARIA reflection to HTMLBridgeElement.prototype. This allows `elm.aria*` property accessors to work from
3377
- // outside a component, and to reflect `aria-*` attrs. This is especially important because the template compiler
3378
- // compiles aria-* attrs on components to aria* props.
3379
- // Note this works regardless of whether the global ARIA reflection polyfill is applied or not.
3380
- //
3381
- // Also note that we apply this to BaseBridgeElement.prototype to avoid excessively redefining property
3382
- // accessors inside the HTMLBridgeElementFactory.
3383
- applyAriaReflection(BaseBridgeElement.prototype);
3384
- }
3450
+ // We do some special handling of non-standard ARIA props like ariaLabelledBy as well as props without (as of this
3451
+ // writing) broad cross-browser support like ariaBrailleLabel. This is so the reflection works correctly and preserves
3452
+ // backwards compatibility with the previous global polyfill approach.
3453
+ //
3454
+ // The goal here is to expose `elm.aria*` property accessors to work from outside a component, and to reflect `aria-*`
3455
+ // attrs. This is especially important because the template compiler compiles aria-* attrs on components to aria* props.
3456
+ // Note this works regardless of whether the global ARIA reflection polyfill is applied or not.
3457
+ //
3458
+ // Also note this ARIA reflection only really makes sense in the browser. On the server, there is no
3459
+ // `renderedCallback()`, so you cannot do e.g. `this.template.querySelector('x-child').ariaBusy = 'true'`. So we don't
3460
+ // need to expose ARIA props outside the LightningElement
3461
+ const basePublicProperties = [...getOwnPropertyNames$1(HTMLElementOriginalDescriptors), ...getOwnPropertyNames$1(ariaReflectionPolyfillDescriptors)];
3462
+ const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, basePublicProperties, [], [], null, false);
3385
3463
  freeze(BaseBridgeElement);
3386
3464
  seal(BaseBridgeElement.prototype);
3387
3465
 
@@ -3863,7 +3941,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3863
3941
  // avoid leaking the reference to the public props descriptors
3864
3942
  publicProps[key] = {
3865
3943
  config: propsConfig[key] || 0,
3944
+ // a property by default
3866
3945
  type: "any" /* PropDefType.any */,
3946
+ // no type inference for public services
3867
3947
  attr: htmlPropertyToAttribute(key)
3868
3948
  };
3869
3949
  }
@@ -3893,6 +3973,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3893
3973
  function createInlineStyleVNode(content) {
3894
3974
  return api.h('style', {
3895
3975
  key: 'style',
3976
+ // special key
3896
3977
  attrs: {
3897
3978
  type: 'text/css'
3898
3979
  }
@@ -5603,6 +5684,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
5603
5684
  ctor: Ctor,
5604
5685
  owner: vmBeingRendered,
5605
5686
  mode: 'open',
5687
+ // TODO [#1294]: this should be defined in Ctor
5606
5688
  aChildren,
5607
5689
  vm
5608
5690
  };
@@ -6545,6 +6627,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6545
6627
  // Properties set right after VM creation.
6546
6628
  tro: null,
6547
6629
  shadowMode: null,
6630
+ shadowMigrateMode: false,
6548
6631
  stylesheets: null,
6549
6632
  // Properties set by the LightningElement constructor.
6550
6633
  component: null,
@@ -6560,8 +6643,21 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6560
6643
  vm.debugInfo = create(null);
6561
6644
  }
6562
6645
  vm.stylesheets = computeStylesheets(vm, def.ctor);
6563
- vm.shadowMode = computeShadowMode(def, vm.owner, renderer);
6646
+ const computedShadowMode = computeShadowMode(def, vm.owner, renderer);
6647
+ if (lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE) {
6648
+ vm.shadowMode = 0 /* ShadowMode.Native */;
6649
+ vm.shadowMigrateMode = computedShadowMode === 1 /* ShadowMode.Synthetic */;
6650
+ } else {
6651
+ vm.shadowMode = computedShadowMode;
6652
+ }
6564
6653
  vm.tro = getTemplateReactiveObserver(vm);
6654
+ // We don't need to report the shadow mode if we're rendering in light DOM
6655
+ if (isReportingEnabled() && vm.renderMode === 1 /* RenderMode.Shadow */) {
6656
+ report("ShadowModeUsage" /* ReportingEventId.ShadowModeUsage */, {
6657
+ tagName: vm.tagName,
6658
+ mode: vm.shadowMode
6659
+ });
6660
+ }
6565
6661
  if (process.env.NODE_ENV !== 'production') {
6566
6662
  vm.toString = () => {
6567
6663
  return `[object:vm ${def.name} (${vm.idx})]`;
@@ -6651,7 +6747,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6651
6747
  isSyntheticShadowDefined
6652
6748
  } = renderer;
6653
6749
  let shadowMode;
6654
- if (isSyntheticShadowDefined) {
6750
+ // If ENABLE_FORCE_SHADOW_MIGRATE_MODE is true, then ShadowMode.Synthetic here will mean "force-migrate" mode.
6751
+ if (isSyntheticShadowDefined || lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE) {
6655
6752
  if (def.renderMode === 0 /* RenderMode.Light */) {
6656
6753
  // ShadowMode.Native implies "not synthetic shadow" which is consistent with how
6657
6754
  // everything defaults to native when the synthetic shadow polyfill is unavailable.
@@ -8139,7 +8236,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8139
8236
  }
8140
8237
  return getReadOnlyProxy(obj);
8141
8238
  }
8142
- /** version: 5.1.0 */
8239
+ /** version: 5.3.0 */
8143
8240
 
8144
8241
  /*
8145
8242
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8246,6 +8343,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8246
8343
  const elm = document.createElement('style');
8247
8344
  elm.type = 'text/css';
8248
8345
  elm.textContent = content;
8346
+ // Add an attribute to distinguish global styles added by LWC as opposed to other frameworks/libraries on the page
8347
+ elm.setAttribute('data-rendered-by-lwc', '');
8249
8348
  return elm;
8250
8349
  }
8251
8350
  function createStyleElement(content, cacheData) {
@@ -8386,7 +8485,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8386
8485
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
8387
8486
  }
8388
8487
  }
8389
- /*LWC compiler v5.1.0*/
8488
+ /*LWC compiler v5.3.0*/
8390
8489
  }
8391
8490
  UpgradableConstructor.formAssociated = true;
8392
8491
  // Do not unnecessarily add a connectedCallback/disconnectedCallback/etc., as it introduces perf overhead
@@ -8482,7 +8581,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8482
8581
  function isNull(obj) {
8483
8582
  return obj === null;
8484
8583
  }
8485
- /** version: 5.1.0 */
8584
+ /** version: 5.3.0 */
8486
8585
 
8487
8586
  /*
8488
8587
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8502,7 +8601,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8502
8601
  this.setNewContext = setNewContext;
8503
8602
  this.setDisconnectedCallback = setDisconnectedCallback;
8504
8603
  }
8505
- /*LWC compiler v5.1.0*/
8604
+ /*LWC compiler v5.3.0*/
8506
8605
  }
8507
8606
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
8508
8607
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -8882,7 +8981,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8882
8981
  attributeChangedCallback(name, oldValue, newValue) {
8883
8982
  attributeChangedCallback.call(this, name, oldValue, newValue);
8884
8983
  }
8885
- /*LWC compiler v5.1.0*/
8984
+ /*LWC compiler v5.3.0*/
8886
8985
  }, _a.observedAttributes = observedAttributes, _a;
8887
8986
  }
8888
8987
 
@@ -9085,7 +9184,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
9085
9184
  });
9086
9185
  });
9087
9186
  }
9088
- /** version: 5.1.0 */
9187
+ /** version: 5.3.0 */
9089
9188
 
9090
9189
  exports.LightningElement = LightningElement;
9091
9190
  exports.__unstable__ProfilerControl = profilerControl;
@@ -1,10 +1,10 @@
1
- LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_2', ['exports', 'lwr/vault/v/0_12_0-alpha_2'], (function (exports, _0_12_0Alpha_2) { 'use strict';
1
+ LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_4', ['exports', 'lwr/vault/v/0_12_0-alpha_4'], (function (exports, _0_12_0Alpha_4) { 'use strict';
2
2
 
3
3
  // IMPORTANT: Do not add any static imports to this file that are not bundled with the amd-client
4
4
 
5
5
  // Do an OAuthed fetch
6
6
  async function authFetch(url, accept = 'javascript') {
7
- const authInfo = _0_12_0Alpha_2.getAuthInfo();
7
+ const authInfo = _0_12_0Alpha_4.getAuthInfo();
8
8
  if (authInfo) {
9
9
  return fetch(url, {
10
10
  headers: {
@@ -53,7 +53,7 @@ LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_2', ['exports', 'lwr/vault/v/0_12_0
53
53
  function authenticate(authInfo) {
54
54
  // Put OAuth info into the vault
55
55
  if (authInfo) {
56
- _0_12_0Alpha_2.setAuthInfo(authInfo);
56
+ _0_12_0Alpha_4.setAuthInfo(authInfo);
57
57
  }
58
58
  }
59
59
 
@@ -1,16 +1,16 @@
1
- LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_2', 'lwr/profiler/v/0_12_0-alpha_2', 'lwc/v/5_1_0'], (function (exports, _0_12_0Alpha_2$1, _0_12_0Alpha_2, _5_1_0) { 'use strict';
1
+ LWR.define('lwr/init/v/0_12_0-alpha_4', ['exports', 'lwr/metrics/v/0_12_0-alpha_4', 'lwr/profiler/v/0_12_0-alpha_4', 'lwc/v/5_3_0'], (function (exports, _0_12_0Alpha_4$1, _0_12_0Alpha_4, _5_3_0) { 'use strict';
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
4
 
5
5
  // <hydrateComponentProxy> - This code is removed in core
6
6
 
7
7
  function hydrateComponentProxy(customElement, Ctor, props) {
8
- _5_1_0.hydrateComponent(customElement, Ctor, props);
8
+ _5_3_0.hydrateComponent(customElement, Ctor, props);
9
9
  }
10
10
  // </hydrateComponentProxy>
11
11
 
12
12
  function initializeWebComponent(elementName, Ctor) {
13
- return _5_1_0.createElement(elementName, {
13
+ return _5_3_0.createElement(elementName, {
14
14
  is: Ctor
15
15
  });
16
16
  }
@@ -47,13 +47,13 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
47
47
  */
48
48
  function init(rootModules, serverData = {}) {
49
49
  if (typeof customElements === 'undefined' || typeof document === 'undefined') {
50
- _0_12_0Alpha_2.logOperationStart({
51
- id: _0_12_0Alpha_2$1.BOOTSTRAP_END
50
+ _0_12_0Alpha_4.logOperationStart({
51
+ id: _0_12_0Alpha_4$1.BOOTSTRAP_END
52
52
  });
53
53
  return;
54
54
  }
55
- _0_12_0Alpha_2.logOperationStart({
56
- id: _0_12_0Alpha_2$1.INIT
55
+ _0_12_0Alpha_4.logOperationStart({
56
+ id: _0_12_0Alpha_4$1.INIT
57
57
  });
58
58
  let index = 0;
59
59
  for (const [specifier, ctor] of rootModules) {
@@ -61,8 +61,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
61
61
 
62
62
  // initialize and inject the root module into the LWR Root or DOM if it is missing
63
63
  if (!document.body.querySelector(elementName)) {
64
- _0_12_0Alpha_2.logOperationStart({
65
- id: _0_12_0Alpha_2$1.INIT_MODULE,
64
+ _0_12_0Alpha_4.logOperationStart({
65
+ id: _0_12_0Alpha_4$1.INIT_MODULE,
66
66
  specifier,
67
67
  specifierIndex: ++index
68
68
  });
@@ -71,8 +71,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
71
71
  const component = initializeWebComponent(elementName, ctor);
72
72
  const container = document.querySelector('[lwr-root]');
73
73
  container ? container.appendChild(component) : document.body.appendChild(component);
74
- _0_12_0Alpha_2.logOperationEnd({
75
- id: _0_12_0Alpha_2$1.INIT_MODULE,
74
+ _0_12_0Alpha_4.logOperationEnd({
75
+ id: _0_12_0Alpha_4$1.INIT_MODULE,
76
76
  specifier,
77
77
  specifierIndex: index,
78
78
  metadata: {
@@ -85,8 +85,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
85
85
  // the page has been rendered or SSR'd, and each component needs to initialized(or hydrated)
86
86
  const elements = document.querySelectorAll(elementName);
87
87
  for (const element of elements) {
88
- _0_12_0Alpha_2.logOperationStart({
89
- id: _0_12_0Alpha_2$1.INIT_MODULE,
88
+ _0_12_0Alpha_4.logOperationStart({
89
+ id: _0_12_0Alpha_4$1.INIT_MODULE,
90
90
  specifier,
91
91
  specifierIndex: ++index
92
92
  });
@@ -97,8 +97,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
97
97
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
98
98
  // @ts-ignore
99
99
  hydrateComponentProxy(element, ctor, serverData[propsId] || {});
100
- _0_12_0Alpha_2.logOperationEnd({
101
- id: _0_12_0Alpha_2$1.INIT_MODULE,
100
+ _0_12_0Alpha_4.logOperationEnd({
101
+ id: _0_12_0Alpha_4$1.INIT_MODULE,
102
102
  specifier,
103
103
  specifierIndex: index,
104
104
  metadata: {
@@ -136,8 +136,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
136
136
  if (parent) {
137
137
  parent.replaceChild(component, element);
138
138
  }
139
- _0_12_0Alpha_2.logOperationEnd({
140
- id: _0_12_0Alpha_2$1.INIT_MODULE,
139
+ _0_12_0Alpha_4.logOperationEnd({
140
+ id: _0_12_0Alpha_4$1.INIT_MODULE,
141
141
  specifier,
142
142
  specifierIndex: index,
143
143
  metadata: {
@@ -146,11 +146,11 @@ LWR.define('lwr/init/v/0_12_0-alpha_2', ['exports', 'lwr/metrics/v/0_12_0-alpha_
146
146
  });
147
147
  }
148
148
  }
149
- _0_12_0Alpha_2.logOperationEnd({
150
- id: _0_12_0Alpha_2$1.INIT
149
+ _0_12_0Alpha_4.logOperationEnd({
150
+ id: _0_12_0Alpha_4$1.INIT
151
151
  });
152
- _0_12_0Alpha_2.logOperationStart({
153
- id: _0_12_0Alpha_2$1.BOOTSTRAP_END
152
+ _0_12_0Alpha_4.logOperationStart({
153
+ id: _0_12_0Alpha_4$1.BOOTSTRAP_END
154
154
  });
155
155
  }
156
156
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/loader/v/0_12_0-alpha_2', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/loader/v/0_12_0-alpha_4', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (c) 2021, salesforce.com, inc.
@@ -6,7 +6,7 @@ LWR.define('lwr/loader/v/0_12_0-alpha_2', ['exports'], (function (exports) { 'us
6
6
  * SPDX-License-Identifier: MIT
7
7
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8
8
  */
9
- /* LWR Module Loader v0.12.0-alpha.2 */
9
+ /* LWR Module Loader v0.12.0-alpha.4 */
10
10
  const templateRegex = /\{([0-9]+)\}/g;
11
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
12
  function templateString(template, args) {
@@ -25,7 +25,7 @@ LWR.define('lwr/loader/v/0_12_0-alpha_2', ['exports'], (function (exports) { 'us
25
25
  super();
26
26
  this.message = generateErrorMessage(errorInfo, errorArgs);
27
27
  }
28
- /*LWC compiler v5.1.0*/
28
+ /*LWC compiler v5.3.0*/
29
29
  }
30
30
  function invariant(condition, errorInfo) {
31
31
  if (!condition) {
@@ -609,7 +609,7 @@ LWR.define('lwr/loader/v/0_12_0-alpha_2', ['exports'], (function (exports) { 'us
609
609
  // swallow
610
610
  }
611
611
  const trusted = createPolicy('trusted', policyOptions);
612
- /*! version: 0.20.8 */
612
+ /*! version: 0.21.0 */
613
613
 
614
614
  /* global console,process */
615
615
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/metrics/v/0_12_0-alpha_2', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/metrics/v/0_12_0-alpha_4', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  // Bootstrap / shim
4
4
  const BOOTSTRAP_PREFIX = 'lwr.bootstrap.';