@lwrjs/everywhere 0.12.0-alpha.17 → 0.12.0-alpha.19
Sign up to get free protection for your applications and to get access to all the features.
- package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/08723ea0a65554c7a931779934247206/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_12_0-alpha_19/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +14 -0
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{6_2_0/s/99eeb2c6eef76200d6f77e8a9895ea90 → 6_2_1/s/2670f5386c68fa67ae710174187505e9}/lwc.js +252 -53
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/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_12_0-alpha_17 → 0_12_0-alpha_19}/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js +21 -21
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_12_0-alpha_17/s/7d88cdd63afd9a8457f758efa6852edc → 0_12_0-alpha_19/s/bfa35394789428d30613fedf7507d1fd}/lwr_loader.js +132 -126
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/s/274c8343f810353bbad085a79709395f/lwr_metrics.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +1 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/lwr-error-shim.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_12_0-alpha_17 → 0_12_0-alpha_19}/lwr-loader-shim.bundle.js +163 -131
- package/build/assets/amd/lwr-everywhere-debug.js +165 -133
- package/build/assets/amd/lwr-everywhere-min.js +2 -2
- package/build/assets/amd/lwr-everywhere.js +165 -133
- package/build/assets/core/lwr-everywhere-debug.js +161 -129
- package/build/assets/core/lwr-everywhere-min.js +1 -1
- package/build/assets/core/lwr-everywhere.js +161 -129
- 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/34c06e93feddef614c5592d6a251f1e1/config.js +0 -12
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
@@ -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.12.0-alpha.
|
55
|
+
/* LWR Module Loader v0.12.0-alpha.19 */
|
56
56
|
const templateRegex = /\{([0-9]+)\}/g;
|
57
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
58
58
|
function templateString(template, args) {
|
@@ -846,22 +846,13 @@ async function evaluateLoadHook(
|
|
846
846
|
|
847
847
|
|
848
848
|
|
849
|
+
|
850
|
+
|
849
851
|
|
850
852
|
|
851
853
|
|
852
854
|
class ModuleRegistry {
|
853
855
|
|
854
|
-
|
855
|
-
// A registry for named AMD defines containing the *metadata* of AMD module
|
856
|
-
__init() {this.namedDefineRegistry = new Map();}
|
857
|
-
// The evaluated module registry where the module identifier (name or URL?) is the key
|
858
|
-
__init2() {this.moduleRegistry = new Map();}
|
859
|
-
// Aliases of modules in the registry
|
860
|
-
__init3() {this.aliases = new Map();}
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
856
|
|
866
857
|
constructor(config) {ModuleRegistry.prototype.__init.call(this);ModuleRegistry.prototype.__init2.call(this);ModuleRegistry.prototype.__init3.call(this);
|
867
858
|
this.profiler = config.profiler;
|
@@ -871,9 +862,6 @@ class ModuleRegistry {
|
|
871
862
|
);
|
872
863
|
}
|
873
864
|
|
874
|
-
/**
|
875
|
-
* Module import
|
876
|
-
*/
|
877
865
|
async load(id, importer) {
|
878
866
|
const metadata = importer ? { importer } : {};
|
879
867
|
this.profiler.logOperationStart({
|
@@ -881,23 +869,18 @@ class ModuleRegistry {
|
|
881
869
|
specifier: id,
|
882
870
|
metadata,
|
883
871
|
});
|
884
|
-
|
885
872
|
const resolvedId = await this.resolve(id, importer);
|
886
|
-
const moduleRecord = this.getModuleRecord(resolvedId, id);
|
887
|
-
|
873
|
+
const moduleRecord = await this.getModuleRecord(resolvedId, id);
|
888
874
|
if (moduleRecord.evaluated) {
|
889
875
|
return moduleRecord.module;
|
890
876
|
} else {
|
891
877
|
if (!moduleRecord.evaluationPromise) {
|
892
|
-
moduleRecord.evaluationPromise = this.
|
878
|
+
moduleRecord.evaluationPromise = this.topLevelEvaluation(moduleRecord);
|
893
879
|
}
|
894
880
|
return moduleRecord.evaluationPromise;
|
895
881
|
}
|
896
882
|
}
|
897
883
|
|
898
|
-
/**
|
899
|
-
* Resolve id for a module
|
900
|
-
*/
|
901
884
|
async resolve(id, importer) {
|
902
885
|
const parentUrl = this.resolver.getBaseUrl(); // only support baseUrl for now
|
903
886
|
|
@@ -913,7 +896,7 @@ class ModuleRegistry {
|
|
913
896
|
// eslint-disable-next-line no-await-in-loop
|
914
897
|
result = isResponseAPromise(response) ? await response : response;
|
915
898
|
}
|
916
|
-
if (!isValidResolveResponse(result)) {
|
899
|
+
if (!this.isValidResolveResponse(result)) {
|
917
900
|
throw new LoaderError(INVALID_LOADER_SERVICE_RESPONSE);
|
918
901
|
}
|
919
902
|
|
@@ -999,9 +982,6 @@ class ModuleRegistry {
|
|
999
982
|
return this.moduleRegistry.has(id);
|
1000
983
|
}
|
1001
984
|
|
1002
|
-
/**
|
1003
|
-
* Module entry point LWR.define()
|
1004
|
-
*/
|
1005
985
|
define(name, dependencies, exporter) {
|
1006
986
|
const mod = this.namedDefineRegistry.get(name);
|
1007
987
|
// Don't allow redefining a module.
|
@@ -1068,6 +1048,19 @@ class ModuleRegistry {
|
|
1068
1048
|
});
|
1069
1049
|
}
|
1070
1050
|
|
1051
|
+
|
1052
|
+
|
1053
|
+
// A registry for named AMD defines containing the *metadata* of AMD module
|
1054
|
+
__init() {this.namedDefineRegistry = new Map();}
|
1055
|
+
|
1056
|
+
// The evaluated module registry where the module identifier (name or URL?) is the key
|
1057
|
+
__init2() {this.moduleRegistry = new Map();}
|
1058
|
+
|
1059
|
+
// Aliases of modules in the registry
|
1060
|
+
__init3() {this.aliases = new Map();}
|
1061
|
+
|
1062
|
+
|
1063
|
+
|
1071
1064
|
getImportMetadataResolver() {
|
1072
1065
|
return this.resolver;
|
1073
1066
|
}
|
@@ -1093,7 +1086,7 @@ class ModuleRegistry {
|
|
1093
1086
|
return moduleRecord;
|
1094
1087
|
}
|
1095
1088
|
|
1096
|
-
getModuleRecord(resolvedId, id) {
|
1089
|
+
async getModuleRecord(resolvedId, id) {
|
1097
1090
|
// Look for an existing record
|
1098
1091
|
const existingRecord = this.getExistingModuleRecord(resolvedId, id);
|
1099
1092
|
if (existingRecord) {
|
@@ -1101,10 +1094,29 @@ class ModuleRegistry {
|
|
1101
1094
|
return existingRecord;
|
1102
1095
|
}
|
1103
1096
|
|
1097
|
+
// Create a new Module Record
|
1098
|
+
const instantiation = this.getModuleDef(resolvedId, id);
|
1099
|
+
const dependencyRecords = instantiation.then((moduleDef) => {
|
1100
|
+
const dependencies = moduleDef.dependencies || [];
|
1101
|
+
// get dep and filter out exports
|
1102
|
+
const filtered = dependencies
|
1103
|
+
.map((dep) => {
|
1104
|
+
if (dep === 'exports') {
|
1105
|
+
return;
|
1106
|
+
}
|
1107
|
+
invariant(dep !== 'require', NO_AMD_REQUIRE);
|
1108
|
+
return this.getModuleDependencyRecord.call(this, dep);
|
1109
|
+
})
|
1110
|
+
.filter((depRecord) => depRecord !== undefined) ;
|
1111
|
+
|
1112
|
+
return Promise.all(filtered);
|
1113
|
+
});
|
1114
|
+
|
1104
1115
|
const newModuleRecord = {
|
1105
1116
|
id: resolvedId,
|
1106
1117
|
module: Object.create(null),
|
1107
|
-
|
1118
|
+
dependencyRecords,
|
1119
|
+
instantiation,
|
1108
1120
|
evaluated: false,
|
1109
1121
|
evaluationPromise: null,
|
1110
1122
|
};
|
@@ -1112,7 +1124,8 @@ class ModuleRegistry {
|
|
1112
1124
|
this.moduleRegistry.set(resolvedId, newModuleRecord);
|
1113
1125
|
this.storeModuleAlias(id, resolvedId);
|
1114
1126
|
|
1115
|
-
return
|
1127
|
+
// Wait for the dependencies to resolve the return the moduleRecord
|
1128
|
+
return dependencyRecords.then(() => newModuleRecord);
|
1116
1129
|
}
|
1117
1130
|
|
1118
1131
|
storeModuleAlias(aliasId, resolvedId) {
|
@@ -1133,87 +1146,95 @@ class ModuleRegistry {
|
|
1133
1146
|
}
|
1134
1147
|
}
|
1135
1148
|
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
async evaluateDependencies(
|
1140
|
-
dependencies,
|
1141
|
-
evaluationMap,
|
1142
|
-
) {
|
1143
|
-
const exports = {};
|
1144
|
-
const promiseArray = [];
|
1145
|
-
|
1146
|
-
if (dependencies) {
|
1147
|
-
for (const dep of dependencies) {
|
1148
|
-
if (dep === 'exports') {
|
1149
|
-
promiseArray.push(Promise.resolve(exports));
|
1150
|
-
} else {
|
1151
|
-
invariant(dep !== 'require', NO_AMD_REQUIRE);
|
1152
|
-
promiseArray.push(this.evaluateDependent(dep, evaluationMap));
|
1153
|
-
}
|
1154
|
-
}
|
1155
|
-
}
|
1156
|
-
|
1157
|
-
return Promise.all(promiseArray).then((results) => {
|
1158
|
-
const depsMapped = results.filter((result) => result !== undefined);
|
1159
|
-
return { depsMapped, exports };
|
1160
|
-
});
|
1149
|
+
async getModuleDependencyRecord(dependency) {
|
1150
|
+
const resolvedDepId = await this.resolve(dependency);
|
1151
|
+
return this.getModuleRecord(resolvedDepId, dependency);
|
1161
1152
|
}
|
1162
1153
|
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
const handleReturn = (module) => {
|
1170
|
-
if (module) {
|
1171
|
-
return module.__defaultInterop ? module.default : module;
|
1172
|
-
}
|
1173
|
-
throw new LoaderError(FAILED_DEP, [resolvedDepId]);
|
1174
|
-
};
|
1154
|
+
// execute the "top-level code" (the code outside of functions) of a module
|
1155
|
+
async topLevelEvaluation(moduleRecord) {
|
1156
|
+
await this.instantiateAll(moduleRecord, {});
|
1157
|
+
return this.evaluateModule(moduleRecord, {});
|
1158
|
+
}
|
1175
1159
|
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1160
|
+
// Returns a promise when a module and all of it's dependencies have finished instantiation
|
1161
|
+
async instantiateAll(
|
1162
|
+
moduleRecord,
|
1163
|
+
instantiatedMap,
|
1164
|
+
) {
|
1165
|
+
if (!instantiatedMap[moduleRecord.id]) {
|
1166
|
+
instantiatedMap[moduleRecord.id] = true;
|
1167
|
+
const dependencyModuleRecords = await moduleRecord.dependencyRecords;
|
1168
|
+
if (dependencyModuleRecords) {
|
1169
|
+
for (let i = 0; i < dependencyModuleRecords.length; i++) {
|
1170
|
+
const depRecord = dependencyModuleRecords[i];
|
1171
|
+
// eslint-disable-next-line no-await-in-loop
|
1172
|
+
await this.instantiateAll(depRecord, instantiatedMap);
|
1173
|
+
}
|
1190
1174
|
}
|
1191
|
-
return depModuleRecord.evaluationPromise.then((module) => {
|
1192
|
-
return handleReturn(module);
|
1193
|
-
});
|
1194
|
-
} else {
|
1195
|
-
// Otherwise return a dummy circular module wrapper
|
1196
|
-
module = getCircularDependencyWrapper(module);
|
1197
1175
|
}
|
1198
|
-
return handleReturn(module);
|
1199
1176
|
}
|
1200
1177
|
|
1201
1178
|
async evaluateModule(
|
1202
1179
|
moduleRecord,
|
1203
1180
|
evaluationMap,
|
1204
1181
|
) {
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1182
|
+
const dependencyModuleRecords = await moduleRecord.dependencyRecords;
|
1183
|
+
if (dependencyModuleRecords.length > 0) {
|
1184
|
+
evaluationMap[moduleRecord.id] = true;
|
1185
|
+
// evaluate dependencies first
|
1186
|
+
await this.evaluateModuleDependencies(dependencyModuleRecords, evaluationMap);
|
1187
|
+
}
|
1208
1188
|
|
1209
|
-
// Wait for load to finish
|
1210
1189
|
const { exporter, dependencies } = await moduleRecord.instantiation;
|
1211
|
-
|
1212
|
-
|
1213
|
-
const
|
1190
|
+
// The exports object automatically gets filled in by the exporter evaluation
|
1191
|
+
const exports = {};
|
1192
|
+
const depsMapped = dependencies
|
1193
|
+
? await Promise.all(
|
1194
|
+
dependencies.map(async (dep) => {
|
1195
|
+
if (dep === 'exports') {
|
1196
|
+
return exports;
|
1197
|
+
}
|
1198
|
+
const resolvedDepId = await this.resolve(dep);
|
1199
|
+
|
1200
|
+
const moduleRecord = this.moduleRegistry.get(resolvedDepId) ;
|
1201
|
+
if (!moduleRecord) {
|
1202
|
+
throw new LoaderError(FAILED_DEP, [resolvedDepId]);
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
const module = moduleRecord.module;
|
1206
|
+
|
1207
|
+
/**
|
1208
|
+
* Circular dependencies are handled properly when named exports are used,
|
1209
|
+
* however, for default exports there is a bug: https://github.com/rollup/rollup/issues/3384
|
1210
|
+
*
|
1211
|
+
* The workaround below applies for circular dependencies (!moduleRecord.evaluated)
|
1212
|
+
*/
|
1213
|
+
if (!moduleRecord.evaluated) {
|
1214
|
+
return this.getCircularDependencyWrapper(module);
|
1215
|
+
}
|
1216
|
+
|
1217
|
+
if (module) {
|
1218
|
+
return module.__defaultInterop ? module.default : module;
|
1219
|
+
}
|
1220
|
+
|
1221
|
+
throw new LoaderError(FAILED_DEP, [resolvedDepId]);
|
1222
|
+
}),
|
1223
|
+
)
|
1224
|
+
: [];
|
1225
|
+
|
1226
|
+
// W-10029836 - In the case where we could be instantiating multiple graphs at the same time lets make sure the module have not already been evaluated
|
1227
|
+
if (moduleRecord.evaluated) {
|
1228
|
+
return moduleRecord.module;
|
1229
|
+
}
|
1214
1230
|
|
1215
1231
|
// evaluates the module function
|
1216
|
-
let moduleDefault
|
1232
|
+
let moduleDefault;
|
1233
|
+
try {
|
1234
|
+
moduleDefault = exporter(...depsMapped);
|
1235
|
+
} catch (e) {
|
1236
|
+
throw new LoaderError(EXPORTER_ERROR, [moduleRecord.id, e.message || e]);
|
1237
|
+
}
|
1217
1238
|
// value is returned from exporter, then we are not using named exports
|
1218
1239
|
if (moduleDefault !== undefined) {
|
1219
1240
|
moduleDefault = { default: moduleDefault };
|
@@ -1225,7 +1246,7 @@ class ModuleRegistry {
|
|
1225
1246
|
// if no return value, then we are using the exports object
|
1226
1247
|
else {
|
1227
1248
|
// handle only default export with Rollup forced named exports
|
1228
|
-
if (isNamedExportDefaultOnly(exports)) {
|
1249
|
+
if (this.isNamedExportDefaultOnly(exports)) {
|
1229
1250
|
Object.defineProperty(exports, '__useDefault', { value: true });
|
1230
1251
|
}
|
1231
1252
|
}
|
@@ -1257,17 +1278,42 @@ class ModuleRegistry {
|
|
1257
1278
|
Object.defineProperty(moduleRecord.module, '__esModule', { value: true });
|
1258
1279
|
}
|
1259
1280
|
|
1260
|
-
Object.freeze(moduleRecord.module);
|
1261
1281
|
moduleRecord.evaluated = true;
|
1262
|
-
moduleRecord.
|
1282
|
+
Object.freeze(moduleRecord.module);
|
1263
1283
|
return moduleRecord.module;
|
1264
1284
|
}
|
1265
1285
|
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1286
|
+
// Determines if named exports module has only default export
|
1287
|
+
isNamedExportDefaultOnly(exports) {
|
1288
|
+
return (
|
1289
|
+
exports !== undefined &&
|
1290
|
+
Object.getOwnPropertyNames(exports).length === 2 &&
|
1291
|
+
Object.prototype.hasOwnProperty.call(exports, 'default') &&
|
1292
|
+
Object.prototype.hasOwnProperty.call(exports, '__esModule')
|
1293
|
+
);
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
// Wrap the dependency in a function that can be called and detected by __circular__ property.
|
1297
|
+
// The LWC engine checks for __circular__ to detect circular dependencies.
|
1298
|
+
getCircularDependencyWrapper(module) {
|
1299
|
+
const tmp = () => {
|
1300
|
+
return module.__useDefault || module.__defaultInterop ? module.default : module;
|
1301
|
+
};
|
1302
|
+
tmp.__circular__ = true;
|
1303
|
+
return tmp;
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
async evaluateModuleDependencies(
|
1307
|
+
dependencyModuleRecords,
|
1308
|
+
evaluationMap,
|
1309
|
+
) {
|
1310
|
+
for (let i = 0; i < dependencyModuleRecords.length; i++) {
|
1311
|
+
const depRecord = dependencyModuleRecords[i];
|
1312
|
+
if (!depRecord.evaluated && !evaluationMap[depRecord.id]) {
|
1313
|
+
evaluationMap[depRecord.id] = true;
|
1314
|
+
// eslint-disable-next-line no-await-in-loop
|
1315
|
+
await this.evaluateModule(depRecord, evaluationMap);
|
1316
|
+
}
|
1271
1317
|
}
|
1272
1318
|
}
|
1273
1319
|
|
@@ -1347,6 +1393,9 @@ class ModuleRegistry {
|
|
1347
1393
|
});
|
1348
1394
|
}
|
1349
1395
|
|
1396
|
+
|
1397
|
+
|
1398
|
+
|
1350
1399
|
addLoaderPlugin(hooks) {
|
1351
1400
|
if (typeof hooks !== 'object') {
|
1352
1401
|
throw new LoaderError(INVALID_HOOK);
|
@@ -1388,6 +1437,7 @@ class ModuleRegistry {
|
|
1388
1437
|
}
|
1389
1438
|
}
|
1390
1439
|
|
1440
|
+
|
1391
1441
|
registerHandleStaleModuleHook(handleStaleModule) {
|
1392
1442
|
if (this.handleStaleModuleHook) {
|
1393
1443
|
this.handleStaleModuleHook.push(handleStaleModule);
|
@@ -1395,30 +1445,12 @@ class ModuleRegistry {
|
|
1395
1445
|
this.handleStaleModuleHook = [handleStaleModule];
|
1396
1446
|
}
|
1397
1447
|
}
|
1398
|
-
}
|
1399
1448
|
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
Object.prototype.hasOwnProperty.call(exports, 'default') &&
|
1406
|
-
Object.prototype.hasOwnProperty.call(exports, '__esModule')
|
1407
|
-
);
|
1408
|
-
}
|
1409
|
-
|
1410
|
-
// Wrap the dependency in a function that can be called and detected by __circular__ property.
|
1411
|
-
// The LWC engine checks for __circular__ to detect circular dependencies.
|
1412
|
-
function getCircularDependencyWrapper(module) {
|
1413
|
-
const tmp = () => {
|
1414
|
-
return module.__useDefault || module.__defaultInterop ? module.default : module;
|
1415
|
-
};
|
1416
|
-
tmp.__circular__ = true;
|
1417
|
-
return tmp;
|
1418
|
-
}
|
1419
|
-
|
1420
|
-
function isValidResolveResponse(res) {
|
1421
|
-
return res === null || typeof res === 'string' || (res && typeof (res ).url === 'string');
|
1449
|
+
isValidResolveResponse(res) {
|
1450
|
+
return (
|
1451
|
+
res === null || typeof res === 'string' || (res && typeof (res ).url === 'string')
|
1452
|
+
);
|
1453
|
+
}
|
1422
1454
|
}
|
1423
1455
|
|
1424
1456
|
/**
|
@@ -1576,12 +1608,12 @@ await loader.registerImportMappings({ imports, index }, [bootstrapModule]);
|
|
1576
1608
|
(globalThis ).LWR = Object.freeze({ define: loader.define.bind(loader) });
|
1577
1609
|
|
1578
1610
|
// Define preload modules (ie: ABS, vault, etc) BEFORE loading them
|
1579
|
-
LWR.define('lwr/everywhereAmd/v/0_0_1', ['exports', 'lwr/vault/v/0_0_1'], (function (exports,
|
1611
|
+
LWR.define('lwr/everywhereAmd/v/0_0_1', ['exports', 'lwr/vault/v/0_0_1'], (function (exports, _0_12_0Alpha_19) {
|
1580
1612
|
// IMPORTANT: Do not add any static imports to this file that are not bundled with the amd-client
|
1581
1613
|
|
1582
1614
|
// Do an OAuthed fetch
|
1583
1615
|
async function authFetch(url, accept = 'javascript') {
|
1584
|
-
const authInfo =
|
1616
|
+
const authInfo = _0_12_0Alpha_19.getAuthInfo();
|
1585
1617
|
if (authInfo) {
|
1586
1618
|
return fetch(url, {
|
1587
1619
|
headers: {
|
@@ -1630,7 +1662,7 @@ LWR.define('lwr/everywhereAmd/v/0_0_1', ['exports', 'lwr/vault/v/0_0_1'], (funct
|
|
1630
1662
|
function authenticate(authInfo) {
|
1631
1663
|
// Put OAuth info into the vault
|
1632
1664
|
if (authInfo) {
|
1633
|
-
|
1665
|
+
_0_12_0Alpha_19.setAuthInfo(authInfo);
|
1634
1666
|
}
|
1635
1667
|
}
|
1636
1668
|
|
@@ -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_12_0-
|
23
|
+
const BOOT_MODULE = `lwr/everywhere${format === 'esm' ? 'Esm' : 'Amd'}/v/0_12_0-alpha_19`;
|
24
24
|
const BOOT_URI = `${ENDPOINT}${encodeURIComponent(BOOT_MODULE)}/latest${debug ? '?debug' : ''}`;
|
25
25
|
|
26
26
|
// Client Bootstrap Config
|
@@ -1 +1 @@
|
|
1
|
-
globalThis.process={env:{NODE_ENV:"production"}};const e=function(e){const{format:o,server:i,apiVersion:n,apiPrefix:t,locale:p,bundle:r,debug:s}=e,a=new URL(import.meta.url),m=i||a.origin||"",d=`${t}/${n}`,$="0"+(p?`/l/${p}`:""),u="/bi/3_A,B,O,S,EG,JLMT,C,D,F,H,I,K,N,P,Q,R",l=r?`${m}${d}/bundle/${o}/${$}${u}-0/module/mi/`:`${m}${d}/module/${o}/${$}/mi/`,b=`lwr/everywhere${"esm"===o?"Esm":"Amd"}/v/0_12_0-
|
1
|
+
globalThis.process={env:{NODE_ENV:"production"}};const e=function(e){const{format:o,server:i,apiVersion:n,apiPrefix:t,locale:p,bundle:r,debug:s}=e,a=new URL(import.meta.url),m=i||a.origin||"",d=`${t}/${n}`,$="0"+(p?`/l/${p}`:""),u="/bi/3_A,B,O,S,EG,JLMT,C,D,F,H,I,K,N,P,Q,R",l=r?`${m}${d}/bundle/${o}/${$}${u}-0/module/mi/`:`${m}${d}/module/${o}/${$}/mi/`,b=`lwr/everywhere${"esm"===o?"Esm":"Amd"}/v/0_12_0-alpha_19`,g=`${l}${encodeURIComponent(b)}/latest${s?"?debug":""}`,c={appId:"lwre",autoBoot:!0,bootstrapModule:b,baseUrl:m,imports:{[g]:[b]},index:{[b]:g},endpoints:{uris:{module:l,mapping:`${m}${d}/mapping/${o}/${$}${r?u:""}/mp/`}}};return s&&c.endpoints&&(c.endpoints.modifiers={debug:"true"}),c}({format:"esm",apiVersion:"1",apiPrefix:"",bundle:!0,debug:!1}),{bootstrapModule:o,imports:i,index:n={},importMappings:t,endpoints:p}=e,{initEsm:r,authenticate:s,createComponent:a}=await import(n[o]);r({imports:i,index:n,importMappings:t,endpoints:p});export{s as authenticate,a as createComponent};
|
@@ -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_12_0-
|
23
|
+
const BOOT_MODULE = `lwr/everywhere${format === 'esm' ? 'Esm' : 'Amd'}/v/0_12_0-alpha_19`;
|
24
24
|
const BOOT_URI = `${ENDPOINT}${encodeURIComponent(BOOT_MODULE)}/latest${debug ? '?debug' : ''}`;
|
25
25
|
|
26
26
|
// Client Bootstrap Config
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lwrjs/everywhere",
|
3
3
|
"description": "LWR Everywhere",
|
4
|
-
"version": "0.12.0-alpha.
|
4
|
+
"version": "0.12.0-alpha.19",
|
5
5
|
"license": "MIT",
|
6
6
|
"publishConfig": {
|
7
7
|
"access": "public"
|
@@ -47,14 +47,14 @@
|
|
47
47
|
"@rollup/plugin-replace": "^2.4.2",
|
48
48
|
"@rollup/plugin-sucrase": "^5.0.2",
|
49
49
|
"@rollup/plugin-terser": "^0.4.4",
|
50
|
-
"@salesforce/lds-default-luvio": "1.
|
50
|
+
"@salesforce/lds-default-luvio": "1.281.0"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
53
|
"@locker/trusted-types": "0.21.3",
|
54
|
-
"@lwrjs/loader": "0.12.0-alpha.
|
55
|
-
"@lwrjs/router": "0.12.0-alpha.
|
56
|
-
"@lwrjs/types": "0.12.0-alpha.
|
57
|
-
"lwr": "0.12.0-alpha.
|
54
|
+
"@lwrjs/loader": "0.12.0-alpha.19",
|
55
|
+
"@lwrjs/router": "0.12.0-alpha.19",
|
56
|
+
"@lwrjs/types": "0.12.0-alpha.19",
|
57
|
+
"lwr": "0.12.0-alpha.19"
|
58
58
|
},
|
59
59
|
"peerDependencies": {
|
60
60
|
"@lwc/module-resolver": ">= 2.x"
|
@@ -81,5 +81,5 @@
|
|
81
81
|
"engines": {
|
82
82
|
"node": ">=18.0.0"
|
83
83
|
},
|
84
|
-
"gitHead": "
|
84
|
+
"gitHead": "5e1cd0d97d8e90cbd8b43868e2d7b33df6f8fa82"
|
85
85
|
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/* This script is generated */
|
2
|
-
/* Client Bootstrap configuration */
|
3
|
-
globalThis.LWR = globalThis.LWR || {};
|
4
|
-
Object.assign(globalThis.LWR, {"appId":"amd-bootstrap","bootstrapModule":"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_17/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_17/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js":["lwr/preInit/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_17/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js":["lwr/init/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_17/s/274c8343f810353bbad085a79709395f/lwr_metrics.js":["lwr/metrics/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_17/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js":["lwr/profiler/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F6_2_0/s/99eeb2c6eef76200d6f77e8a9895ea90/lwc.js":["lwc/v/6_2_0"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_17/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_12_0-alpha_17"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_17/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_12_0-alpha_17"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_17/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_17/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js","lwr/init/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_17/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js","lwr/metrics/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_17/s/274c8343f810353bbad085a79709395f/lwr_metrics.js","lwr/profiler/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_17/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js","lwc/v/6_2_0":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F6_2_0/s/99eeb2c6eef76200d6f77e8a9895ea90/lwc.js","lwr/everywhereAmd/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_17/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_17/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_12_0-alpha_17"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17"],"preloadModules":["lwr/preInit/v/0_12_0-alpha_17","lwr/init/v/0_12_0-alpha_17","lwr/metrics/v/0_12_0-alpha_17","lwc/v/6_2_0","lwr/everywhereAmd/v/0_12_0-alpha_17"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
|
5
|
-
globalThis.LWR = {...globalThis.LWR, env: {"SSR":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 };
|
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%2Floader%2Fv%2F0_12_0-alpha_17/s/7d88cdd63afd9a8457f758efa6852edc/lwr_loader.js":["lwr/loader/v/0_12_0-alpha_17"]})
|
11
|
-
if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
|
12
|
-
Object.assign(globalThis.LWR.index, {"lwr/loader/v/0_12_0-alpha_17":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_12_0-alpha_17/s/7d88cdd63afd9a8457f758efa6852edc/lwr_loader.js"})
|
@@ -1,14 +0,0 @@
|
|
1
|
-
LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17', ['lwr/loader/v/0_12_0-alpha_17', 'lwr/preInit/v/0_12_0-alpha_17', 'lwr/init/v/0_12_0-alpha_17'], (function (_0_12_0Alpha_17$2, _0_12_0Alpha_17, _0_12_0Alpha_17$1) { 'use strict';
|
2
|
-
|
3
|
-
const clientBootstrapConfig = _0_12_0Alpha_17.getClientBootstrapConfig();
|
4
|
-
|
5
|
-
// initialize additional non-configured root components
|
6
|
-
const { rootComponents, serverData } = clientBootstrapConfig;
|
7
|
-
Promise.all(rootComponents.map(async (rootSpecifier) => {
|
8
|
-
const element = _0_12_0Alpha_17$1.toKebabCase(rootSpecifier);
|
9
|
-
return _0_12_0Alpha_17$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_17').then(({default: Ctor}) => {
|
10
|
-
_0_12_0Alpha_17$1.init([[element, Ctor]], serverData);
|
11
|
-
});
|
12
|
-
}));
|
13
|
-
|
14
|
-
}));
|