@lwrjs/view-registry 0.4.7 → 0.5.0

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.
@@ -97,7 +97,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
97
97
  }
98
98
  }
99
99
  }
100
- let importMetadata = (0, import_shared_utils.toImportMetadata)(bootstrapModuleGraph);
100
+ let importMetadata = await (0, import_shared_utils.toImportMetadata)(bootstrapModuleGraph, {imports: {}, index: {}}, moduleRegistry, runtimeEnvironment, runtimeParams);
101
101
  const customElementsRecords = [];
102
102
  await Promise.all(customElements.map(async (element) => {
103
103
  const graph = await (0, import_shared_utils.getModuleGraphs)((0, import_shared_utils.kebabcaseToCamelcase)(element), {includeUris: true, includeLinkedDefinitions: true, depth}, moduleRegistry, bundle ? moduleBundler : moduleRegistry, runtimeEnvironment, runtimeParams ? runtimeParams : {}, visitedCache);
@@ -118,7 +118,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
118
118
  imports[dynamicDep] = uri3;
119
119
  }
120
120
  }
121
- importMetadata = (0, import_shared_utils.toImportMetadata)(graph, importMetadata);
121
+ importMetadata = await (0, import_shared_utils.toImportMetadata)(graph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
122
122
  }));
123
123
  configResources.unshift(await (0, import_utils2.getViewBootstrapConfigurationResource)({
124
124
  id: view.id,
@@ -128,6 +128,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
128
128
  bootstrapModule: versionedSpecifier,
129
129
  autoBoot: view.bootstrap?.autoBoot === false ? false : true,
130
130
  imports: importMetadata?.imports,
131
+ index: importMetadata?.index,
131
132
  rootComponents,
132
133
  ...isAMD && {requiredModules: requiredAmdModules},
133
134
  ...isAMD && {preloadModules: preloadAmdModules}
package/build/es/index.js CHANGED
@@ -101,6 +101,7 @@ export class LwrViewRegistry {
101
101
  }
102
102
  async delegateGetView(viewId) {
103
103
  for (const vp of this.viewProviders) {
104
+ // eslint-disable-next-line no-await-in-loop
104
105
  const result = await vp.getView(viewId);
105
106
  if (result) {
106
107
  return result;
@@ -62,7 +62,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
62
62
  }
63
63
  // ------- Application Bootstrap module
64
64
  // Traversal of the Bootstrap Module Graph is done to get all the URLS for discoverable static dependencies.
65
- // Reasoning: This is to avoid unecessary HTTP 302's during initial application module fetching.
65
+ // Reasoning: This is to avoid unnecessary HTTP 302's during initial application module fetching.
66
66
  // Scope: ESM currently only exposes immutable URI references, optimize for AMD formats
67
67
  const depth = isAMD
68
68
  ? { static: GraphDepth.ALL, dynamic: 1 }
@@ -100,7 +100,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
100
100
  }
101
101
  }
102
102
  }
103
- let importMetadata = toImportMetadata(bootstrapModuleGraph);
103
+ let importMetadata = await toImportMetadata(bootstrapModuleGraph, { imports: {}, index: {} }, moduleRegistry, runtimeEnvironment, runtimeParams);
104
104
  // ------- View related custom element moduleResources
105
105
  const customElementsRecords = [];
106
106
  await Promise.all(customElements.map(async (element) => {
@@ -127,7 +127,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
127
127
  imports[dynamicDep] = uri;
128
128
  }
129
129
  }
130
- importMetadata = toImportMetadata(graph, importMetadata);
130
+ importMetadata = await toImportMetadata(graph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
131
131
  }));
132
132
  // ADD configuration of the bootstrapModule
133
133
  configResources.unshift(await getViewBootstrapConfigurationResource({
@@ -138,6 +138,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
138
138
  bootstrapModule: versionedSpecifier,
139
139
  autoBoot: view.bootstrap?.autoBoot === false ? false : true,
140
140
  imports: importMetadata?.imports,
141
+ index: importMetadata?.index,
141
142
  rootComponents,
142
143
  ...(isAMD && { requiredModules: requiredAmdModules }),
143
144
  ...(isAMD && { preloadModules: preloadAmdModules }),
package/build/es/utils.js CHANGED
@@ -146,6 +146,7 @@ export async function toJsonFormat(viewRequest, viewDefinition, route, runtimeEn
146
146
  },
147
147
  };
148
148
  const workerBootstrapSpecifier = getAppSpecifier(appIdentity);
149
+ // eslint-disable-next-line no-await-in-loop
149
150
  workers[id] = await createJsonModule(workerBootstrapSpecifier, moduleRegistry, runtimeEnvironment, runtimeParams);
150
151
  }
151
152
  // ADD bootstrap module and dependencies to modules property
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.4.7",
7
+ "version": "0.5.0",
8
8
  "homepage": "https://lwr.dev/",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,16 +30,16 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.4.7",
34
- "@lwrjs/diagnostics": "0.4.7",
35
- "@lwrjs/shared-utils": "0.4.7",
33
+ "@lwrjs/app-service": "0.5.0",
34
+ "@lwrjs/diagnostics": "0.5.0",
35
+ "@lwrjs/shared-utils": "0.5.0",
36
36
  "magic-string": "^0.25.7"
37
37
  },
38
38
  "devDependencies": {
39
- "@lwrjs/types": "0.4.7"
39
+ "@lwrjs/types": "0.5.0"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=14.15.4 <15"
43
43
  },
44
- "gitHead": "4f4bec34d0cec407147cad01cc452e6f3058b9fe"
44
+ "gitHead": "8b46ed1d391c744926ad65b442e5a9f9969d832e"
45
45
  }