@lwrjs/everywhere 0.21.5 → 0.21.7

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 (23) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/121a212d1c1430305d01594ee3058c1f/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_21_5 → 0_21_7}/s/3aba11034f11c8d5598c93bfca4d4690/@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_21_5 → 0_21_7}/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_21_5 → 0_21_7}/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_21_5/s/57bf8d56d32c292a51a4beacf4ac3058 → 0_21_7/s/730dbe56c23f7b421f45c317e351be6f}/lwr_loader.js +61 -27
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_21_5 → 0_21_7}/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_21_5 → 0_21_7}/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_21_5 → 0_21_7}/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_21_5 → 0_21_7}/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_21_5 → 0_21_7}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_21_5 → 0_21_7}/lwr-error-shim.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_21_5 → 0_21_7}/lwr-loader-shim.bundle.js +72 -32
  13. package/build/assets/amd/lwr-everywhere-debug.js +74 -34
  14. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  15. package/build/assets/amd/lwr-everywhere.js +74 -34
  16. package/build/assets/core/lwr-everywhere-debug.js +70 -30
  17. package/build/assets/core/lwr-everywhere-min.js +2 -2
  18. package/build/assets/core/lwr-everywhere.js +70 -30
  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/package.json +6 -6
  23. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/b1f2427a24e2ccb9dd8f39867dfdf98b/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_21_7","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_21_7/s/3aba11034f11c8d5598c93bfca4d4690/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_21_7/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js":["lwr/preInit/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_21_7/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js":["lwr/init/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_21_7/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js":["lwr/metrics/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fscheduler%2Fv%2F0_21_7/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js":["lwr/scheduler/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F8_20_1/s/13f9f9934fd3a3c9f52760160b464d00/lwc.js":["lwc/v/8_20_1"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_21_7/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_21_7/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_21_7"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_7":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_21_7/s/3aba11034f11c8d5598c93bfca4d4690/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_21_7/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js","lwr/init/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_21_7/s/c5c8bdc0e87baf3d6b68b0603d670664/lwr_init.js","lwr/metrics/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_21_7/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js","lwr/scheduler/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fscheduler%2Fv%2F0_21_7/s/fd3fe53248b540ca046ead92862ca496/lwr_scheduler.js","lwc/v/8_20_1":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F8_20_1/s/13f9f9934fd3a3c9f52760160b464d00/lwc.js","lwr/everywhereAmd/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_21_7/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_21_7/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_21_7"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_7"],"preloadModules":["lwr/preInit/v/0_21_7","lwr/init/v/0_21_7","lwr/metrics/v/0_21_7","lwr/scheduler/v/0_21_7","lwc/v/8_20_1","lwr/everywhereAmd/v/0_21_7"],"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_21_7/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js":["lwr/profiler/v/0_21_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_21_7/s/730dbe56c23f7b421f45c317e351be6f/lwr_loader.js":["lwr/loader/v/0_21_7"]})
11
+ if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
12
+ Object.assign(globalThis.LWR.index, {"lwr/profiler/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_21_7/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js","lwr/loader/v/0_21_7":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_21_7/s/730dbe56c23f7b421f45c317e351be6f/lwr_loader.js"})
@@ -1,15 +1,15 @@
1
- LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_5', ['lwr/loader/v/0_21_5', 'lwr/preInit/v/0_21_5', 'lwr/init/v/0_21_5'], (function (_0_21_5$2, _0_21_5, _0_21_5$1) { 'use strict';
1
+ LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_7', ['lwr/loader/v/0_21_7', 'lwr/preInit/v/0_21_7', 'lwr/init/v/0_21_7'], (function (_0_21_7$2, _0_21_7, _0_21_7$1) { 'use strict';
2
2
 
3
- const clientBootstrapConfig = _0_21_5.getClientBootstrapConfig();
3
+ const clientBootstrapConfig = _0_21_7.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_21_5$1.toKebabCase(rootSpecifier);
9
- const { default: Ctor } = await _0_21_5$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_5');
8
+ const element = _0_21_7$1.toKebabCase(rootSpecifier);
9
+ const { default: Ctor } = await _0_21_7$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_21_7');
10
10
  return [element, Ctor];
11
11
  })).then((rootModules) => {
12
- return _0_21_5$1.init(rootModules, serverData);
12
+ return _0_21_7$1.init(rootModules, serverData);
13
13
  }).then(() => {
14
14
  globalThis?.lwcRuntimeFlags?.ENABLE_WIRE_SYNC_EMIT &&
15
15
  (globalThis.lwcRuntimeFlags = {
@@ -1,10 +1,10 @@
1
- LWR.define('lwr/everywhereAmd/v/0_21_5', ['exports', 'lwr/vault/v/0_21_5'], (function (exports, _0_21_5) { 'use strict';
1
+ LWR.define('lwr/everywhereAmd/v/0_21_7', ['exports', 'lwr/vault/v/0_21_7'], (function (exports, _0_21_7) { '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_21_5.getAuthInfo();
7
+ const authInfo = _0_21_7.getAuthInfo();
8
8
  if (authInfo) {
9
9
  return fetch(url, {
10
10
  headers: {
@@ -53,7 +53,7 @@ LWR.define('lwr/everywhereAmd/v/0_21_5', ['exports', 'lwr/vault/v/0_21_5'], (fun
53
53
  function authenticate(authInfo) {
54
54
  // Put OAuth info into the vault
55
55
  if (authInfo) {
56
- _0_21_5.setAuthInfo(authInfo);
56
+ _0_21_7.setAuthInfo(authInfo);
57
57
  }
58
58
  }
59
59
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', 'lwr/profiler/v/0_21_5', 'lwr/scheduler/v/0_21_5', 'lwc/v/8_20_1'], (function (exports, _0_21_5$1, _0_21_5, _0_21_5$2, _8_20_1) { 'use strict';
1
+ LWR.define('lwr/init/v/0_21_7', ['exports', 'lwr/metrics/v/0_21_7', 'lwr/profiler/v/0_21_7', 'lwr/scheduler/v/0_21_7', 'lwc/v/8_20_1'], (function (exports, _0_21_7$1, _0_21_7, _0_21_7$2, _8_20_1) { '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_21_5', ['exports', 'lwr/metrics/v/0_21_5', '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_21_5.logOperationStart({
127
- id: _0_21_5$1.BOOTSTRAP_END
126
+ _0_21_7.logOperationStart({
127
+ id: _0_21_7$1.BOOTSTRAP_END
128
128
  });
129
129
  return;
130
130
  }
131
- _0_21_5.logOperationStart({
132
- id: _0_21_5$1.INIT
131
+ _0_21_7.logOperationStart({
132
+ id: _0_21_7$1.INIT
133
133
  });
134
134
  (async () => {
135
135
  let index = 0;
@@ -138,15 +138,15 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', '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_21_5$2.yieldIfNecessary();
141
+ await _0_21_7$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_21_5.logOperationStart({
149
- id: _0_21_5$1.INIT_MODULE,
148
+ _0_21_7.logOperationStart({
149
+ id: _0_21_7$1.INIT_MODULE,
150
150
  specifier,
151
151
  specifierIndex
152
152
  });
@@ -157,8 +157,8 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', '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_21_5.logOperationEnd({
161
- id: _0_21_5$1.INIT_MODULE,
160
+ _0_21_7.logOperationEnd({
161
+ id: _0_21_7$1.INIT_MODULE,
162
162
  specifier,
163
163
  specifierIndex,
164
164
  metadata: {
@@ -172,8 +172,8 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', '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_21_5.logOperationStart({
176
- id: _0_21_5$1.INIT_MODULE,
175
+ _0_21_7.logOperationStart({
176
+ id: _0_21_7$1.INIT_MODULE,
177
177
  specifier,
178
178
  specifierIndex
179
179
  });
@@ -189,8 +189,8 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', 'lwr/profile
189
189
  // hydrate the island immediately
190
190
  hydrateComponentProxy(element, ctor, serverData[propsId] || {});
191
191
  }
192
- _0_21_5.logOperationEnd({
193
- id: _0_21_5$1.INIT_MODULE,
192
+ _0_21_7.logOperationEnd({
193
+ id: _0_21_7$1.INIT_MODULE,
194
194
  specifier,
195
195
  specifierIndex,
196
196
  metadata: {
@@ -228,8 +228,8 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', 'lwr/profile
228
228
  if (parent) {
229
229
  parent.replaceChild(component, element);
230
230
  }
231
- _0_21_5.logOperationEnd({
232
- id: _0_21_5$1.INIT_MODULE,
231
+ _0_21_7.logOperationEnd({
232
+ id: _0_21_7$1.INIT_MODULE,
233
233
  specifier,
234
234
  specifierIndex,
235
235
  metadata: {
@@ -239,11 +239,11 @@ LWR.define('lwr/init/v/0_21_5', ['exports', 'lwr/metrics/v/0_21_5', 'lwr/profile
239
239
  }
240
240
  }
241
241
  })();
242
- _0_21_5.logOperationEnd({
243
- id: _0_21_5$1.INIT
242
+ _0_21_7.logOperationEnd({
243
+ id: _0_21_7$1.INIT
244
244
  });
245
- _0_21_5.logOperationStart({
246
- id: _0_21_5$1.BOOTSTRAP_END
245
+ _0_21_7.logOperationStart({
246
+ id: _0_21_7$1.BOOTSTRAP_END
247
247
  });
248
248
  }
249
249
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/loader/v/0_21_7', ['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_21_5', ['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.21.5 */
9
+ /* LWR Module Loader v0.21.7 */
10
10
  const templateRegex = /\{([0-9]+)\}/g;
11
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
12
  function templateString(template, args) {
@@ -1465,6 +1465,58 @@ LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict
1465
1465
  }
1466
1466
  }
1467
1467
  }
1468
+ function _nullishCoalesce(lhs, rhsFn) {
1469
+ if (lhs != null) {
1470
+ return lhs;
1471
+ } else {
1472
+ return rhsFn();
1473
+ }
1474
+ } /** Error info shape used for load specifier validation (code, message, level). */
1475
+
1476
+ /**
1477
+ * Validates that the given module id is not one of the forbidden dynamic import specifiers.
1478
+ * Throws LoaderError for: lwc, the LWR loader, transport, and blob URLs.
1479
+ *
1480
+ * @param id - Module identifier or URL
1481
+ * @param importer - Versioned specifier of the module importer (for error reporting)
1482
+ * @param loaderSpecifier - The loader module specifier to block (e.g. 'lwr/loader' or 'lwr/loaderLegacy')
1483
+ * @param errors - Error class and message constants from the calling loader
1484
+ */
1485
+ function validateLoadSpecifier(id, importer, loaderSpecifier, errors) {
1486
+ const {
1487
+ LoaderError,
1488
+ NO_IMPORT_LWC,
1489
+ NO_IMPORT_LOADER,
1490
+ NO_IMPORT_TRANSPORT,
1491
+ NO_BLOB_IMPORT
1492
+ } = errors;
1493
+
1494
+ // Throw an error if the specifier is "lwc" or a versioned lwc specifier
1495
+ // Dynamic import of LWC APIs is not allowed
1496
+ // Block both "lwc" and versioned forms like "lwc/v/8_20_1" to prevent bypass attempts
1497
+ // Reference: Hackforce reports HF-1023, HF-1021, HF-1026, HF-1027
1498
+ if (id === 'lwc' || id.startsWith('lwc/v/')) {
1499
+ throw new LoaderError(NO_IMPORT_LWC, [_nullishCoalesce(importer, () => 'unknown')]);
1500
+ }
1501
+
1502
+ // Throw an error if the specifier is the LWR loader or versioned
1503
+ // Nobody should be dynamically importing the LWR loader; it is an app-level API
1504
+ if (id === loaderSpecifier || id.startsWith(`${loaderSpecifier}/v/`)) {
1505
+ throw new LoaderError(NO_IMPORT_LOADER, [_nullishCoalesce(importer, () => 'unknown')]);
1506
+ }
1507
+
1508
+ // Throw an error if the specifier is "transport" or versioned
1509
+ // The transport module provides unsandboxed fetch, which can bypass Lightning Web Security
1510
+ // Reference: Hackforce vulnerability report - LWS bypass through transport module
1511
+ if (id === 'transport' || id.startsWith('transport/v/')) {
1512
+ throw new LoaderError(NO_IMPORT_TRANSPORT, [_nullishCoalesce(importer, () => 'unknown')]);
1513
+ }
1514
+
1515
+ // Throw an error if the specifier is a blob URL (case-insensitive check)
1516
+ if (id.toLowerCase().startsWith('blob:')) {
1517
+ throw new LoaderError(NO_BLOB_IMPORT);
1518
+ }
1519
+ }
1468
1520
 
1469
1521
  /**
1470
1522
  * The LWR loader is inspired and borrows from the algorithms and native browser principles of https://github.com/systemjs/systemjs
@@ -1556,31 +1608,13 @@ LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict
1556
1608
  * @return {Promise<Module>}
1557
1609
  */
1558
1610
  async load(id, importer) {
1559
- // Throw an error if the specifier is "lwc" or a versioned lwc specifier and the importer is defined
1560
- // This indicates a variable dynamic import, which is not allowed for LWC APIs
1561
- // Block both "lwc" and versioned forms like "lwc/v/8_20_1" to prevent bypass attempts
1562
- // Reference: Hackforce reports HF-1023, HF-1021, HF-1026, HF-1027
1563
- if ((id === 'lwc' || id.startsWith('lwc/v/')) && importer !== undefined) {
1564
- throw new LoaderError(NO_IMPORT_LWC, [importer]);
1565
- }
1566
-
1567
- // Throw an error if the specifier is "lwr/loader" or versioned and the importer is defined
1568
- // Nobody should be dynamically importing the LWR loader; it is an app-level API
1569
- if ((id === 'lwr/loader' || id.startsWith('lwr/loader/v/')) && importer !== undefined) {
1570
- throw new LoaderError(NO_IMPORT_LOADER, [importer]);
1571
- }
1572
-
1573
- // Throw an error if the specifier is "transport" or versioned and the importer is defined
1574
- // The transport module provides unsandboxed fetch, which can bypass Lightning Web Security
1575
- // Reference: Hackforce vulnerability report - LWS bypass through transport module
1576
- if ((id === 'transport' || id.startsWith('transport/v/')) && importer !== undefined) {
1577
- throw new LoaderError(NO_IMPORT_TRANSPORT, [importer]);
1578
- }
1579
-
1580
- // Throw an error if the specifier is a blob URL (case-insensitive check)
1581
- if (id.toLowerCase().startsWith('blob:')) {
1582
- throw new LoaderError(NO_BLOB_IMPORT);
1583
- }
1611
+ validateLoadSpecifier(id, importer, 'lwr/loader', {
1612
+ LoaderError,
1613
+ NO_IMPORT_LWC,
1614
+ NO_IMPORT_LOADER,
1615
+ NO_IMPORT_TRANSPORT,
1616
+ NO_BLOB_IMPORT
1617
+ });
1584
1618
  return this.registry.load(id, importer);
1585
1619
  }
1586
1620
 
@@ -1,4 +1,4 @@
1
- LWR.define('lwr/metrics/v/0_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/metrics/v/0_21_7', ['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_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/preInit/v/0_21_7', ['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_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/profiler/v/0_21_7', ['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_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/scheduler/v/0_21_7', ['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_21_5', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwr/vault/v/0_21_7', ['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.21.5 */
7
+ /* LWR Error Shim v0.21.7 */
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.21.5 */
7
+ /* LWR Module Loader Shim v0.21.7 */
8
8
  (function () {
9
9
  'use strict';
10
10
 
@@ -214,7 +214,7 @@
214
214
  // Parse configuration
215
215
  this.global = global;
216
216
  this.config = global.LWR ;
217
- this.loaderSpecifier = 'lwr/loader/v/0_21_5';
217
+ this.loaderSpecifier = 'lwr/loader/v/0_21_7';
218
218
 
219
219
  // Set up error handler
220
220
  this.errorHandler = this.config.onError ;
@@ -377,7 +377,7 @@
377
377
  const exporter = (exports) => {
378
378
  Object.assign(exports, { logOperationStart, logOperationEnd });
379
379
  };
380
- define('lwr/profiler/v/0_21_5', ['exports'], exporter);
380
+ define('lwr/profiler/v/0_21_7', ['exports'], exporter);
381
381
  }
382
382
 
383
383
  // Set up the application globals, import map, root custom element...
@@ -477,14 +477,14 @@
477
477
  // The loader module is ALWAYS required
478
478
  const GLOBAL = globalThis ;
479
479
  GLOBAL.LWR.requiredModules = GLOBAL.LWR.requiredModules || [];
480
- if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/0_21_5') < 0) {
481
- GLOBAL.LWR.requiredModules.push('lwr/loader/v/0_21_5');
480
+ if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/0_21_7') < 0) {
481
+ GLOBAL.LWR.requiredModules.push('lwr/loader/v/0_21_7');
482
482
  }
483
483
  new LoaderShim(GLOBAL);
484
484
 
485
485
  })();
486
486
 
487
- LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict';
487
+ LWR.define('lwr/loader/v/0_21_7', ['exports'], (function (exports) { 'use strict';
488
488
 
489
489
  const templateRegex = /\{([0-9]+)\}/g;
490
490
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2075,6 +2075,65 @@ LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict
2075
2075
  }
2076
2076
  }
2077
2077
 
2078
+ function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }/** Error info shape used for load specifier validation (code, message, level). */
2079
+
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+
2087
+
2088
+
2089
+
2090
+
2091
+
2092
+
2093
+ /**
2094
+ * Validates that the given module id is not one of the forbidden dynamic import specifiers.
2095
+ * Throws LoaderError for: lwc, the LWR loader, transport, and blob URLs.
2096
+ *
2097
+ * @param id - Module identifier or URL
2098
+ * @param importer - Versioned specifier of the module importer (for error reporting)
2099
+ * @param loaderSpecifier - The loader module specifier to block (e.g. 'lwr/loader' or 'lwr/loaderLegacy')
2100
+ * @param errors - Error class and message constants from the calling loader
2101
+ */
2102
+ function validateLoadSpecifier(
2103
+ id,
2104
+ importer,
2105
+ loaderSpecifier,
2106
+ errors,
2107
+ ) {
2108
+ const { LoaderError, NO_IMPORT_LWC, NO_IMPORT_LOADER, NO_IMPORT_TRANSPORT, NO_BLOB_IMPORT } = errors;
2109
+
2110
+ // Throw an error if the specifier is "lwc" or a versioned lwc specifier
2111
+ // Dynamic import of LWC APIs is not allowed
2112
+ // Block both "lwc" and versioned forms like "lwc/v/8_20_1" to prevent bypass attempts
2113
+ // Reference: Hackforce reports HF-1023, HF-1021, HF-1026, HF-1027
2114
+ if (id === 'lwc' || id.startsWith('lwc/v/')) {
2115
+ throw new LoaderError(NO_IMPORT_LWC, [_nullishCoalesce(importer, () => ( 'unknown'))]);
2116
+ }
2117
+
2118
+ // Throw an error if the specifier is the LWR loader or versioned
2119
+ // Nobody should be dynamically importing the LWR loader; it is an app-level API
2120
+ if (id === loaderSpecifier || id.startsWith(`${loaderSpecifier}/v/`)) {
2121
+ throw new LoaderError(NO_IMPORT_LOADER, [_nullishCoalesce(importer, () => ( 'unknown'))]);
2122
+ }
2123
+
2124
+ // Throw an error if the specifier is "transport" or versioned
2125
+ // The transport module provides unsandboxed fetch, which can bypass Lightning Web Security
2126
+ // Reference: Hackforce vulnerability report - LWS bypass through transport module
2127
+ if (id === 'transport' || id.startsWith('transport/v/')) {
2128
+ throw new LoaderError(NO_IMPORT_TRANSPORT, [_nullishCoalesce(importer, () => ( 'unknown'))]);
2129
+ }
2130
+
2131
+ // Throw an error if the specifier is a blob URL (case-insensitive check)
2132
+ if (id.toLowerCase().startsWith('blob:')) {
2133
+ throw new LoaderError(NO_BLOB_IMPORT);
2134
+ }
2135
+ }
2136
+
2078
2137
  /**
2079
2138
  * The LWR loader is inspired and borrows from the algorithms and native browser principles of https://github.com/systemjs/systemjs
2080
2139
  */
@@ -2176,32 +2235,13 @@ LWR.define('lwr/loader/v/0_21_5', ['exports'], (function (exports) { 'use strict
2176
2235
  * @return {Promise<Module>}
2177
2236
  */
2178
2237
  async load(id, importer) {
2179
- // Throw an error if the specifier is "lwc" or a versioned lwc specifier and the importer is defined
2180
- // This indicates a variable dynamic import, which is not allowed for LWC APIs
2181
- // Block both "lwc" and versioned forms like "lwc/v/8_20_1" to prevent bypass attempts
2182
- // Reference: Hackforce reports HF-1023, HF-1021, HF-1026, HF-1027
2183
- if ((id === 'lwc' || id.startsWith('lwc/v/')) && importer !== undefined) {
2184
- throw new LoaderError(NO_IMPORT_LWC, [importer]);
2185
- }
2186
-
2187
- // Throw an error if the specifier is "lwr/loader" or versioned and the importer is defined
2188
- // Nobody should be dynamically importing the LWR loader; it is an app-level API
2189
- if ((id === 'lwr/loader' || id.startsWith('lwr/loader/v/')) && importer !== undefined) {
2190
- throw new LoaderError(NO_IMPORT_LOADER, [importer]);
2191
- }
2192
-
2193
- // Throw an error if the specifier is "transport" or versioned and the importer is defined
2194
- // The transport module provides unsandboxed fetch, which can bypass Lightning Web Security
2195
- // Reference: Hackforce vulnerability report - LWS bypass through transport module
2196
- if ((id === 'transport' || id.startsWith('transport/v/')) && importer !== undefined) {
2197
- throw new LoaderError(NO_IMPORT_TRANSPORT, [importer]);
2198
- }
2199
-
2200
- // Throw an error if the specifier is a blob URL (case-insensitive check)
2201
- if (id.toLowerCase().startsWith('blob:')) {
2202
- throw new LoaderError(NO_BLOB_IMPORT);
2203
- }
2204
-
2238
+ validateLoadSpecifier(id, importer, 'lwr/loader', {
2239
+ LoaderError,
2240
+ NO_IMPORT_LWC,
2241
+ NO_IMPORT_LOADER,
2242
+ NO_IMPORT_TRANSPORT,
2243
+ NO_BLOB_IMPORT,
2244
+ });
2205
2245
  return this.registry.load(id, importer);
2206
2246
  }
2207
2247