@lwrjs/view-registry 0.9.0-alpha.15 → 0.9.0-alpha.17

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.
@@ -65,9 +65,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
65
65
  if (!def) {
66
66
  throw Error("Failed to find definition of resource: " + shimBundle);
67
67
  }
68
- if (def.stream) {
69
- def.stream.destroy();
70
- }
71
68
  requiredResources.push(def);
72
69
  const errorShimDef = await resourceRegistry.getResource({specifier: "lwr-error-shim.js", version}, runtimeEnvironment, runtimeParams);
73
70
  if (!errorShimDef) {
@@ -66,9 +66,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
66
66
  if (!def) {
67
67
  throw Error("Failed to find definition of resource: " + shimBundle);
68
68
  }
69
- if (def.stream) {
70
- def.stream.destroy();
71
- }
72
69
  requiredResources.push(def);
73
70
  const errorShimDef = await resourceRegistry.getResource({specifier: "lwr-error-shim.js", version}, runtimeEnvironment, runtimeParams);
74
71
  if (!errorShimDef) {
@@ -109,7 +106,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
109
106
  }
110
107
  }
111
108
  }
112
- let importMetadata = await (0, import_shared_utils.toImportMetadata)(bootstrapModuleGraph, {imports: {}, index: {}}, defRegistry, runtimeEnvironment, runtimeParams);
109
+ let importMetadata = await (0, import_shared_utils.toImportMetadata)(bootstrapModuleGraph, {imports: {}, index: {}}, moduleRegistry, runtimeEnvironment, runtimeParams);
113
110
  const customElementsRecords = [];
114
111
  const flattenedElements = (0, import_utils2.flattenCustomElements)(customElements, isSSR);
115
112
  for (const {tagName: element} of flattenedElements) {
@@ -131,7 +128,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
131
128
  imports[dynamicDep] = uri3;
132
129
  }
133
130
  }
134
- importMetadata = await (0, import_shared_utils.toImportMetadata)(graph, importMetadata, defRegistry, runtimeEnvironment, runtimeParams);
131
+ importMetadata = await (0, import_shared_utils.toImportMetadata)(graph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
135
132
  }
136
133
  configResources.unshift(await (0, import_utils2.getViewBootstrapConfigurationResource)({
137
134
  id: view.id,
@@ -81,7 +81,7 @@ async function generateInlineTag({specifier, type, content, stream, nonce}) {
81
81
  if (!content && !stream) {
82
82
  throw new Error(`Invalid inline Resource Definition: must have either "content" or "stream": "${specifier}"`);
83
83
  }
84
- const code = content ? content : await streamToString(stream);
84
+ const code = stream ? await streamToString(stream()) : content;
85
85
  return `<${tag}${typeStr}${nonceStr}>${code}</${tag}>`;
86
86
  }
87
87
  async function generateHtmlTag(definition) {
@@ -53,10 +53,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
53
53
  if (!def) {
54
54
  throw Error('Failed to find definition of resource: ' + shimBundle);
55
55
  }
56
- // HACK: preemptively closing the stream because it is never read
57
- if (def.stream) {
58
- def.stream.destroy();
59
- }
60
56
  requiredResources.push(def);
61
57
  // Always inline the error shim script after the shim
62
58
  const errorShimDef = (await resourceRegistry.getResource({ specifier: 'lwr-error-shim.js', version }, runtimeEnvironment, runtimeParams));
@@ -54,10 +54,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
54
54
  if (!def) {
55
55
  throw Error('Failed to find definition of resource: ' + shimBundle);
56
56
  }
57
- // HACK: preemptively closing the stream because it is never read
58
- if (def.stream) {
59
- def.stream.destroy();
60
- }
61
57
  requiredResources.push(def);
62
58
  // Always inline the error shim script after the shim
63
59
  const errorShimDef = (await resourceRegistry.getResource({ specifier: 'lwr-error-shim.js', version }, runtimeEnvironment, runtimeParams));
@@ -115,7 +111,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
115
111
  }
116
112
  }
117
113
  }
118
- let importMetadata = await toImportMetadata(bootstrapModuleGraph, { imports: {}, index: {} }, defRegistry, runtimeEnvironment, runtimeParams);
114
+ let importMetadata = await toImportMetadata(bootstrapModuleGraph, { imports: {}, index: {} }, moduleRegistry, runtimeEnvironment, runtimeParams);
119
115
  // ------- View related custom element moduleResources
120
116
  const customElementsRecords = [];
121
117
  const flattenedElements = flattenCustomElements(customElements, isSSR);
@@ -145,7 +141,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
145
141
  }
146
142
  }
147
143
  // eslint-disable-next-line no-await-in-loop
148
- importMetadata = await toImportMetadata(graph, importMetadata, defRegistry, runtimeEnvironment, runtimeParams);
144
+ importMetadata = await toImportMetadata(graph, importMetadata, moduleRegistry, runtimeEnvironment, runtimeParams);
149
145
  }
150
146
  // ADD configuration of the bootstrapModule
151
147
  configResources.unshift(await getViewBootstrapConfigurationResource({
package/build/es/utils.js CHANGED
@@ -48,7 +48,7 @@ async function generateInlineTag({ specifier, type, content, stream, nonce }) {
48
48
  if (!content && !stream) {
49
49
  throw new Error(`Invalid inline Resource Definition: must have either "content" or "stream": "${specifier}"`);
50
50
  }
51
- const code = content ? content : await streamToString(stream);
51
+ const code = stream ? await streamToString(stream()) : content;
52
52
  return `<${tag}${typeStr}${nonceStr}>${code}</${tag}>`;
53
53
  }
54
54
  export async function generateHtmlTag(definition) {
package/package.json CHANGED
@@ -4,15 +4,15 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.9.0-alpha.15",
7
+ "version": "0.9.0-alpha.17",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/salesforce/lwr.git",
11
+ "url": "https://github.com/salesforce-experience-platform-emu/lwr.git",
12
12
  "directory": "packages/@lwrjs/view-registry"
13
13
  },
14
14
  "bugs": {
15
- "url": "https://github.com/salesforce/lwr/issues"
15
+ "url": "https://github.com/salesforce-experience-platform-emu/lwr/issues"
16
16
  },
17
17
  "type": "module",
18
18
  "types": "build/es/index.d.ts",
@@ -30,15 +30,15 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.9.0-alpha.15",
34
- "@lwrjs/diagnostics": "0.9.0-alpha.15",
35
- "@lwrjs/shared-utils": "0.9.0-alpha.15"
33
+ "@lwrjs/app-service": "0.9.0-alpha.17",
34
+ "@lwrjs/diagnostics": "0.9.0-alpha.17",
35
+ "@lwrjs/shared-utils": "0.9.0-alpha.17"
36
36
  },
37
37
  "devDependencies": {
38
- "@lwrjs/types": "0.9.0-alpha.15"
38
+ "@lwrjs/types": "0.9.0-alpha.17"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=14.15.4 <19"
42
42
  },
43
- "gitHead": "f32f103d2d5e516daccce1be69f68acd7b4b86fb"
43
+ "gitHead": "447417ff091802927b25cfc1bcb01da02264f41b"
44
44
  }