@lwrjs/module-registry 0.11.0-alpha.0 → 0.11.0-alpha.2

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.
@@ -87,7 +87,7 @@ var LwrModuleRegistry = class {
87
87
  bundleId = bundleGroups && (0, import_shared_utils.getGroupName)(moduleId.specifier, bundleGroups);
88
88
  }
89
89
  return new Promise((resolve, reject) => {
90
- (0, import_signature.getBundleSignature)(moduleId, this, this.globalConfig?.bundleConfig?.exclude).then((bundleSignature) => resolve((0, import_esm_strategy.default)(moduleId, runtimeEnvironment, runtimeParams, bundleSignature, bundleId))).catch(reject);
90
+ (0, import_signature.getBundleSignature)(moduleId, this, runtimeParams, this.globalConfig?.bundleConfig?.exclude).then((bundleSignature) => resolve((0, import_esm_strategy.default)(moduleId, runtimeEnvironment, runtimeParams, bundleSignature, bundleId))).catch(reject);
91
91
  });
92
92
  } else {
93
93
  return new Promise((resolve, reject) => {
@@ -117,7 +117,7 @@ var LwrModuleRegistry = class {
117
117
  }
118
118
  async createModuleDefinition(moduleId, runtimeParams) {
119
119
  const moduleCompiled = await this.delegateGetModuleOnProviders(moduleId, runtimeParams);
120
- const moduleRecord = await (0, import_module_record.getModuleRecord)(moduleCompiled, this);
120
+ const moduleRecord = await (0, import_module_record.getModuleRecord)(moduleCompiled, this, runtimeParams);
121
121
  return {...moduleCompiled, moduleRecord};
122
122
  }
123
123
  async getLinkedModule(moduleId, runtimeEnvironment, runtimeParams) {
@@ -191,7 +191,8 @@ var LwrModuleRegistry = class {
191
191
  minified: false
192
192
  },
193
193
  linkedModuleRecord,
194
- runtimeEnvironment
194
+ runtimeEnvironment,
195
+ runtimeParams
195
196
  };
196
197
  } else {
197
198
  let loaderModuleEntry;
@@ -48,7 +48,7 @@ async function link(moduleRegistry, moduleDef, versionStrategy, uriStrategy, run
48
48
  if (contextMap?.has(context)) {
49
49
  const overrideSpecifier = contextMap.get(context);
50
50
  const moduleId = (0, import_shared_utils2.explodeSpecifier)(overrideSpecifier);
51
- const overrideEntry = await moduleRegistry.getModuleEntry(moduleId);
51
+ const overrideEntry = await moduleRegistry.getModuleEntry(moduleId, runtimeParams);
52
52
  if (overrideEntry) {
53
53
  importRef = {
54
54
  ...importRef,
@@ -61,7 +61,7 @@ async function link(moduleRegistry, moduleDef, versionStrategy, uriStrategy, run
61
61
  }
62
62
  let signature;
63
63
  if (runtimeEnvironment.bundle && runtimeEnvironment.format === "esm" && exclude?.includes(importRef.specifier)) {
64
- signature = await (0, import_signature.getBundleSignature)(importRef, moduleRegistry, exclude);
64
+ signature = await (0, import_signature.getBundleSignature)(importRef, moduleRegistry, runtimeParams, exclude);
65
65
  }
66
66
  const {locations, sourceSpecifier} = importRef;
67
67
  const link2 = strategy(importRef, runtimeEnvironment, runtimeParams, signature);
@@ -83,7 +83,7 @@ async function link(moduleRegistry, moduleDef, versionStrategy, uriStrategy, run
83
83
  let signature;
84
84
  const isStringLiteral = importRef.moduleNameType === import_shared_utils2.ModuleNameType.string;
85
85
  if (isStringLiteral && runtimeEnvironment.bundle && runtimeEnvironment.format === "esm") {
86
- signature = await (0, import_signature.getBundleSignature)(importRef, moduleRegistry, exclude);
86
+ signature = await (0, import_signature.getBundleSignature)(importRef, moduleRegistry, runtimeParams, exclude);
87
87
  }
88
88
  const link2 = isStringLiteral ? versionStrategy(importRef, runtimeEnvironment, runtimeParams, signature) : importRef.specifier;
89
89
  const linkedLocations = locations.map(({location, importLocation}) => {
@@ -121,7 +121,7 @@ async function link(moduleRegistry, moduleDef, versionStrategy, uriStrategy, run
121
121
  const {namespace, name} = (0, import_shared_utils2.explodeSpecifier)(specifier2);
122
122
  let signature;
123
123
  if (esmLoaderModule && runtimeEnvironment.bundle) {
124
- signature = await (0, import_signature.getBundleSignature)({version: version2, specifier: specifier2}, moduleRegistry, exclude);
124
+ signature = await (0, import_signature.getBundleSignature)({version: version2, specifier: specifier2}, moduleRegistry, runtimeParams, exclude);
125
125
  }
126
126
  const loaderLink = strategy({specifier: specifier2, version: version2}, runtimeEnvironment, runtimeParams, signature);
127
127
  const loaderImport = `import { load } from "${loaderLink}";
@@ -28,7 +28,7 @@ __export(exports, {
28
28
  });
29
29
  var import_path = __toModule(require("path"));
30
30
  var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
31
- async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, version, location) {
31
+ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, version, location, runtimeParams) {
32
32
  const [importeeSpecifier, importeePath] = importeeEntry.specifier.split("#");
33
33
  if (importeePath) {
34
34
  moduleSpecifier = `./${import_path.default.join(importeePath, "..", moduleSpecifier)}`;
@@ -39,7 +39,7 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
39
39
  specifier,
40
40
  version,
41
41
  importer: importeeEntry.scope
42
- });
42
+ }, runtimeParams);
43
43
  return {
44
44
  namespace,
45
45
  name: name || specifier,
@@ -50,14 +50,14 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
50
50
  locations: [location]
51
51
  };
52
52
  }
53
- async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location) {
53
+ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location, runtimeParams) {
54
54
  const {namespace, name, specifier} = (0, import_shared_utils.explodeSpecifier)(moduleSpecifier);
55
55
  const {entry, virtual} = importeeEntry;
56
56
  const moduleEntryRoot = virtual ? void 0 : import_path.default.dirname(entry);
57
57
  const dependencyModuleEntry = await registry.getModuleEntry({
58
58
  specifier: moduleSpecifier,
59
59
  importer: moduleEntryRoot
60
- });
60
+ }, runtimeParams);
61
61
  return {
62
62
  namespace,
63
63
  name: name || specifier,
@@ -69,7 +69,7 @@ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, l
69
69
  interchangeable: dependencyModuleEntry.interchangeable
70
70
  };
71
71
  }
72
- async function getModuleRecord(compiledModule, registry) {
72
+ async function getModuleRecord(compiledModule, registry, runtimeParams) {
73
73
  const imports = [];
74
74
  const dynamicImports = [];
75
75
  const {compiledMetadata: defaultCompilerMetadata, moduleEntry, version} = compiledModule;
@@ -89,10 +89,10 @@ async function getModuleRecord(compiledModule, registry) {
89
89
  if (!visitedImports.has(moduleSpecifier)) {
90
90
  visitedImports.add(moduleSpecifier);
91
91
  if (moduleSpecifier.startsWith(".")) {
92
- const resolvedImport = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location);
92
+ const resolvedImport = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location, runtimeParams);
93
93
  imports.push(resolvedImport);
94
94
  } else {
95
- const resolvedImport = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location);
95
+ const resolvedImport = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location, runtimeParams);
96
96
  imports.push(resolvedImport);
97
97
  }
98
98
  } else {
@@ -128,7 +128,7 @@ async function getModuleRecord(compiledModule, registry) {
128
128
  ]
129
129
  });
130
130
  } else if (moduleSpecifier.startsWith(".")) {
131
- const {locations, ...resolvedImport} = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location);
131
+ const {locations, ...resolvedImport} = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location, runtimeParams);
132
132
  dynamicImports.push({
133
133
  ...resolvedImport,
134
134
  moduleNameType: import_shared_utils.ModuleNameType.string,
@@ -140,7 +140,7 @@ async function getModuleRecord(compiledModule, registry) {
140
140
  ]
141
141
  });
142
142
  } else {
143
- const {locations, ...resolvedImport} = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location);
143
+ const {locations, ...resolvedImport} = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location, runtimeParams);
144
144
  dynamicImports.push({
145
145
  ...resolvedImport,
146
146
  moduleNameType: import_shared_utils.ModuleNameType.string,
@@ -31,11 +31,11 @@ var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
31
31
  var import_config = __toModule(require("@lwrjs/config"));
32
32
  var ENABLED_FINGERPRINTS = !(0, import_shared_utils.getFeatureFlags)().LEGACY_LOADER;
33
33
  var ENV_KEY = `LWC:${import_config.LWC_VERSION},FINGERPRINTS:${ENABLED_FINGERPRINTS}`;
34
- async function getRecursiveModuleHash(modules, registry, hash, visitedDefinitions = new Set(), excludes = new Set()) {
34
+ async function getRecursiveModuleHash(modules, registry, hash, runtimeParams, visitedDefinitions = new Set(), excludes = new Set()) {
35
35
  if (!modules.length) {
36
36
  return;
37
37
  }
38
- const definitions = await Promise.all(modules.map((module2) => registry.getModule(module2)));
38
+ const definitions = await Promise.all(modules.map((module2) => registry.getModule(module2, runtimeParams)));
39
39
  const imports = new Map();
40
40
  for (const definition of definitions) {
41
41
  const {specifier, version, ownHash, moduleRecord} = definition;
@@ -52,12 +52,12 @@ async function getRecursiveModuleHash(modules, registry, hash, visitedDefinition
52
52
  }
53
53
  const dependencies = Array.from(imports, ([_, dependency]) => dependency).filter((dependency) => !visitedDefinitions.has(dependency.specifier) && !visitedDefinitions.has((0, import_shared_utils.getSpecifier)(dependency)));
54
54
  if (dependencies.length) {
55
- return getRecursiveModuleHash(dependencies, registry, hash, visitedDefinitions, excludes);
55
+ return getRecursiveModuleHash(dependencies, registry, hash, runtimeParams, visitedDefinitions, excludes);
56
56
  }
57
57
  }
58
- async function getBundleSignature(moduleId, registry, excludes) {
58
+ async function getBundleSignature(moduleId, registry, runtimeParams, excludes) {
59
59
  const hash = import_crypto.default.createHash("sha1");
60
60
  hash.update(ENV_KEY);
61
- await getRecursiveModuleHash([moduleId], registry, hash, new Set(), new Set(excludes));
61
+ await getRecursiveModuleHash([moduleId], registry, hash, runtimeParams, new Set(), new Set(excludes));
62
62
  return hash.digest("hex");
63
63
  }
@@ -15,13 +15,13 @@ export declare class LwrModuleRegistry implements ModuleRegistry {
15
15
  private interchangeableModules?;
16
16
  private inflightModuleDefinitions;
17
17
  constructor(context: RegistryContext, globalConfig: NormalizedLwrGlobalConfig, registries?: ModuleProvider[]);
18
- resolveModuleUriSync<R extends RuntimeEnvironment, S extends string | undefined>(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, signature: S, runtimeEnvironment: R, runtimeParams?: RuntimeParams): string;
19
- resolveModuleUri<R extends RuntimeEnvironment, S extends string | undefined>(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, runtimeEnvironment: R, runtimeParams?: RuntimeParams, signature?: S): Promise<string>;
18
+ resolveModuleUriSync<R extends RuntimeEnvironment, S extends string | undefined>(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, signature: S, runtimeEnvironment: R, runtimeParams: RuntimeParams): string;
19
+ resolveModuleUri<R extends RuntimeEnvironment, S extends string | undefined>(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, runtimeEnvironment: R, runtimeParams: RuntimeParams, signature?: S): Promise<string>;
20
20
  addModuleProviders(registries: ModuleProvider[]): void;
21
- getModuleEntry<T extends AbstractModuleId>(moduleId: T, runtimeParams?: RuntimeParams): Promise<ModuleEntry>;
22
- getModule<T extends AbstractModuleId>(moduleId: T, runtimeParams?: RuntimeParams): Promise<ModuleDefinition>;
21
+ getModuleEntry<T extends AbstractModuleId>(moduleId: T, runtimeParams: RuntimeParams): Promise<ModuleEntry>;
22
+ getModule<T extends AbstractModuleId>(moduleId: T, runtimeParams: RuntimeParams): Promise<ModuleDefinition>;
23
23
  private createModuleDefinition;
24
- getLinkedModule<T extends AbstractModuleId>(moduleId: T, runtimeEnvironment: RuntimeEnvironment, runtimeParams?: RuntimeParams): Promise<LinkedModuleDefinition>;
24
+ getLinkedModule<T extends AbstractModuleId>(moduleId: T, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<LinkedModuleDefinition>;
25
25
  private createLinkedModuleDefinition;
26
26
  private delegateGetModuleEntryOnServices;
27
27
  private delegateGetModuleOnProviders;
package/build/es/index.js CHANGED
@@ -67,7 +67,7 @@ export class LwrModuleRegistry {
67
67
  bundleId = bundleGroups && getGroupName(moduleId.specifier, bundleGroups);
68
68
  }
69
69
  return new Promise((resolve, reject) => {
70
- getBundleSignature(moduleId, this, this.globalConfig?.bundleConfig?.exclude)
70
+ getBundleSignature(moduleId, this, runtimeParams, this.globalConfig?.bundleConfig?.exclude)
71
71
  .then((bundleSignature) => resolve(esmLinkingStrategy(moduleId, runtimeEnvironment, runtimeParams, bundleSignature, bundleId)))
72
72
  .catch(reject);
73
73
  });
@@ -108,7 +108,7 @@ export class LwrModuleRegistry {
108
108
  }
109
109
  async createModuleDefinition(moduleId, runtimeParams) {
110
110
  const moduleCompiled = await this.delegateGetModuleOnProviders(moduleId, runtimeParams); // provider source + hash
111
- const moduleRecord = await getModuleRecord(moduleCompiled, this);
111
+ const moduleRecord = await getModuleRecord(moduleCompiled, this, runtimeParams);
112
112
  return { ...moduleCompiled, moduleRecord };
113
113
  }
114
114
  async getLinkedModule(moduleId, runtimeEnvironment, runtimeParams) {
@@ -185,6 +185,7 @@ export class LwrModuleRegistry {
185
185
  },
186
186
  linkedModuleRecord,
187
187
  runtimeEnvironment,
188
+ runtimeParams,
188
189
  };
189
190
  }
190
191
  else {
@@ -24,6 +24,6 @@ export interface ModuleLinkResult {
24
24
  * @param moduleRecord
25
25
  * @param strategy
26
26
  */
27
- export declare function link(moduleRegistry: LwrModuleRegistry, moduleDef: ModuleDefinition, versionStrategy: LinkingStrategy, uriStrategy: LinkingStrategy, runtimeEnvironment: RuntimeEnvironment, runtimeParams?: RuntimeParams, config?: LinkerConfig, interchangeableModules?: InterchangeableModuleMap, exclude?: string[]): Promise<ModuleLinkResult>;
27
+ export declare function link(moduleRegistry: LwrModuleRegistry, moduleDef: ModuleDefinition, versionStrategy: LinkingStrategy, uriStrategy: LinkingStrategy, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams, config?: LinkerConfig, interchangeableModules?: InterchangeableModuleMap, exclude?: string[]): Promise<ModuleLinkResult>;
28
28
  export {};
29
29
  //# sourceMappingURL=linker.d.ts.map
@@ -28,7 +28,7 @@ export async function link(moduleRegistry, moduleDef, versionStrategy, uriStrate
28
28
  if (contextMap?.has(context)) {
29
29
  const overrideSpecifier = contextMap.get(context);
30
30
  const moduleId = explodeSpecifier(overrideSpecifier);
31
- const overrideEntry = await moduleRegistry.getModuleEntry(moduleId);
31
+ const overrideEntry = await moduleRegistry.getModuleEntry(moduleId, runtimeParams);
32
32
  if (overrideEntry) {
33
33
  importRef = {
34
34
  ...importRef,
@@ -44,7 +44,7 @@ export async function link(moduleRegistry, moduleDef, versionStrategy, uriStrate
44
44
  if (runtimeEnvironment.bundle &&
45
45
  runtimeEnvironment.format === 'esm' &&
46
46
  exclude?.includes(importRef.specifier)) {
47
- signature = await getBundleSignature(importRef, moduleRegistry, exclude);
47
+ signature = await getBundleSignature(importRef, moduleRegistry, runtimeParams, exclude);
48
48
  }
49
49
  const { locations, sourceSpecifier } = importRef;
50
50
  const link = strategy(importRef, runtimeEnvironment, runtimeParams, signature);
@@ -69,7 +69,7 @@ export async function link(moduleRegistry, moduleDef, versionStrategy, uriStrate
69
69
  const isStringLiteral = importRef.moduleNameType === ModuleNameType.string;
70
70
  // get signature for dynamic imports when bundling esm
71
71
  if (isStringLiteral && runtimeEnvironment.bundle && runtimeEnvironment.format === 'esm') {
72
- signature = await getBundleSignature(importRef, moduleRegistry, exclude);
72
+ signature = await getBundleSignature(importRef, moduleRegistry, runtimeParams, exclude);
73
73
  }
74
74
  // always link [literal] dynamic imports as versioned specifiers (AMD strategy)
75
75
  // linking them as URIs (ESM strategy) causes caching issues since they can contain stale signatures
@@ -120,7 +120,7 @@ export async function link(moduleRegistry, moduleDef, versionStrategy, uriStrate
120
120
  let signature;
121
121
  if (esmLoaderModule && runtimeEnvironment.bundle) {
122
122
  // Ensure the ESM loader is signed, or there may be a clash between this import and an existing one
123
- signature = await getBundleSignature({ version, specifier }, moduleRegistry, exclude);
123
+ signature = await getBundleSignature({ version, specifier }, moduleRegistry, runtimeParams, exclude);
124
124
  }
125
125
  const loaderLink = strategy({ specifier, version }, runtimeEnvironment, runtimeParams, signature);
126
126
  // import {load} from 'loader/loader'
@@ -1,3 +1,3 @@
1
- import type { ModuleCompiled, ModuleRecord, ModuleRegistry } from '@lwrjs/types';
2
- export declare function getModuleRecord(compiledModule: ModuleCompiled, registry: ModuleRegistry): Promise<ModuleRecord>;
1
+ import type { ModuleCompiled, ModuleRecord, ModuleRegistry, RuntimeParams } from '@lwrjs/types';
2
+ export declare function getModuleRecord(compiledModule: ModuleCompiled, registry: ModuleRegistry, runtimeParams: RuntimeParams): Promise<ModuleRecord>;
3
3
  //# sourceMappingURL=module-record.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
  import { explodeSpecifier, getImportMetadata, ModuleNameType } from '@lwrjs/shared-utils';
3
- async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, version, location) {
3
+ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, version, location, runtimeParams) {
4
4
  // Resolve any relative parts in the import specifier
5
5
  // eg: "c/app#app.html" => "c/app"
6
6
  // eg: "some/specifier#file" => "some/specifier"
@@ -21,7 +21,7 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
21
21
  specifier,
22
22
  version,
23
23
  importer: importeeEntry.scope,
24
- });
24
+ }, runtimeParams);
25
25
  return {
26
26
  namespace,
27
27
  name: name || specifier,
@@ -32,14 +32,14 @@ async function resolveRelativeImport(registry, moduleSpecifier, importeeEntry, v
32
32
  locations: [location],
33
33
  };
34
34
  }
35
- async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location) {
35
+ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, location, runtimeParams) {
36
36
  const { namespace, name, specifier } = explodeSpecifier(moduleSpecifier);
37
37
  const { entry, virtual } = importeeEntry;
38
38
  const moduleEntryRoot = virtual ? undefined : path.dirname(entry);
39
39
  const dependencyModuleEntry = await registry.getModuleEntry({
40
40
  specifier: moduleSpecifier,
41
41
  importer: moduleEntryRoot,
42
- });
42
+ }, runtimeParams);
43
43
  return {
44
44
  namespace,
45
45
  name: name || specifier,
@@ -51,7 +51,7 @@ async function resolveExternalImport(registry, moduleSpecifier, importeeEntry, l
51
51
  interchangeable: dependencyModuleEntry.interchangeable,
52
52
  };
53
53
  }
54
- export async function getModuleRecord(compiledModule, registry) {
54
+ export async function getModuleRecord(compiledModule, registry, runtimeParams) {
55
55
  const imports = [];
56
56
  const dynamicImports = [];
57
57
  const { compiledMetadata: defaultCompilerMetadata, moduleEntry, version } = compiledModule;
@@ -72,12 +72,12 @@ export async function getModuleRecord(compiledModule, registry) {
72
72
  if (moduleSpecifier.startsWith('.')) {
73
73
  // Import string is a relative path
74
74
  // eslint-disable-next-line no-await-in-loop
75
- const resolvedImport = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location);
75
+ const resolvedImport = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location, runtimeParams);
76
76
  imports.push(resolvedImport);
77
77
  }
78
78
  else {
79
79
  // eslint-disable-next-line no-await-in-loop
80
- const resolvedImport = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location);
80
+ const resolvedImport = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location, runtimeParams);
81
81
  imports.push(resolvedImport);
82
82
  }
83
83
  }
@@ -114,7 +114,7 @@ export async function getModuleRecord(compiledModule, registry) {
114
114
  }
115
115
  else if (moduleSpecifier.startsWith('.')) {
116
116
  // eslint-disable-next-line no-await-in-loop
117
- const { locations, ...resolvedImport } = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location);
117
+ const { locations, ...resolvedImport } = await resolveRelativeImport(registry, moduleSpecifier, moduleEntry, version, location, runtimeParams);
118
118
  dynamicImports.push({
119
119
  ...resolvedImport,
120
120
  moduleNameType: ModuleNameType.string,
@@ -129,7 +129,7 @@ export async function getModuleRecord(compiledModule, registry) {
129
129
  else {
130
130
  // It's addressing a separate module
131
131
  // eslint-disable-next-line no-await-in-loop
132
- const { locations, ...resolvedImport } = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location);
132
+ const { locations, ...resolvedImport } = await resolveExternalImport(registry, moduleSpecifier, moduleEntry, location, runtimeParams);
133
133
  dynamicImports.push({
134
134
  ...resolvedImport,
135
135
  moduleNameType: ModuleNameType.string,
@@ -1,4 +1,4 @@
1
- import type { ModuleRegistry, ModuleId } from '@lwrjs/types';
1
+ import type { ModuleRegistry, ModuleId, RuntimeParams } from '@lwrjs/types';
2
2
  /**
3
3
  * Generate a bundle signature
4
4
  *
@@ -12,5 +12,5 @@ import type { ModuleRegistry, ModuleId } from '@lwrjs/types';
12
12
  * @param exclude - bundle config exclusions
13
13
  * @returns a bungle signature
14
14
  */
15
- export declare function getBundleSignature(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, registry: ModuleRegistry, excludes?: string[]): Promise<string>;
15
+ export declare function getBundleSignature(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, registry: ModuleRegistry, runtimeParams: RuntimeParams, excludes?: string[]): Promise<string>;
16
16
  //# sourceMappingURL=signature.d.ts.map
@@ -3,12 +3,12 @@ import { getFeatureFlags, getSpecifier } from '@lwrjs/shared-utils';
3
3
  import { LWC_VERSION } from '@lwrjs/config';
4
4
  const ENABLED_FINGERPRINTS = !getFeatureFlags().LEGACY_LOADER;
5
5
  const ENV_KEY = `LWC:${LWC_VERSION},FINGERPRINTS:${ENABLED_FINGERPRINTS}`;
6
- async function getRecursiveModuleHash(modules, registry, hash, visitedDefinitions = new Set(), excludes = new Set()) {
6
+ async function getRecursiveModuleHash(modules, registry, hash, runtimeParams, visitedDefinitions = new Set(), excludes = new Set()) {
7
7
  if (!modules.length) {
8
8
  return;
9
9
  }
10
10
  // Fetch all the definitions from the registry
11
- const definitions = await Promise.all(modules.map((module) => registry.getModule(module)));
11
+ const definitions = await Promise.all(modules.map((module) => registry.getModule(module, runtimeParams)));
12
12
  const imports = new Map();
13
13
  for (const definition of definitions) {
14
14
  const { specifier, version, ownHash, moduleRecord } = definition;
@@ -37,7 +37,7 @@ async function getRecursiveModuleHash(modules, registry, hash, visitedDefinition
37
37
  // already visited dependencies will be versioned
38
38
  !visitedDefinitions.has(getSpecifier(dependency)));
39
39
  if (dependencies.length) {
40
- return getRecursiveModuleHash(dependencies, registry, hash, visitedDefinitions, excludes);
40
+ return getRecursiveModuleHash(dependencies, registry, hash, runtimeParams, visitedDefinitions, excludes);
41
41
  }
42
42
  }
43
43
  /**
@@ -53,7 +53,7 @@ async function getRecursiveModuleHash(modules, registry, hash, visitedDefinition
53
53
  * @param exclude - bundle config exclusions
54
54
  * @returns a bungle signature
55
55
  */
56
- export async function getBundleSignature(moduleId, registry, excludes) {
56
+ export async function getBundleSignature(moduleId, registry, runtimeParams, excludes) {
57
57
  const hash = crypto.createHash('sha1');
58
58
  // Add the environment key
59
59
  hash.update(ENV_KEY);
@@ -61,7 +61,7 @@ export async function getBundleSignature(moduleId, registry, excludes) {
61
61
  // them in the bundle signature
62
62
  // Note: if the root module is an excluded module, it will be included in
63
63
  // the signature
64
- await getRecursiveModuleHash([moduleId], registry, hash, new Set(), new Set(excludes));
64
+ await getRecursiveModuleHash([moduleId], registry, hash, runtimeParams, new Set(), new Set(excludes));
65
65
  return hash.digest('hex');
66
66
  }
67
67
  //# sourceMappingURL=signature.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.11.0-alpha.0",
7
+ "version": "0.11.0-alpha.2",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,15 +30,15 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/diagnostics": "0.11.0-alpha.0",
34
- "@lwrjs/shared-utils": "0.11.0-alpha.0",
33
+ "@lwrjs/diagnostics": "0.11.0-alpha.2",
34
+ "@lwrjs/shared-utils": "0.11.0-alpha.2",
35
35
  "rollup": "^2.78.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@lwrjs/types": "0.11.0-alpha.0"
38
+ "@lwrjs/types": "0.11.0-alpha.2"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=16.0.0"
42
42
  },
43
- "gitHead": "6917abefe32752eeed0f9ba98505ca2b76f1df9d"
43
+ "gitHead": "ce7d80468d289a0d24682735513166f163f29f61"
44
44
  }