@lwrjs/everywhere 0.22.8 → 0.22.10

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 (25) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/721912722105286076ed8c5d82681c16/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_8 → 0_22_10}/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/lwr/everywhereAmd/v/{0_22_8 → 0_22_10}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -3
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_22_8 → 0_22_10}/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js +20 -20
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_22_8/s/8afe3074324df90c3915742182196e2f → 0_22_10/s/12ccd89f3da2e8c2e1a0a994c4d1a2b8}/lwr_loader.js +13 -4
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_22_8 → 0_22_10}/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js +1 -1
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_22_8 → 0_22_10}/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js +1 -1
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_22_8 → 0_22_10}/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/scheduler/v/{0_22_8 → 0_22_10}/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_22_8 → 0_22_10}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_22_8 → 0_22_10}/lwr-error-shim.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_22_8 → 0_22_10}/lwr-loader-shim.bundle.js +123 -12
  13. package/build/assets/amd/lwr-everywhere-debug.js +25 -11
  14. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  15. package/build/assets/amd/lwr-everywhere.js +25 -11
  16. package/build/assets/core/lwr-everywhere-debug.js +21 -7
  17. package/build/assets/core/lwr-everywhere-min.js +2 -2
  18. package/build/assets/core/lwr-everywhere.js +21 -7
  19. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  20. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  21. package/build/assets/esm/lwr-everywhere.js +1 -1
  22. package/build/generate.js +18 -1
  23. package/package.json +7 -6
  24. package/src/generate.ts +17 -1
  25. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/7ac1d194d502ea30be658c7daff195f4/config.js +0 -12
@@ -0,0 +1,12 @@
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_22_10","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_22_10/s/d4022ae1b3a47f5bb62c600fd6b8f139/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_22_10/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js":["lwr/preInit/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_22_10/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js":["lwr/init/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_22_10/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js":["lwr/metrics/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2Fscheduler%2Fv%2F0_22_10/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js":["lwr/scheduler/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F8_22_6/s/21cb42e66f1f2b4362fe6203653b692f/lwc.js":["lwc/v/8_22_6"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_22_10/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_22_10/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_22_10"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_10":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_22_10/s/d4022ae1b3a47f5bb62c600fd6b8f139/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_22_10/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js","lwr/init/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_22_10/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js","lwr/metrics/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_22_10/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js","lwr/scheduler/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Fscheduler%2Fv%2F0_22_10/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js","lwc/v/8_22_6":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F8_22_6/s/21cb42e66f1f2b4362fe6203653b692f/lwc.js","lwr/everywhereAmd/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_22_10/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_22_10/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_22_10"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_10"],"preloadModules":["lwr/preInit/v/0_22_10","lwr/init/v/0_22_10","lwr/metrics/v/0_22_10","lwr/scheduler/v/0_22_10","lwc/v/8_22_6","lwr/everywhereAmd/v/0_22_10"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
5
+ globalThis.LWR = {...globalThis.LWR, env: {"SSR":false,"SSREnabled":false,"basePath":"","locale":"en-US","assetBasePath":"","uiBasePath":""}};
6
+ globalThis.process={...globalThis.process,env:{...globalThis.process?.env,...{"NODE_ENV":"compat"}}};
7
+ globalThis.lwcRuntimeFlags = { ENABLE_MIXED_SHADOW_MODE: false, ENABLE_WIRE_SYNC_EMIT: false };
8
+ // Appended by Static Site Generator
9
+ if (!globalThis.LWR.imports) { globalThis.LWR.imports = {}; }
10
+ Object.assign(globalThis.LWR.imports, {"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_22_10/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js":["lwr/profiler/v/0_22_10"],"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_22_10/s/12ccd89f3da2e8c2e1a0a994c4d1a2b8/lwr_loader.js":["lwr/loader/v/0_22_10"]})
11
+ if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
12
+ Object.assign(globalThis.LWR.index, {"lwr/profiler/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_22_10/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js","lwr/loader/v/0_22_10":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_22_10/s/12ccd89f3da2e8c2e1a0a994c4d1a2b8/lwr_loader.js"})
@@ -1,15 +1,15 @@
1
- LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_8', ['lwr/loader/v/0_22_8', 'lwr/preInit/v/0_22_8', 'lwr/init/v/0_22_8'], (function (_0_22_8$2, _0_22_8, _0_22_8$1) { 'use strict';
1
+ LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_10', ['lwr/loader/v/0_22_10', 'lwr/preInit/v/0_22_10', 'lwr/init/v/0_22_10'], (function (_0_22_10$2, _0_22_10, _0_22_10$1) { 'use strict';
2
2
 
3
- const clientBootstrapConfig = _0_22_8.getClientBootstrapConfig();
3
+ const clientBootstrapConfig = _0_22_10.getClientBootstrapConfig();
4
4
  const { serverData, rootComponents } = clientBootstrapConfig;
5
5
 
6
6
  // initialize additional non-configured root components
7
7
  Promise.all(rootComponents.map(async (rootSpecifier) => {
8
- const element = _0_22_8$1.toKebabCase(rootSpecifier);
9
- const { default: Ctor } = await _0_22_8$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_8');
8
+ const element = _0_22_10$1.toKebabCase(rootSpecifier);
9
+ const { default: Ctor } = await _0_22_10$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_22_10');
10
10
  return [element, Ctor];
11
11
  })).then((rootModules) => {
12
- return _0_22_8$1.init(rootModules, serverData);
12
+ return _0_22_10$1.init(rootModules, serverData);
13
13
  }).then(() => {
14
14
  // Defer clearing so SSR'd components read ENABLE_WIRE_SYNC_EMIT: true in connectedCallback (timing varies by env)
15
15
  const clearSyncEmit = () => {
@@ -1,10 +1,10 @@
1
- LWR.define('lwr/everywhereAmd/v/0_22_8', ['exports', 'lwr/vault/v/0_22_8'], (function (exports, _0_22_8) { 'use strict';
1
+ LWR.define('lwr/everywhereAmd/v/0_22_10', ['exports', 'lwr/vault/v/0_22_10'], (function (exports, _0_22_10) { '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_22_8.getAuthInfo();
7
+ const authInfo = _0_22_10.getAuthInfo();
8
8
  if (authInfo) {
9
9
  return fetch(url, {
10
10
  headers: {
@@ -53,7 +53,7 @@ LWR.define('lwr/everywhereAmd/v/0_22_8', ['exports', 'lwr/vault/v/0_22_8'], (fun
53
53
  function authenticate(authInfo) {
54
54
  // Put OAuth info into the vault
55
55
  if (authInfo) {
56
- _0_22_8.setAuthInfo(authInfo);
56
+ _0_22_10.setAuthInfo(authInfo);
57
57
  }
58
58
  }
59
59
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profiler/v/0_22_8', 'lwr/scheduler/v/0_22_8', 'lwc/v/8_22_6'], (function (exports, _0_22_8$1, _0_22_8, _0_22_8$2, _8_22_6) { 'use strict';
1
+ LWR.define('lwr/init/v/0_22_10', ['exports', 'lwr/metrics/v/0_22_10', 'lwr/profiler/v/0_22_10', 'lwr/scheduler/v/0_22_10', 'lwc/v/8_22_6'], (function (exports, _0_22_10$1, _0_22_10, _0_22_10$2, _8_22_6) { 'use strict';
2
2
 
3
3
  // eslint-disable-next-line lwr/only-allowed-type-imports
4
4
 
@@ -123,13 +123,13 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
123
123
  function init(rootModules, serverData = {}) {
124
124
  // eslint-disable-next-line lwr/no-unguarded-apis
125
125
  if (typeof globalThis.customElements === 'undefined' || typeof globalThis.document === 'undefined') {
126
- _0_22_8.logOperationStart({
127
- id: _0_22_8$1.BOOTSTRAP_END
126
+ _0_22_10.logOperationStart({
127
+ id: _0_22_10$1.BOOTSTRAP_END
128
128
  });
129
129
  return;
130
130
  }
131
- _0_22_8.logOperationStart({
132
- id: _0_22_8$1.INIT
131
+ _0_22_10.logOperationStart({
132
+ id: _0_22_10$1.INIT
133
133
  });
134
134
  (async () => {
135
135
  let index = 0;
@@ -138,15 +138,15 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
138
138
  for (const [specifier, ctor] of rootModules) {
139
139
  // Yield to the main thread during long hydration tasks
140
140
  // eslint-disable-next-line no-await-in-loop
141
- await _0_22_8$2.yieldIfNecessary();
141
+ await _0_22_10$2.yieldIfNecessary();
142
142
  const specifierIndex = ++index;
143
143
  const elementName = toKebabCase(specifier);
144
144
 
145
145
  // initialize and inject the root module into the LWR Root or DOM if it is missing
146
146
  // eslint-disable-next-line lwr/no-unguarded-apis
147
147
  if (!document.body.querySelector(elementName)) {
148
- _0_22_8.logOperationStart({
149
- id: _0_22_8$1.INIT_MODULE,
148
+ _0_22_10.logOperationStart({
149
+ id: _0_22_10$1.INIT_MODULE,
150
150
  specifier,
151
151
  specifierIndex
152
152
  });
@@ -157,8 +157,8 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
157
157
  const container = document.querySelector('[lwr-root]');
158
158
  // eslint-disable-next-line lwr/no-unguarded-apis
159
159
  container ? container.appendChild(component) : document.body.appendChild(component);
160
- _0_22_8.logOperationEnd({
161
- id: _0_22_8$1.INIT_MODULE,
160
+ _0_22_10.logOperationEnd({
161
+ id: _0_22_10$1.INIT_MODULE,
162
162
  specifier,
163
163
  specifierIndex,
164
164
  metadata: {
@@ -172,8 +172,8 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
172
172
  // eslint-disable-next-line lwr/no-unguarded-apis
173
173
  const elements = document.querySelectorAll(elementName);
174
174
  for (const element of elements) {
175
- _0_22_8.logOperationStart({
176
- id: _0_22_8$1.INIT_MODULE,
175
+ _0_22_10.logOperationStart({
176
+ id: _0_22_10$1.INIT_MODULE,
177
177
  specifier,
178
178
  specifierIndex
179
179
  });
@@ -189,8 +189,8 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
189
189
  // hydrate the island immediately
190
190
  hydrateComponentProxy(element, ctor, serverData[propsId] || {});
191
191
  }
192
- _0_22_8.logOperationEnd({
193
- id: _0_22_8$1.INIT_MODULE,
192
+ _0_22_10.logOperationEnd({
193
+ id: _0_22_10$1.INIT_MODULE,
194
194
  specifier,
195
195
  specifierIndex,
196
196
  metadata: {
@@ -228,8 +228,8 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
228
228
  if (parent) {
229
229
  parent.replaceChild(component, element);
230
230
  }
231
- _0_22_8.logOperationEnd({
232
- id: _0_22_8$1.INIT_MODULE,
231
+ _0_22_10.logOperationEnd({
232
+ id: _0_22_10$1.INIT_MODULE,
233
233
  specifier,
234
234
  specifierIndex,
235
235
  metadata: {
@@ -239,11 +239,11 @@ LWR.define('lwr/init/v/0_22_8', ['exports', 'lwr/metrics/v/0_22_8', 'lwr/profile
239
239
  }
240
240
  }
241
241
  })();
242
- _0_22_8.logOperationEnd({
243
- id: _0_22_8$1.INIT
242
+ _0_22_10.logOperationEnd({
243
+ id: _0_22_10$1.INIT
244
244
  });
245
- _0_22_8.logOperationStart({
246
- id: _0_22_8$1.BOOTSTRAP_END
245
+ _0_22_10.logOperationStart({
246
+ id: _0_22_10$1.BOOTSTRAP_END
247
247
  });
248
248
  }
249
249
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/loader/v/0_22_10', ['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_22_8', ['exports'], (function (exports) { 'use strict
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.22.8 */
9
+ /* LWR Module Loader v0.22.10 */
10
10
  const templateRegex = /\{([0-9]+)\}/g;
11
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
12
  function templateString(template, args) {
@@ -152,7 +152,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
152
152
  level: 0,
153
153
  message: 'Cannot import a blob URL'
154
154
  });
155
- Object.freeze({
155
+ const NO_IMPORT_TRANSPORT = Object.freeze({
156
156
  code: 3025,
157
157
  level: 0,
158
158
  message: 'Cannot dynamically import "transport" with importer "{0}"'
@@ -1475,7 +1475,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
1475
1475
 
1476
1476
  /**
1477
1477
  * Validates that the given module id is not one of the forbidden dynamic import specifiers.
1478
- * Throws LoaderError for: lwc, the LWR loader, and blob URLs.
1478
+ * Throws LoaderError for: lwc, the LWR loader, transport/webruntime/transport, and blob URLs.
1479
1479
  *
1480
1480
  * @param id - Module identifier or URL
1481
1481
  * @param importer - Versioned specifier of the module importer (for error reporting)
@@ -1487,6 +1487,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
1487
1487
  LoaderError,
1488
1488
  NO_IMPORT_LWC,
1489
1489
  NO_IMPORT_LOADER,
1490
+ NO_IMPORT_TRANSPORT,
1490
1491
  NO_BLOB_IMPORT
1491
1492
  } = errors;
1492
1493
 
@@ -1504,6 +1505,13 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
1504
1505
  throw new LoaderError(NO_IMPORT_LOADER, [_nullishCoalesce(importer, () => 'unknown')]);
1505
1506
  }
1506
1507
 
1508
+ // Throw an error if the specifier is "transport" or "webruntime/transport" (or versioned)
1509
+ // Dynamic import of transport exposes unsandboxed fetch, bypassing LWS
1510
+ // Reference: Hackforce report HF-3393
1511
+ if (id === 'transport' || id.startsWith('transport/v/') || id === 'webruntime/transport' || id.startsWith('webruntime/transport/v/')) {
1512
+ throw new LoaderError(NO_IMPORT_TRANSPORT, [_nullishCoalesce(importer, () => 'unknown')]);
1513
+ }
1514
+
1507
1515
  // Throw an error if the specifier is a blob URL (case-insensitive check)
1508
1516
  if (id.toLowerCase().startsWith('blob:')) {
1509
1517
  throw new LoaderError(NO_BLOB_IMPORT);
@@ -1604,6 +1612,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
1604
1612
  LoaderError,
1605
1613
  NO_IMPORT_LWC,
1606
1614
  NO_IMPORT_LOADER,
1615
+ NO_IMPORT_TRANSPORT,
1607
1616
  NO_BLOB_IMPORT
1608
1617
  });
1609
1618
  return this.registry.load(id, importer);
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/metrics/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/metrics/v/0_22_10', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  // Bootstrap / shim
4
4
  const BOOTSTRAP_PREFIX = 'lwr.bootstrap.';
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/preInit/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/preInit/v/0_22_10', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * This module is called in the ABS module (app bootstrap module) to perform neccesary pre initialization steps for an LWR app.
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/profiler/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/profiler/v/0_22_10', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  var Phase = /*#__PURE__*/function (Phase) {
4
4
  Phase[Phase["Start"] = 0] = "Start";
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/scheduler/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/scheduler/v/0_22_10', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Result of checking whether to yield to the main thread
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/vault/v/0_22_8', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/vault/v/0_22_10', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  // Credential vault for storing setters and subscribers for OAuth info
4
4
  // This module is a SINGLETON and must be excluded from ESM bundling
@@ -4,5 +4,5 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
6
  */
7
- /* LWR Error Shim v0.22.8 */
7
+ /* LWR Error Shim v0.22.10 */
8
8
  !function(){"use strict";const o=globalThis;if(!(o.LWR&&o.LWR.define)){const r=new Error("The LWR application failed to bootstrap");if(!o.LWR||!o.LWR.onError)throw r;o.LWR.onError(r)}}();
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
6
  */
7
- /* LWR Module Loader Shim v0.22.8 */
7
+ /* LWR Module Loader Shim v0.22.10 */
8
8
  (function () {
9
9
  'use strict';
10
10
 
@@ -105,19 +105,114 @@
105
105
  }
106
106
  }
107
107
 
108
+ /**
109
+ * Parse AMD define args. Supports define(id, deps, factory).
110
+ */
111
+ function parseDefine(def) {
112
+ const [, depsOrFactory, factory] = def;
113
+ if (Array.isArray(depsOrFactory) && typeof factory === 'function') {
114
+ return { deps: depsOrFactory, factory };
115
+ }
116
+ if (typeof depsOrFactory === 'function') {
117
+ return { deps: [], factory: depsOrFactory };
118
+ }
119
+ throw new Error('Invalid module definition');
120
+ }
121
+
122
+ /**
123
+ * Resolve a loader dependency: 'exports' returns the bag; otherwise look up in cache and instantiate.
124
+ * Loader deps are assumed to be leaf modules (no deps of their own)—no recursive resolution.
125
+ */
126
+ function resolveDep(dep, exportsObj, cache) {
127
+ if (dep === 'exports') return exportsObj;
128
+ const mod = cache[dep];
129
+ if (!mod) {
130
+ throw new Error(`Dependency "${dep}" not found in defineCache for loader`);
131
+ }
132
+ try {
133
+ return instantiateLeafModule(mod);
134
+ } catch (e) {
135
+ const msg = e instanceof Error ? e.message : String(e);
136
+ throw new Error(`Loader dependency "${dep}" has invalid definition: ${msg}`);
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Instantiate a leaf module (loader dep). Assumes the module has no dependencies of its own.
142
+ * Supports only deps: [] or ['exports']; any other dep list throws.
143
+ */
144
+ function instantiateLeafModule(def) {
145
+ const { deps, factory } = parseDefine(def);
146
+ if (deps.length > 1 || (deps.length === 1 && deps[0] !== 'exports')) {
147
+ throw new Error(
148
+ `Loader dependencies must have no deps or only ['exports']; got [${deps.join(', ')}]`,
149
+ );
150
+ }
151
+ const exports = {};
152
+ const out = factory(exports);
153
+ return out !== undefined ? out : exports;
154
+ }
155
+
156
+ /**
157
+ * Normalize loader definition to canonical (exports, ...deps). Injects 'exports' if missing.
158
+ */
159
+ function normalizeLoaderDefinition(def) {
160
+ const { deps, factory } = parseDefine(def);
161
+ if (deps.includes('exports')) {
162
+ return { deps, factory };
163
+ }
164
+ const isEmptyDeps = deps.length === 0;
165
+ const normalizedFactory = (exports, ...rest) => {
166
+ const result = isEmptyDeps ? factory(exports) : factory(...rest);
167
+ if (result !== undefined && typeof result === 'object') {
168
+ Object.assign(exports, result);
169
+ }
170
+ };
171
+ return { deps: ['exports', ...deps], factory: normalizedFactory };
172
+ }
173
+
174
+ /**
175
+ * Resolve the loader's dependencies from defineCache. Throws if definition is invalid or deps cannot be resolved.
176
+ */
177
+ function resolveLoaderDepsFromDefineCache(
178
+ loaderSpecifier,
179
+ definition,
180
+ defineCache,
181
+ ) {
182
+ try {
183
+ const { deps, factory } = normalizeLoaderDefinition(definition);
184
+ const exportsObj = {};
185
+ const args = deps.map((dep) => resolveDep(dep, exportsObj, defineCache)) ;
186
+ return { factory: factory , args, exportsObj };
187
+ } catch (e) {
188
+ const msg = e instanceof Error ? e.message : String(e);
189
+ throw new Error(`Expected loader with specifier "${loaderSpecifier}" to be a module. ${msg}`);
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Create a loader from a definition. Original API preserved.
195
+ * Optional defineCache for resolving loader deps (when loader has dependencies).
196
+ */
108
197
  function createLoader(
109
198
  name,
110
199
  definition,
111
200
  config,
112
201
  externalModules,
202
+ defineCache,
113
203
  ) {
114
204
  if (!definition || typeof definition[2] !== 'function') {
115
205
  throw new Error(`Expected loader with specifier "${name}" to be a module`);
116
206
  }
117
207
 
118
- // Create a Loader instance
119
208
  const exports = {};
120
- definition[2].call(null, exports);
209
+ if (defineCache) {
210
+ const { factory, args, exportsObj } = resolveLoaderDepsFromDefineCache(name, definition, defineCache);
211
+ factory(...args);
212
+ Object.assign(exports, exportsObj);
213
+ } else {
214
+ definition[2].call(null, exports);
215
+ }
121
216
  const { Loader } = exports;
122
217
  if (!Loader) {
123
218
  throw new Error('Expected Loader class to be defined');
@@ -214,7 +309,7 @@
214
309
  // Parse configuration
215
310
  this.global = global;
216
311
  this.config = global.LWR ;
217
- this.loaderSpecifier = 'lwr/loader/v/0_22_8';
312
+ this.loaderSpecifier = 'lwr/loader/v/0_22_10';
218
313
 
219
314
  // Set up error handler
220
315
  this.errorHandler = this.config.onError ;
@@ -322,6 +417,7 @@
322
417
  this.defineCache[this.loaderSpecifier],
323
418
  loaderConfig,
324
419
  this.config.preloadModules,
420
+ this.defineCache,
325
421
  );
326
422
  this.mountApp(loader);
327
423
  if (
@@ -345,6 +441,7 @@
345
441
  if (document.body) {
346
442
  resolve();
347
443
  } else {
444
+ /* istanbul ignore next */
348
445
  const observer = new MutationObserver(() => {
349
446
  // eslint-disable-next-line lwr/no-unguarded-apis
350
447
  if (document.body) {
@@ -377,7 +474,7 @@
377
474
  const exporter = (exports) => {
378
475
  Object.assign(exports, { logOperationStart, logOperationEnd });
379
476
  };
380
- define('lwr/profiler/v/0_22_8', ['exports'], exporter);
477
+ define('lwr/profiler/v/0_22_10', ['exports'], exporter);
381
478
  }
382
479
 
383
480
  // Set up the application globals, import map, root custom element...
@@ -417,7 +514,7 @@
417
514
  ])
418
515
  .then(() => {
419
516
  // eslint-disable-next-line lwr/no-unguarded-apis
420
- if (typeof window === 'undefined' || typeof document === undefined) {
517
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
421
518
  return Promise.resolve();
422
519
  }
423
520
  if (initDeferDOM) {
@@ -477,14 +574,14 @@
477
574
  // The loader module is ALWAYS required
478
575
  const GLOBAL = globalThis ;
479
576
  GLOBAL.LWR.requiredModules = GLOBAL.LWR.requiredModules || [];
480
- if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/0_22_8') < 0) {
481
- GLOBAL.LWR.requiredModules.push('lwr/loader/v/0_22_8');
577
+ if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/0_22_10') < 0) {
578
+ GLOBAL.LWR.requiredModules.push('lwr/loader/v/0_22_10');
482
579
  }
483
580
  new LoaderShim(GLOBAL);
484
581
 
485
582
  })();
486
583
 
487
- LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict';
584
+ LWR.define('lwr/loader/v/0_22_10', ['exports'], (function (exports) { 'use strict';
488
585
 
489
586
  const templateRegex = /\{([0-9]+)\}/g;
490
587
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -639,7 +736,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
639
736
  level: 0,
640
737
  message: 'Cannot import a blob URL',
641
738
  });
642
- Object.freeze({
739
+ const NO_IMPORT_TRANSPORT = Object.freeze({
643
740
  code: 3025,
644
741
  level: 0,
645
742
  message: 'Cannot dynamically import "transport" with importer "{0}"',
@@ -2089,9 +2186,10 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
2089
2186
 
2090
2187
 
2091
2188
 
2189
+
2092
2190
  /**
2093
2191
  * Validates that the given module id is not one of the forbidden dynamic import specifiers.
2094
- * Throws LoaderError for: lwc, the LWR loader, and blob URLs.
2192
+ * Throws LoaderError for: lwc, the LWR loader, transport/webruntime/transport, and blob URLs.
2095
2193
  *
2096
2194
  * @param id - Module identifier or URL
2097
2195
  * @param importer - Versioned specifier of the module importer (for error reporting)
@@ -2104,7 +2202,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
2104
2202
  loaderSpecifier,
2105
2203
  errors,
2106
2204
  ) {
2107
- const { LoaderError, NO_IMPORT_LWC, NO_IMPORT_LOADER, NO_BLOB_IMPORT } = errors;
2205
+ const { LoaderError, NO_IMPORT_LWC, NO_IMPORT_LOADER, NO_IMPORT_TRANSPORT, NO_BLOB_IMPORT } = errors;
2108
2206
 
2109
2207
  // Throw an error if the specifier is "lwc" or a versioned lwc specifier
2110
2208
  // Dynamic import of LWC APIs is not allowed
@@ -2120,6 +2218,18 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
2120
2218
  throw new LoaderError(NO_IMPORT_LOADER, [_nullishCoalesce(importer, () => ( 'unknown'))]);
2121
2219
  }
2122
2220
 
2221
+ // Throw an error if the specifier is "transport" or "webruntime/transport" (or versioned)
2222
+ // Dynamic import of transport exposes unsandboxed fetch, bypassing LWS
2223
+ // Reference: Hackforce report HF-3393
2224
+ if (
2225
+ id === 'transport' ||
2226
+ id.startsWith('transport/v/') ||
2227
+ id === 'webruntime/transport' ||
2228
+ id.startsWith('webruntime/transport/v/')
2229
+ ) {
2230
+ throw new LoaderError(NO_IMPORT_TRANSPORT, [_nullishCoalesce(importer, () => ( 'unknown'))]);
2231
+ }
2232
+
2123
2233
  // Throw an error if the specifier is a blob URL (case-insensitive check)
2124
2234
  if (id.toLowerCase().startsWith('blob:')) {
2125
2235
  throw new LoaderError(NO_BLOB_IMPORT);
@@ -2231,6 +2341,7 @@ LWR.define('lwr/loader/v/0_22_8', ['exports'], (function (exports) { 'use strict
2231
2341
  LoaderError,
2232
2342
  NO_IMPORT_LWC,
2233
2343
  NO_IMPORT_LOADER,
2344
+ NO_IMPORT_TRANSPORT,
2234
2345
  NO_BLOB_IMPORT,
2235
2346
  });
2236
2347
  return this.registry.load(id, importer);
@@ -20,7 +20,7 @@ function getConfiguration(options) {
20
20
  : `${ORIGIN}${PREFIX}/module/${format}/${POSTFIX}/mi/`;
21
21
 
22
22
  // Component specifiers and URIs
23
- const BOOT_MODULE = `lwr/everywhere${format === 'esm' ? 'Esm' : 'Amd'}/v/0_22_8`;
23
+ const BOOT_MODULE = `lwr/everywhere${format === 'esm' ? 'Esm' : 'Amd'}/v/0_22_10`;
24
24
  const BOOT_URI = `${ENDPOINT}${encodeURIComponent(BOOT_MODULE)}/latest${debug ? '?debug' : ''}`;
25
25
 
26
26
  // Client Bootstrap Config
@@ -52,7 +52,7 @@ function getConfiguration(options) {
52
52
  * SPDX-License-Identifier: MIT
53
53
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
54
54
  */
55
- /* LWR Module Loader v0.22.8 */
55
+ /* LWR Module Loader v0.22.10 */
56
56
  const templateRegex = /\{([0-9]+)\}/g;
57
57
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
58
  function templateString(template, args) {
@@ -206,7 +206,7 @@ const NO_BLOB_IMPORT = Object.freeze({
206
206
  level: 0,
207
207
  message: 'Cannot import a blob URL',
208
208
  });
209
- Object.freeze({
209
+ const NO_IMPORT_TRANSPORT = Object.freeze({
210
210
  code: 3025,
211
211
  level: 0,
212
212
  message: 'Cannot dynamically import "transport" with importer "{0}"',
@@ -1657,9 +1657,10 @@ function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else {
1657
1657
 
1658
1658
 
1659
1659
 
1660
+
1660
1661
  /**
1661
1662
  * Validates that the given module id is not one of the forbidden dynamic import specifiers.
1662
- * Throws LoaderError for: lwc, the LWR loader, and blob URLs.
1663
+ * Throws LoaderError for: lwc, the LWR loader, transport/webruntime/transport, and blob URLs.
1663
1664
  *
1664
1665
  * @param id - Module identifier or URL
1665
1666
  * @param importer - Versioned specifier of the module importer (for error reporting)
@@ -1672,7 +1673,7 @@ function validateLoadSpecifier(
1672
1673
  loaderSpecifier,
1673
1674
  errors,
1674
1675
  ) {
1675
- const { LoaderError, NO_IMPORT_LWC, NO_IMPORT_LOADER, NO_BLOB_IMPORT } = errors;
1676
+ const { LoaderError, NO_IMPORT_LWC, NO_IMPORT_LOADER, NO_IMPORT_TRANSPORT, NO_BLOB_IMPORT } = errors;
1676
1677
 
1677
1678
  // Throw an error if the specifier is "lwc" or a versioned lwc specifier
1678
1679
  // Dynamic import of LWC APIs is not allowed
@@ -1688,6 +1689,18 @@ function validateLoadSpecifier(
1688
1689
  throw new LoaderError(NO_IMPORT_LOADER, [_nullishCoalesce(importer, () => ( 'unknown'))]);
1689
1690
  }
1690
1691
 
1692
+ // Throw an error if the specifier is "transport" or "webruntime/transport" (or versioned)
1693
+ // Dynamic import of transport exposes unsandboxed fetch, bypassing LWS
1694
+ // Reference: Hackforce report HF-3393
1695
+ if (
1696
+ id === 'transport' ||
1697
+ id.startsWith('transport/v/') ||
1698
+ id === 'webruntime/transport' ||
1699
+ id.startsWith('webruntime/transport/v/')
1700
+ ) {
1701
+ throw new LoaderError(NO_IMPORT_TRANSPORT, [_nullishCoalesce(importer, () => ( 'unknown'))]);
1702
+ }
1703
+
1691
1704
  // Throw an error if the specifier is a blob URL (case-insensitive check)
1692
1705
  if (id.toLowerCase().startsWith('blob:')) {
1693
1706
  throw new LoaderError(NO_BLOB_IMPORT);
@@ -1799,6 +1812,7 @@ class Loader {
1799
1812
  LoaderError,
1800
1813
  NO_IMPORT_LWC,
1801
1814
  NO_IMPORT_LOADER,
1815
+ NO_IMPORT_TRANSPORT,
1802
1816
  NO_BLOB_IMPORT,
1803
1817
  });
1804
1818
  return this.registry.load(id, importer);
@@ -1855,7 +1869,7 @@ const { bootstrapModule, endpoints, baseUrl, imports, index } = configuration;
1855
1869
 
1856
1870
  // Initialize the AMD loader (its code is bundled into the LWR Everywhere module)
1857
1871
  const loader = new Loader({ endpoints, baseUrl });
1858
- loader.define('lwr/loader/v/0_22_8', ['exports'], (exports) => {
1872
+ loader.define('lwr/loader/v/0_22_10', ['exports'], (exports) => {
1859
1873
  Object.assign(exports, {
1860
1874
  define: loader.define.bind(loader),
1861
1875
  load: loader.load.bind(loader),
@@ -1865,12 +1879,12 @@ await loader.registerImportMappings({ imports, index }, [bootstrapModule]);
1865
1879
  (globalThis ).LWR = Object.freeze({ define: loader.define.bind(loader) });
1866
1880
 
1867
1881
  // Define preload modules (ie: ABS, vault, etc) BEFORE loading them
1868
- LWR.define('lwr/everywhereAmd/v/0_22_8', ['exports', 'lwr/vault/v/0_22_8'], (function (exports, _0_22_8) {
1882
+ LWR.define('lwr/everywhereAmd/v/0_22_10', ['exports', 'lwr/vault/v/0_22_10'], (function (exports, _0_22_10) {
1869
1883
  // IMPORTANT: Do not add any static imports to this file that are not bundled with the amd-client
1870
1884
 
1871
1885
  // Do an OAuthed fetch
1872
1886
  async function authFetch(url, accept = 'javascript') {
1873
- const authInfo = _0_22_8.getAuthInfo();
1887
+ const authInfo = _0_22_10.getAuthInfo();
1874
1888
  if (authInfo) {
1875
1889
  return fetch(url, {
1876
1890
  headers: {
@@ -1919,7 +1933,7 @@ LWR.define('lwr/everywhereAmd/v/0_22_8', ['exports', 'lwr/vault/v/0_22_8'], (fun
1919
1933
  function authenticate(authInfo) {
1920
1934
  // Put OAuth info into the vault
1921
1935
  if (authInfo) {
1922
- _0_22_8.setAuthInfo(authInfo);
1936
+ _0_22_10.setAuthInfo(authInfo);
1923
1937
  }
1924
1938
  }
1925
1939
 
@@ -1929,7 +1943,7 @@ LWR.define('lwr/everywhereAmd/v/0_22_8', ['exports', 'lwr/vault/v/0_22_8'], (fun
1929
1943
  Object.defineProperty(exports, '__esModule', { value: true });
1930
1944
 
1931
1945
  }));
1932
- LWR.define('lwr/vault/v/0_22_8', ['exports'], (function (exports) {
1946
+ LWR.define('lwr/vault/v/0_22_10', ['exports'], (function (exports) {
1933
1947
  // Credential vault for storing setters and subscribers for OAuth info
1934
1948
  // This module is a SINGLETON and must be excluded from ESM bundling
1935
1949
 
@@ -1953,7 +1967,7 @@ LWR.define('lwr/vault/v/0_22_8', ['exports'], (function (exports) {
1953
1967
 
1954
1968
  // Set up the AMD loader hooks for OAuth
1955
1969
  const { initAmd, authenticate } = await loader.load(bootstrapModule);
1956
- initAmd(loader.services, _optionalChain([endpoints, 'optionalAccess', _ => _.uris, 'access', _2 => _2.mapping]), '0_22_8');
1970
+ initAmd(loader.services, _optionalChain([endpoints, 'optionalAccess', _ => _.uris, 'access', _2 => _2.mapping]), '0_22_10');
1957
1971
 
1958
1972
  // Wrap the createComponent API to allow proper ordering of module definitions:
1959
1973
  // 1. LWRE module bundle (this): lwr/loader, lwr/everywhereAmd, lwr/vault