@lwrjs/view-registry 0.12.0-alpha.6 → 0.12.0-alpha.7
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/index.cjs +3 -2
- package/build/cjs/utils.cjs +4 -2
- package/build/es/index.js +2 -1
- package/build/es/utils.d.ts +1 -1
- package/build/es/utils.js +2 -1
- package/package.json +7 -7
package/build/cjs/index.cjs
CHANGED
|
@@ -254,7 +254,8 @@ var LwrViewRegistry = class {
|
|
|
254
254
|
...renderedContent.metadata.serverDebug,
|
|
255
255
|
...renderedLayout.metadata.serverDebug
|
|
256
256
|
}
|
|
257
|
-
}
|
|
257
|
+
},
|
|
258
|
+
cache: renderedContent.cache
|
|
258
259
|
}, {
|
|
259
260
|
view: {...view, layoutTemplate: layoutTemplatePath},
|
|
260
261
|
viewParams,
|
|
@@ -308,7 +309,7 @@ var LwrViewRegistry = class {
|
|
|
308
309
|
importer: importer || renderedView.compiledView.filePath
|
|
309
310
|
};
|
|
310
311
|
const stringBuilder = (0, import_shared_utils.createStringBuilder)(renderedViewContent);
|
|
311
|
-
let pageTtl;
|
|
312
|
+
let pageTtl = renderedView.cache.ttl;
|
|
312
313
|
for (const viewTransformer of this.viewTransformers) {
|
|
313
314
|
const linkResults = await viewTransformer.link?.(stringBuilder, mergedViewContext, linkedMetadata);
|
|
314
315
|
const ttl = linkResults && linkResults.cache?.ttl;
|
package/build/cjs/utils.cjs
CHANGED
|
@@ -87,7 +87,8 @@ async function generateHtmlTag(definition) {
|
|
|
87
87
|
function normalizeRenderedResult({
|
|
88
88
|
renderedView,
|
|
89
89
|
metadata,
|
|
90
|
-
options
|
|
90
|
+
options,
|
|
91
|
+
cache
|
|
91
92
|
}) {
|
|
92
93
|
return {
|
|
93
94
|
renderedView,
|
|
@@ -99,7 +100,8 @@ function normalizeRenderedResult({
|
|
|
99
100
|
},
|
|
100
101
|
options: {
|
|
101
102
|
skipMetadataCollection: options ? options.skipMetadataCollection : false
|
|
102
|
-
}
|
|
103
|
+
},
|
|
104
|
+
cache: cache || {}
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function reduceSourceAssetReferences(assets) {
|
package/build/es/index.js
CHANGED
|
@@ -264,6 +264,7 @@ export class LwrViewRegistry {
|
|
|
264
264
|
...renderedLayout.metadata.serverDebug,
|
|
265
265
|
},
|
|
266
266
|
},
|
|
267
|
+
cache: renderedContent.cache,
|
|
267
268
|
},
|
|
268
269
|
// Render Content now contains a layout
|
|
269
270
|
{
|
|
@@ -322,7 +323,7 @@ export class LwrViewRegistry {
|
|
|
322
323
|
importer: importer || renderedView.compiledView.filePath,
|
|
323
324
|
};
|
|
324
325
|
const stringBuilder = createStringBuilder(renderedViewContent);
|
|
325
|
-
let pageTtl;
|
|
326
|
+
let pageTtl = renderedView.cache.ttl;
|
|
326
327
|
for (const viewTransformer of this.viewTransformers) {
|
|
327
328
|
// eslint-disable-next-line no-await-in-loop
|
|
328
329
|
const linkResults = await viewTransformer.link?.(stringBuilder, mergedViewContext, linkedMetadata);
|
package/build/es/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AssetReference, JsonCompatible, LinkedViewDefinition, LwrErrorRoute, LwrRoute, ModuleBundler, ModuleId, ModuleJson, ModuleRegistry, NormalizedRenderingResult, PublicModuleRegistry, RenderOptions, RenderedAssetReference, RenderingResult, ResourceDefinition, RouteHandlerViewResponse, RuntimeEnvironment, RuntimeParams, ViewModuleResourceContext, ViewPageContext, ViewRequest, ViewResponse } from '@lwrjs/types';
|
|
2
2
|
export type HTMLResource = Partial<ResourceDefinition>;
|
|
3
3
|
export declare function generateHtmlTag(definition: HTMLResource): Promise<string>;
|
|
4
|
-
export declare function normalizeRenderedResult({ renderedView, metadata, options, }: RenderingResult): NormalizedRenderingResult;
|
|
4
|
+
export declare function normalizeRenderedResult({ renderedView, metadata, options, cache, }: RenderingResult): NormalizedRenderingResult;
|
|
5
5
|
export declare function reduceSourceAssetReferences(assets: AssetReference[]): RenderedAssetReference[];
|
|
6
6
|
export declare function normalizeRenderOptions(runtimeEnvironment: RuntimeEnvironment, overrideRenderOptions?: RenderOptions, baseRenderOptions?: RenderOptions): Required<RenderOptions>;
|
|
7
7
|
export declare function generatePageContext({ requestPath: url }: ViewRequest, { id, contentTemplate, properties }: LwrRoute | LwrErrorRoute, runtimeParams: RuntimeParams): JsonCompatible<ViewPageContext>;
|
package/build/es/utils.js
CHANGED
|
@@ -52,7 +52,7 @@ export async function generateHtmlTag(definition) {
|
|
|
52
52
|
}
|
|
53
53
|
throw new Error(`Invalid external Resource Definition: missing a "src": "${definition.specifier}"`);
|
|
54
54
|
}
|
|
55
|
-
export function normalizeRenderedResult({ renderedView, metadata, options, }) {
|
|
55
|
+
export function normalizeRenderedResult({ renderedView, metadata, options, cache, }) {
|
|
56
56
|
return {
|
|
57
57
|
renderedView,
|
|
58
58
|
metadata: {
|
|
@@ -64,6 +64,7 @@ export function normalizeRenderedResult({ renderedView, metadata, options, }) {
|
|
|
64
64
|
options: {
|
|
65
65
|
skipMetadataCollection: options ? options.skipMetadataCollection : false,
|
|
66
66
|
},
|
|
67
|
+
cache: cache || {},
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
export function reduceSourceAssetReferences(assets) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.12.0-alpha.
|
|
7
|
+
"version": "0.12.0-alpha.7",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lwrjs/app-service": "0.12.0-alpha.
|
|
34
|
-
"@lwrjs/diagnostics": "0.12.0-alpha.
|
|
35
|
-
"@lwrjs/instrumentation": "0.12.0-alpha.
|
|
36
|
-
"@lwrjs/shared-utils": "0.12.0-alpha.
|
|
33
|
+
"@lwrjs/app-service": "0.12.0-alpha.7",
|
|
34
|
+
"@lwrjs/diagnostics": "0.12.0-alpha.7",
|
|
35
|
+
"@lwrjs/instrumentation": "0.12.0-alpha.7",
|
|
36
|
+
"@lwrjs/shared-utils": "0.12.0-alpha.7",
|
|
37
37
|
"lru-cache": "^10.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lwrjs/types": "0.12.0-alpha.
|
|
40
|
+
"@lwrjs/types": "0.12.0-alpha.7"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c60963c89e621d2e8af3389b0e075ded2f4bc810"
|
|
46
46
|
}
|