@lwrjs/everywhere 0.19.2 → 0.19.4
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.
- package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/c451e084d338a570d9aad13455e86c84/config.js +12 -0
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/{0_19_2 → 0_19_4}/s/3aba11034f11c8d5598c93bfca4d4690/@lwrjs_app-service_amd-bootstrap_module_amd.js +5 -5
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_19_2 → 0_19_4}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -3
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_19_2 → 0_19_4}/s/ba081ae41570981325062377381a1ea2/lwr_init.js +19 -19
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_19_2/s/486cfdfb5e8f204e591c8b3c4510c370 → 0_19_4/s/ed93ff3806f0c56dc0ca12920930ac95}/lwr_loader.js +74 -30
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_19_2 → 0_19_4}/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_19_2 → 0_19_4}/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_19_2 → 0_19_4}/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_19_2 → 0_19_4}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_19_2 → 0_19_4}/lwr-error-shim.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_19_2 → 0_19_4}/lwr-loader-shim.bundle.js +76 -40
- package/build/assets/amd/lwr-everywhere-debug.js +78 -42
- package/build/assets/amd/lwr-everywhere-min.js +2 -2
- package/build/assets/amd/lwr-everywhere.js +78 -42
- package/build/assets/core/lwr-everywhere-debug.js +74 -38
- package/build/assets/core/lwr-everywhere-min.js +2 -2
- package/build/assets/core/lwr-everywhere.js +74 -38
- package/build/assets/esm/lwr-everywhere-debug.js +1 -1
- package/build/assets/esm/lwr-everywhere-min.js +1 -1
- package/build/assets/esm/lwr-everywhere.js +1 -1
- package/package.json +7 -7
- package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/9a344f14124d83f47dc344d08a68b823/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_19_4","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_19_4/s/3aba11034f11c8d5598c93bfca4d4690/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_19_4"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_19_4/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js":["lwr/preInit/v/0_19_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_19_4/s/ba081ae41570981325062377381a1ea2/lwr_init.js":["lwr/init/v/0_19_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_19_4/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.js":["lwr/metrics/v/0_19_4"],"/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_19_4/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_19_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_19_4/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_19_4"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_19_4":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_19_4/s/3aba11034f11c8d5598c93bfca4d4690/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_19_4/s/7d064ec3a80dbbccaa4845ea5eaef125/lwr_preInit.js","lwr/init/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_19_4/s/ba081ae41570981325062377381a1ea2/lwr_init.js","lwr/metrics/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_19_4/s/fb8c5dd340c69fdf7ded52d3eba633b9/lwr_metrics.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_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_19_4/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_19_4/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_19_4"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_19_4"],"preloadModules":["lwr/preInit/v/0_19_4","lwr/init/v/0_19_4","lwr/metrics/v/0_19_4","lwc/v/8_20_1","lwr/everywhereAmd/v/0_19_4"],"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_19_4/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js":["lwr/profiler/v/0_19_4"],"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_19_4/s/ed93ff3806f0c56dc0ca12920930ac95/lwr_loader.js":["lwr/loader/v/0_19_4"]})
|
|
11
|
+
if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
|
|
12
|
+
Object.assign(globalThis.LWR.index, {"lwr/profiler/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_19_4/s/9f74c8370534ce02c6e7637abdcffedf/lwr_profiler.js","lwr/loader/v/0_19_4":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_19_4/s/ed93ff3806f0c56dc0ca12920930ac95/lwr_loader.js"})
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/
|
|
1
|
+
LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_19_4', ['lwr/loader/v/0_19_4', 'lwr/preInit/v/0_19_4', 'lwr/init/v/0_19_4'], (function (_0_19_4$2, _0_19_4, _0_19_4$1) { 'use strict';
|
|
2
2
|
|
|
3
|
-
const clientBootstrapConfig =
|
|
3
|
+
const clientBootstrapConfig = _0_19_4.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 =
|
|
9
|
-
const { default: Ctor } = await
|
|
8
|
+
const element = _0_19_4$1.toKebabCase(rootSpecifier);
|
|
9
|
+
const { default: Ctor } = await _0_19_4$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_19_4');
|
|
10
10
|
return [element, Ctor];
|
|
11
11
|
})).then((rootModules) => {
|
|
12
|
-
return
|
|
12
|
+
return _0_19_4$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/
|
|
1
|
+
LWR.define('lwr/everywhereAmd/v/0_19_4', ['exports', 'lwr/vault/v/0_19_4'], (function (exports, _0_19_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 =
|
|
7
|
+
const authInfo = _0_19_4.getAuthInfo();
|
|
8
8
|
if (authInfo) {
|
|
9
9
|
return fetch(url, {
|
|
10
10
|
headers: {
|
|
@@ -53,7 +53,7 @@ LWR.define('lwr/everywhereAmd/v/0_19_2', ['exports', 'lwr/vault/v/0_19_2'], (fun
|
|
|
53
53
|
function authenticate(authInfo) {
|
|
54
54
|
// Put OAuth info into the vault
|
|
55
55
|
if (authInfo) {
|
|
56
|
-
|
|
56
|
+
_0_19_4.setAuthInfo(authInfo);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/init/v/
|
|
1
|
+
LWR.define('lwr/init/v/0_19_4', ['exports', 'lwr/metrics/v/0_19_4', 'lwr/profiler/v/0_19_4', 'lwc/v/8_20_1'], (function (exports, _0_19_4$1, _0_19_4, _8_20_1) { 'use strict';
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line lwr/only-allowed-type-imports
|
|
4
4
|
|
|
@@ -76,13 +76,13 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
76
76
|
function init(rootModules, serverData = {}) {
|
|
77
77
|
// eslint-disable-next-line lwr/no-unguarded-apis
|
|
78
78
|
if (typeof globalThis.customElements === 'undefined' || typeof globalThis.document === 'undefined') {
|
|
79
|
-
|
|
80
|
-
id:
|
|
79
|
+
_0_19_4.logOperationStart({
|
|
80
|
+
id: _0_19_4$1.BOOTSTRAP_END
|
|
81
81
|
});
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
id:
|
|
84
|
+
_0_19_4.logOperationStart({
|
|
85
|
+
id: _0_19_4$1.INIT
|
|
86
86
|
});
|
|
87
87
|
(async () => {
|
|
88
88
|
let index = 0;
|
|
@@ -100,8 +100,8 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
100
100
|
// initialize and inject the root module into the LWR Root or DOM if it is missing
|
|
101
101
|
// eslint-disable-next-line lwr/no-unguarded-apis
|
|
102
102
|
if (!document.body.querySelector(elementName)) {
|
|
103
|
-
|
|
104
|
-
id:
|
|
103
|
+
_0_19_4.logOperationStart({
|
|
104
|
+
id: _0_19_4$1.INIT_MODULE,
|
|
105
105
|
specifier,
|
|
106
106
|
specifierIndex
|
|
107
107
|
});
|
|
@@ -112,8 +112,8 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
112
112
|
const container = document.querySelector('[lwr-root]');
|
|
113
113
|
// eslint-disable-next-line lwr/no-unguarded-apis
|
|
114
114
|
container ? container.appendChild(component) : document.body.appendChild(component);
|
|
115
|
-
|
|
116
|
-
id:
|
|
115
|
+
_0_19_4.logOperationEnd({
|
|
116
|
+
id: _0_19_4$1.INIT_MODULE,
|
|
117
117
|
specifier,
|
|
118
118
|
specifierIndex,
|
|
119
119
|
metadata: {
|
|
@@ -127,8 +127,8 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
127
127
|
// eslint-disable-next-line lwr/no-unguarded-apis
|
|
128
128
|
const elements = document.querySelectorAll(elementName);
|
|
129
129
|
for (const element of elements) {
|
|
130
|
-
|
|
131
|
-
id:
|
|
130
|
+
_0_19_4.logOperationStart({
|
|
131
|
+
id: _0_19_4$1.INIT_MODULE,
|
|
132
132
|
specifier,
|
|
133
133
|
specifierIndex
|
|
134
134
|
});
|
|
@@ -137,8 +137,8 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
137
137
|
// hydrate SSR'd components
|
|
138
138
|
if (propsId) {
|
|
139
139
|
hydrateComponentProxy(element, ctor, serverData[propsId] || {});
|
|
140
|
-
|
|
141
|
-
id:
|
|
140
|
+
_0_19_4.logOperationEnd({
|
|
141
|
+
id: _0_19_4$1.INIT_MODULE,
|
|
142
142
|
specifier,
|
|
143
143
|
specifierIndex,
|
|
144
144
|
metadata: {
|
|
@@ -176,8 +176,8 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
176
176
|
if (parent) {
|
|
177
177
|
parent.replaceChild(component, element);
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
id:
|
|
179
|
+
_0_19_4.logOperationEnd({
|
|
180
|
+
id: _0_19_4$1.INIT_MODULE,
|
|
181
181
|
specifier,
|
|
182
182
|
specifierIndex,
|
|
183
183
|
metadata: {
|
|
@@ -187,11 +187,11 @@ LWR.define('lwr/init/v/0_19_2', ['exports', 'lwr/metrics/v/0_19_2', 'lwr/profile
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
})();
|
|
190
|
-
|
|
191
|
-
id:
|
|
190
|
+
_0_19_4.logOperationEnd({
|
|
191
|
+
id: _0_19_4$1.INIT
|
|
192
192
|
});
|
|
193
|
-
|
|
194
|
-
id:
|
|
193
|
+
_0_19_4.logOperationStart({
|
|
194
|
+
id: _0_19_4$1.BOOTSTRAP_END
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/loader/v/
|
|
1
|
+
LWR.define('lwr/loader/v/0_19_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_19_2', ['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.19.
|
|
9
|
+
/* LWR Module Loader v0.19.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) {
|
|
@@ -657,7 +657,7 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
657
657
|
// swallow
|
|
658
658
|
}
|
|
659
659
|
const trusted = createPolicy('trusted', policyOptions);
|
|
660
|
-
/*! version: 0.
|
|
660
|
+
/*! version: 0.25.3 */
|
|
661
661
|
|
|
662
662
|
/* global console,process */
|
|
663
663
|
|
|
@@ -975,60 +975,104 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
975
975
|
return this.resolver;
|
|
976
976
|
}
|
|
977
977
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
978
|
+
/**
|
|
979
|
+
* Gets or creates a module record for the given resolved ID and original ID.
|
|
980
|
+
*
|
|
981
|
+
* This function handles the complex logic of module resolution and ensures that:
|
|
982
|
+
* 1. Modules loaded via different paths (aliases, direct specifiers, URLs) return the same instance
|
|
983
|
+
* 2. Bundle URLs are properly resolved to their final specifier names after instantiation
|
|
984
|
+
* 3. Alias mappings are maintained for future lookups
|
|
985
|
+
*
|
|
986
|
+
* @param resolvedId - The resolved module identifier (could be a URL or specifier)
|
|
987
|
+
* @param originalId - The original module specifer that was requested
|
|
988
|
+
* @returns Promise<ModuleRecord> - The module record for the module
|
|
989
|
+
*/
|
|
990
|
+
async getModuleRecord(resolvedId, originalId) {
|
|
991
|
+
// Step 1: Check if we already have a module record for the resolved ID
|
|
992
|
+
const existingRecord = this.moduleRegistry.get(resolvedId);
|
|
993
|
+
if (existingRecord) {
|
|
994
|
+
if (isUrl(resolvedId)) {
|
|
995
|
+
// Special case: The resolved ID is a URL (likely a bundle URL)
|
|
996
|
+
// We need to wait for instantiation to complete, then re-resolve to get the final specifier
|
|
997
|
+
const moduleDef = await existingRecord.instantiation;
|
|
998
|
+
const reResolvedId = await this.resolve(originalId);
|
|
999
|
+
|
|
1000
|
+
// If the re-resolved ID is still a URL OR matches the module definition name,
|
|
1001
|
+
// then this is an internally mapped module (e.g., bundle -> specifier)
|
|
1002
|
+
if (isUrl(reResolvedId) || moduleDef.name === reResolvedId) {
|
|
1003
|
+
// Store the alias mapping and return the existing record
|
|
1004
|
+
this.storeModuleAlias(originalId, reResolvedId);
|
|
1005
|
+
return existingRecord;
|
|
1006
|
+
} else {
|
|
1007
|
+
// The re-resolved ID is now a specifier, check if we have a record for it
|
|
1008
|
+
resolvedId = reResolvedId;
|
|
1009
|
+
const reExistingRecord = this.moduleRegistry.get(resolvedId);
|
|
1010
|
+
if (reExistingRecord) {
|
|
1011
|
+
// Found a record for the specifier, store alias and return it
|
|
1012
|
+
this.storeModuleAlias(originalId, reResolvedId);
|
|
1013
|
+
return reExistingRecord;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
} else if (existingRecord) {
|
|
1017
|
+
// Simple case: resolved ID is a specifier and we have a record for it
|
|
1018
|
+
this.storeModuleAlias(originalId, resolvedId);
|
|
1019
|
+
return existingRecord;
|
|
1020
|
+
}
|
|
984
1021
|
}
|
|
985
1022
|
|
|
986
|
-
// Check if
|
|
987
|
-
if (resolvedId !==
|
|
988
|
-
const alias = this.aliases.get(
|
|
1023
|
+
// Step 2: Check if the original ID is a known alias that maps to an existing module
|
|
1024
|
+
if (resolvedId !== originalId) {
|
|
1025
|
+
const alias = this.aliases.get(originalId);
|
|
989
1026
|
if (alias) {
|
|
990
1027
|
const aliasedModule = this.moduleRegistry.get(alias);
|
|
991
1028
|
if (aliasedModule) {
|
|
1029
|
+
// Found an existing module via alias, return it
|
|
992
1030
|
return aliasedModule;
|
|
993
1031
|
}
|
|
994
1032
|
}
|
|
995
1033
|
}
|
|
996
|
-
return moduleRecord;
|
|
997
|
-
}
|
|
998
|
-
async getModuleRecord(resolvedId, id) {
|
|
999
|
-
// Look for an existing record
|
|
1000
|
-
const existingRecord = this.getExistingModuleRecord(resolvedId, id);
|
|
1001
|
-
if (existingRecord) {
|
|
1002
|
-
// return existing
|
|
1003
|
-
return existingRecord;
|
|
1004
|
-
}
|
|
1005
1034
|
|
|
1006
|
-
//
|
|
1007
|
-
const instantiation = this.getModuleDef(resolvedId,
|
|
1035
|
+
// Step 3: No existing record found, create a new module record
|
|
1036
|
+
const instantiation = this.getModuleDef(resolvedId, originalId);
|
|
1037
|
+
|
|
1038
|
+
// Create dependency records for all module dependencies
|
|
1008
1039
|
const dependencyRecords = instantiation.then(moduleDef => {
|
|
1009
1040
|
const dependencies = moduleDef.dependencies || [];
|
|
1010
|
-
|
|
1041
|
+
|
|
1042
|
+
// Map dependencies to module records, filtering out 'exports' and 'require'
|
|
1011
1043
|
const filtered = dependencies.map(dep => {
|
|
1012
1044
|
if (dep === 'exports') {
|
|
1013
|
-
return;
|
|
1045
|
+
return; // 'exports' is a special AMD dependency, not a real module
|
|
1014
1046
|
}
|
|
1015
|
-
invariant(dep !== 'require', NO_AMD_REQUIRE);
|
|
1047
|
+
invariant(dep !== 'require', NO_AMD_REQUIRE); // 'require' is not allowed
|
|
1016
1048
|
return this.getModuleDependencyRecord.call(this, dep);
|
|
1017
1049
|
}).filter(depRecord => depRecord !== undefined);
|
|
1018
1050
|
return Promise.all(filtered);
|
|
1019
1051
|
});
|
|
1052
|
+
|
|
1053
|
+
// Create the new module record
|
|
1020
1054
|
const newModuleRecord = {
|
|
1021
1055
|
id: resolvedId,
|
|
1056
|
+
// Use resolved ID as the record identifier
|
|
1057
|
+
originalId: originalId,
|
|
1058
|
+
// Keep track of the original requested ID
|
|
1022
1059
|
module: Object.create(null),
|
|
1060
|
+
// Empty object for module exports
|
|
1023
1061
|
dependencyRecords,
|
|
1062
|
+
// Promise for dependency module records
|
|
1024
1063
|
instantiation,
|
|
1064
|
+
// Promise for module definition
|
|
1025
1065
|
evaluated: false,
|
|
1026
|
-
|
|
1066
|
+
// Track if module has been evaluated
|
|
1067
|
+
evaluationPromise: null // Promise for module evaluation
|
|
1027
1068
|
};
|
|
1028
|
-
this.moduleRegistry.set(resolvedId, newModuleRecord);
|
|
1029
|
-
this.storeModuleAlias(id, resolvedId);
|
|
1030
1069
|
|
|
1031
|
-
//
|
|
1070
|
+
// Store the module record and create alias mapping
|
|
1071
|
+
this.moduleRegistry.set(resolvedId, newModuleRecord);
|
|
1072
|
+
if (resolvedId !== originalId) {
|
|
1073
|
+
this.storeModuleAlias(originalId, resolvedId);
|
|
1074
|
+
}
|
|
1075
|
+
// Wait for dependencies to resolve before returning the module record
|
|
1032
1076
|
return dependencyRecords.then(() => newModuleRecord);
|
|
1033
1077
|
}
|
|
1034
1078
|
storeModuleAlias(aliasId, resolvedId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/preInit/v/
|
|
1
|
+
LWR.define('lwr/preInit/v/0_19_4', ['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/vault/v/
|
|
1
|
+
LWR.define('lwr/vault/v/0_19_4', ['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.19.
|
|
7
|
+
/* LWR Error Shim v0.19.4 */
|
|
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.19.
|
|
7
|
+
/* LWR Module Loader Shim v0.19.4 */
|
|
8
8
|
(function () {
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
// Parse configuration
|
|
214
214
|
this.global = global;
|
|
215
215
|
this.config = global.LWR ;
|
|
216
|
-
this.loaderSpecifier = 'lwr/loader/v/
|
|
216
|
+
this.loaderSpecifier = 'lwr/loader/v/0_19_4';
|
|
217
217
|
|
|
218
218
|
// Set up error handler
|
|
219
219
|
this.errorHandler = this.config.onError ;
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
const exporter = (exports) => {
|
|
365
365
|
Object.assign(exports, { logOperationStart, logOperationEnd });
|
|
366
366
|
};
|
|
367
|
-
define('lwr/profiler/v/
|
|
367
|
+
define('lwr/profiler/v/0_19_4', ['exports'], exporter);
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
// Set up the application globals, import map, root custom element...
|
|
@@ -456,14 +456,14 @@
|
|
|
456
456
|
// The loader module is ALWAYS required
|
|
457
457
|
const GLOBAL = globalThis ;
|
|
458
458
|
GLOBAL.LWR.requiredModules = GLOBAL.LWR.requiredModules || [];
|
|
459
|
-
if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/
|
|
460
|
-
GLOBAL.LWR.requiredModules.push('lwr/loader/v/
|
|
459
|
+
if (GLOBAL.LWR.requiredModules.indexOf('lwr/loader/v/0_19_4') < 0) {
|
|
460
|
+
GLOBAL.LWR.requiredModules.push('lwr/loader/v/0_19_4');
|
|
461
461
|
}
|
|
462
462
|
new LoaderShim(GLOBAL);
|
|
463
463
|
|
|
464
464
|
})();
|
|
465
465
|
|
|
466
|
-
LWR.define('lwr/loader/v/
|
|
466
|
+
LWR.define('lwr/loader/v/0_19_4', ['exports'], (function (exports) { 'use strict';
|
|
467
467
|
|
|
468
468
|
const templateRegex = /\{([0-9]+)\}/g;
|
|
469
469
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1153,7 +1153,7 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
1153
1153
|
// swallow
|
|
1154
1154
|
}
|
|
1155
1155
|
const trusted = createPolicy('trusted', policyOptions);
|
|
1156
|
-
/*! version: 0.
|
|
1156
|
+
/*! version: 0.25.3 */
|
|
1157
1157
|
|
|
1158
1158
|
/* global console,process */
|
|
1159
1159
|
|
|
@@ -1310,6 +1310,7 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
1310
1310
|
|
|
1311
1311
|
|
|
1312
1312
|
|
|
1313
|
+
|
|
1313
1314
|
|
|
1314
1315
|
|
|
1315
1316
|
class ModuleRegistry {
|
|
@@ -1548,46 +1549,78 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
1548
1549
|
return this.resolver;
|
|
1549
1550
|
}
|
|
1550
1551
|
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1552
|
+
/**
|
|
1553
|
+
* Gets or creates a module record for the given resolved ID and original ID.
|
|
1554
|
+
*
|
|
1555
|
+
* This function handles the complex logic of module resolution and ensures that:
|
|
1556
|
+
* 1. Modules loaded via different paths (aliases, direct specifiers, URLs) return the same instance
|
|
1557
|
+
* 2. Bundle URLs are properly resolved to their final specifier names after instantiation
|
|
1558
|
+
* 3. Alias mappings are maintained for future lookups
|
|
1559
|
+
*
|
|
1560
|
+
* @param resolvedId - The resolved module identifier (could be a URL or specifier)
|
|
1561
|
+
* @param originalId - The original module specifer that was requested
|
|
1562
|
+
* @returns Promise<ModuleRecord> - The module record for the module
|
|
1563
|
+
*/
|
|
1564
|
+
async getModuleRecord(resolvedId, originalId) {
|
|
1565
|
+
// Step 1: Check if we already have a module record for the resolved ID
|
|
1566
|
+
const existingRecord = this.moduleRegistry.get(resolvedId);
|
|
1567
|
+
if (existingRecord) {
|
|
1568
|
+
if (isUrl(resolvedId)) {
|
|
1569
|
+
// Special case: The resolved ID is a URL (likely a bundle URL)
|
|
1570
|
+
// We need to wait for instantiation to complete, then re-resolve to get the final specifier
|
|
1571
|
+
const moduleDef = await existingRecord.instantiation;
|
|
1572
|
+
|
|
1573
|
+
const reResolvedId = await this.resolve(originalId);
|
|
1574
|
+
|
|
1575
|
+
// If the re-resolved ID is still a URL OR matches the module definition name,
|
|
1576
|
+
// then this is an internally mapped module (e.g., bundle -> specifier)
|
|
1577
|
+
if (isUrl(reResolvedId) || moduleDef.name === reResolvedId) {
|
|
1578
|
+
// Store the alias mapping and return the existing record
|
|
1579
|
+
this.storeModuleAlias(originalId, reResolvedId);
|
|
1580
|
+
return existingRecord;
|
|
1581
|
+
} else {
|
|
1582
|
+
// The re-resolved ID is now a specifier, check if we have a record for it
|
|
1583
|
+
resolvedId = reResolvedId;
|
|
1584
|
+
const reExistingRecord = this.moduleRegistry.get(resolvedId);
|
|
1585
|
+
if (reExistingRecord) {
|
|
1586
|
+
// Found a record for the specifier, store alias and return it
|
|
1587
|
+
this.storeModuleAlias(originalId, reResolvedId);
|
|
1588
|
+
return reExistingRecord;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
} else if (existingRecord) {
|
|
1592
|
+
// Simple case: resolved ID is a specifier and we have a record for it
|
|
1593
|
+
this.storeModuleAlias(originalId, resolvedId);
|
|
1594
|
+
return existingRecord;
|
|
1595
|
+
}
|
|
1557
1596
|
}
|
|
1558
1597
|
|
|
1559
|
-
// Check if
|
|
1560
|
-
if (resolvedId !==
|
|
1561
|
-
const alias = this.aliases.get(
|
|
1598
|
+
// Step 2: Check if the original ID is a known alias that maps to an existing module
|
|
1599
|
+
if (resolvedId !== originalId) {
|
|
1600
|
+
const alias = this.aliases.get(originalId);
|
|
1562
1601
|
if (alias) {
|
|
1563
1602
|
const aliasedModule = this.moduleRegistry.get(alias);
|
|
1564
1603
|
if (aliasedModule) {
|
|
1604
|
+
// Found an existing module via alias, return it
|
|
1565
1605
|
return aliasedModule;
|
|
1566
1606
|
}
|
|
1567
1607
|
}
|
|
1568
1608
|
}
|
|
1569
|
-
return moduleRecord;
|
|
1570
|
-
}
|
|
1571
1609
|
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
const existingRecord = this.getExistingModuleRecord(resolvedId, id);
|
|
1575
|
-
if (existingRecord) {
|
|
1576
|
-
// return existing
|
|
1577
|
-
return existingRecord;
|
|
1578
|
-
}
|
|
1610
|
+
// Step 3: No existing record found, create a new module record
|
|
1611
|
+
const instantiation = this.getModuleDef(resolvedId, originalId);
|
|
1579
1612
|
|
|
1580
|
-
// Create
|
|
1581
|
-
const instantiation = this.getModuleDef(resolvedId, id);
|
|
1613
|
+
// Create dependency records for all module dependencies
|
|
1582
1614
|
const dependencyRecords = instantiation.then((moduleDef) => {
|
|
1583
1615
|
const dependencies = moduleDef.dependencies || [];
|
|
1584
|
-
|
|
1616
|
+
|
|
1617
|
+
// Map dependencies to module records, filtering out 'exports' and 'require'
|
|
1585
1618
|
const filtered = dependencies
|
|
1586
1619
|
.map((dep) => {
|
|
1587
1620
|
if (dep === 'exports') {
|
|
1588
|
-
return;
|
|
1621
|
+
return; // 'exports' is a special AMD dependency, not a real module
|
|
1589
1622
|
}
|
|
1590
|
-
invariant(dep !== 'require', NO_AMD_REQUIRE);
|
|
1623
|
+
invariant(dep !== 'require', NO_AMD_REQUIRE); // 'require' is not allowed
|
|
1591
1624
|
return this.getModuleDependencyRecord.call(this, dep);
|
|
1592
1625
|
})
|
|
1593
1626
|
.filter((depRecord) => depRecord !== undefined) ;
|
|
@@ -1595,19 +1628,23 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
1595
1628
|
return Promise.all(filtered);
|
|
1596
1629
|
});
|
|
1597
1630
|
|
|
1631
|
+
// Create the new module record
|
|
1598
1632
|
const newModuleRecord = {
|
|
1599
|
-
id: resolvedId,
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1633
|
+
id: resolvedId, // Use resolved ID as the record identifier
|
|
1634
|
+
originalId: originalId, // Keep track of the original requested ID
|
|
1635
|
+
module: Object.create(null), // Empty object for module exports
|
|
1636
|
+
dependencyRecords, // Promise for dependency module records
|
|
1637
|
+
instantiation, // Promise for module definition
|
|
1638
|
+
evaluated: false, // Track if module has been evaluated
|
|
1639
|
+
evaluationPromise: null, // Promise for module evaluation
|
|
1605
1640
|
};
|
|
1606
1641
|
|
|
1642
|
+
// Store the module record and create alias mapping
|
|
1607
1643
|
this.moduleRegistry.set(resolvedId, newModuleRecord);
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1644
|
+
if (resolvedId !== originalId) {
|
|
1645
|
+
this.storeModuleAlias(originalId, resolvedId);
|
|
1646
|
+
}
|
|
1647
|
+
// Wait for dependencies to resolve before returning the module record
|
|
1611
1648
|
return dependencyRecords.then(() => newModuleRecord);
|
|
1612
1649
|
}
|
|
1613
1650
|
|
|
@@ -1903,7 +1940,6 @@ LWR.define('lwr/loader/v/0_19_2', ['exports'], (function (exports) { 'use strict
|
|
|
1903
1940
|
|
|
1904
1941
|
|
|
1905
1942
|
|
|
1906
|
-
|
|
1907
1943
|
addLoaderPlugin(hooks) {
|
|
1908
1944
|
if (typeof hooks !== 'object') {
|
|
1909
1945
|
throw new LoaderError(INVALID_HOOK);
|