@lwrjs/view-registry 0.9.0-alpha.24 → 0.9.0-alpha.27
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/cjs/linkers/legacy_view_bootstrap.cjs +1 -1
- package/build/cjs/linkers/utils.cjs +1 -1
- package/build/cjs/linkers/view_bootstrap.cjs +1 -1
- package/build/es/linkers/legacy_view_bootstrap.js +3 -3
- package/build/es/linkers/utils.js +2 -1
- package/build/es/linkers/view_bootstrap.js +2 -2
- package/package.json +6 -6
|
@@ -109,7 +109,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
|
|
|
109
109
|
const customElementsRecords = [];
|
|
110
110
|
const flattenedElements = (0, import_utils2.flattenCustomElements)(customElements, isSSR);
|
|
111
111
|
await Promise.all(flattenedElements.map(async ({tagName: element, props}) => {
|
|
112
|
-
const graph = await (0, import_shared_utils.getModuleGraphs)((0, import_shared_utils.
|
|
112
|
+
const graph = await (0, import_shared_utils.getModuleGraphs)((0, import_shared_utils.kebabCaseToModuleSpecifier)(element), {includeUris: true, includeLinkedDefinitions: true, depth}, moduleRegistry, bundle ? moduleBundler : moduleRegistry, runtimeEnvironment, runtimeParams ? runtimeParams : {}, visitedCache);
|
|
113
113
|
customElementsRecords.push({elementName: element, flatGraph: graph});
|
|
114
114
|
const specifier = graph.graphs[0].specifier;
|
|
115
115
|
const uri2 = graph.uriMap[specifier];
|
|
@@ -53,7 +53,7 @@ function getViewBootstrapConfigurationResource(viewInfo, config, runtimeEnvironm
|
|
|
53
53
|
...config,
|
|
54
54
|
endpoints
|
|
55
55
|
})});`,
|
|
56
|
-
`globalThis.process = { env: { NODE_ENV: "${runtimeEnvironment.
|
|
56
|
+
`globalThis.process = { env: { NODE_ENV: "${runtimeEnvironment.serverMode}" } };`
|
|
57
57
|
].filter(Boolean).join("\n");
|
|
58
58
|
if (viewInfo.configAsSrc) {
|
|
59
59
|
const viewUrl = viewInfo.url || "/";
|
|
@@ -110,7 +110,7 @@ async function getHtmlResources(view, viewParams, resourceContext) {
|
|
|
110
110
|
const customElementsRecords = [];
|
|
111
111
|
const flattenedElements = (0, import_utils2.flattenCustomElements)(customElements, isSSR);
|
|
112
112
|
for (const {tagName: element} of flattenedElements) {
|
|
113
|
-
const graph = await (0, import_shared_utils.getModuleGraphs)((0, import_shared_utils.
|
|
113
|
+
const graph = await (0, import_shared_utils.getModuleGraphs)((0, import_shared_utils.kebabCaseToModuleSpecifier)(element), {includeUris: true, includeLinkedDefinitions: true, depth}, moduleRegistry, defRegistry, runtimeEnvironment, runtimeParams ? runtimeParams : {}, visitedCache);
|
|
114
114
|
customElementsRecords.push({elementName: element, flatGraph: graph});
|
|
115
115
|
const specifier = graph.graphs[0].specifier;
|
|
116
116
|
const uri2 = graph.uriMap[specifier];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { kebabCaseToModuleSpecifier, getModuleGraphs, GraphDepth, getModuleUriPrefix, logger, } from '@lwrjs/shared-utils';
|
|
2
2
|
import { AppResourceEnum, getAppSpecifier } from '@lwrjs/app-service/identity';
|
|
3
3
|
import { generateHtmlTag, getModuleResource, getModuleResourceByUri } from '../utils.js';
|
|
4
4
|
import { flattenCustomElements, getViewBootstrapConfigurationResource, getViewHmrConfigurationResource, } from './utils.js';
|
|
@@ -76,7 +76,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
|
|
|
76
76
|
}
|
|
77
77
|
// ------- Application Bootstrap module
|
|
78
78
|
// Traversal of the Bootstrap Module Graph is done to get all the URLS for discoverable static dependencies.
|
|
79
|
-
// Reasoning: This is to avoid
|
|
79
|
+
// Reasoning: This is to avoid unnecessary HTTP 302's during initial application module fetching.
|
|
80
80
|
// Scope: ESM currently only exposes immutable URI references, optimize for AMD formats
|
|
81
81
|
const depth = isAMD
|
|
82
82
|
? { static: GraphDepth.ALL, dynamic: 1 }
|
|
@@ -118,7 +118,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
|
|
|
118
118
|
const customElementsRecords = [];
|
|
119
119
|
const flattenedElements = flattenCustomElements(customElements, isSSR);
|
|
120
120
|
await Promise.all(flattenedElements.map(async ({ tagName: element, props }) => {
|
|
121
|
-
const graph = await getModuleGraphs(
|
|
121
|
+
const graph = await getModuleGraphs(kebabCaseToModuleSpecifier(element), { includeUris: true, includeLinkedDefinitions: true, depth }, moduleRegistry, bundle ? moduleBundler : moduleRegistry, runtimeEnvironment, runtimeParams ? runtimeParams : {}, visitedCache);
|
|
122
122
|
// add to the viewRecord
|
|
123
123
|
customElementsRecords.push({ elementName: element, flatGraph: graph });
|
|
124
124
|
// PRELOAD custom element static deps as link resource
|
|
@@ -25,7 +25,8 @@ export function getViewBootstrapConfigurationResource(viewInfo, config, runtimeE
|
|
|
25
25
|
...config,
|
|
26
26
|
endpoints,
|
|
27
27
|
})});`,
|
|
28
|
-
|
|
28
|
+
// TODO: W-12639529 change after addressing downstream customers
|
|
29
|
+
`globalThis.process = { env: { NODE_ENV: "${runtimeEnvironment.serverMode}" } };`,
|
|
29
30
|
]
|
|
30
31
|
.filter(Boolean)
|
|
31
32
|
.join('\n');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { kebabCaseToModuleSpecifier, toImportMetadata, getModuleGraphs, getMappingUriPrefix, GraphDepth, logger, } from '@lwrjs/shared-utils';
|
|
2
2
|
import { AppResourceEnum, getAppSpecifier } from '@lwrjs/app-service/identity';
|
|
3
3
|
import { generateHtmlTag, getModuleResource, getModuleResourceByUri } from '../utils.js';
|
|
4
4
|
import { flattenCustomElements, getViewBootstrapConfigurationResource, getViewHmrConfigurationResource, } from './utils.js';
|
|
@@ -119,7 +119,7 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
|
|
|
119
119
|
const flattenedElements = flattenCustomElements(customElements, isSSR);
|
|
120
120
|
for (const { tagName: element } of flattenedElements) {
|
|
121
121
|
// eslint-disable-next-line no-await-in-loop
|
|
122
|
-
const graph = await getModuleGraphs(
|
|
122
|
+
const graph = await getModuleGraphs(kebabCaseToModuleSpecifier(element), { includeUris: true, includeLinkedDefinitions: true, depth }, moduleRegistry, defRegistry, runtimeEnvironment, runtimeParams ? runtimeParams : {}, visitedCache);
|
|
123
123
|
// add to the viewRecord
|
|
124
124
|
customElementsRecords.push({ elementName: element, flatGraph: graph });
|
|
125
125
|
// PRELOAD custom element static deps as link resource
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.9.0-alpha.
|
|
7
|
+
"version": "0.9.0-alpha.27",
|
|
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/app-service": "0.9.0-alpha.
|
|
34
|
-
"@lwrjs/diagnostics": "0.9.0-alpha.
|
|
35
|
-
"@lwrjs/shared-utils": "0.9.0-alpha.
|
|
33
|
+
"@lwrjs/app-service": "0.9.0-alpha.27",
|
|
34
|
+
"@lwrjs/diagnostics": "0.9.0-alpha.27",
|
|
35
|
+
"@lwrjs/shared-utils": "0.9.0-alpha.27"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@lwrjs/types": "0.9.0-alpha.
|
|
38
|
+
"@lwrjs/types": "0.9.0-alpha.27"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=16.0.0 <20"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a7fcd8493b8a3286197e829b28b54670e7d4e97c"
|
|
44
44
|
}
|