@lwrjs/view-registry 0.15.0-alpha.45 → 0.15.0-alpha.46
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 +6 -6
- package/build/cjs/utils.cjs +2 -2
- package/build/es/index.js +7 -7
- package/build/es/utils.d.ts +1 -1
- package/build/es/utils.js +2 -2
- package/package.json +7 -7
package/build/cjs/index.cjs
CHANGED
|
@@ -269,7 +269,7 @@ var LwrViewRegistry = class {
|
|
|
269
269
|
serverBundles: renderedContent.metadata.serverBundles
|
|
270
270
|
},
|
|
271
271
|
cache: renderedContent.cache,
|
|
272
|
-
|
|
272
|
+
status: renderedContent.status
|
|
273
273
|
}, {
|
|
274
274
|
view: {...view, layoutTemplate: layoutTemplatePath},
|
|
275
275
|
viewParams,
|
|
@@ -336,7 +336,7 @@ var LwrViewRegistry = class {
|
|
|
336
336
|
importer: importer || renderedView.compiledView.filePath
|
|
337
337
|
};
|
|
338
338
|
let pageTtl = renderedView.cache.ttl;
|
|
339
|
-
let
|
|
339
|
+
let pageStatus = renderedView.status;
|
|
340
340
|
for (const viewTransformer of this.viewTransformers) {
|
|
341
341
|
const linkResults = await (0, import_instrumentation.getTracer)().trace({
|
|
342
342
|
name: import_instrumentation.ViewSpan.Transform,
|
|
@@ -346,8 +346,8 @@ var LwrViewRegistry = class {
|
|
|
346
346
|
}, () => viewTransformer.link?.(stringBuilder, mergedViewContext, linkedMetadata));
|
|
347
347
|
const ttl = linkResults && linkResults.cache?.ttl;
|
|
348
348
|
pageTtl = (0, import_shared_utils.shortestTtl)(ttl || void 0, pageTtl);
|
|
349
|
-
if (!
|
|
350
|
-
|
|
349
|
+
if (!pageStatus && linkResults) {
|
|
350
|
+
pageStatus = linkResults.status;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
const linkedAssetContent = stringBuilder.toString();
|
|
@@ -384,7 +384,7 @@ var LwrViewRegistry = class {
|
|
|
384
384
|
serverBundles: linkedMetadata.serverBundles
|
|
385
385
|
},
|
|
386
386
|
cache: {ttl: pageTtl},
|
|
387
|
-
|
|
387
|
+
status: pageStatus
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
return {
|
|
@@ -396,7 +396,7 @@ var LwrViewRegistry = class {
|
|
|
396
396
|
serverBundles: linkedMetadata.serverBundles
|
|
397
397
|
},
|
|
398
398
|
cache: {ttl: pageTtl},
|
|
399
|
-
|
|
399
|
+
status: pageStatus
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
};
|
package/build/cjs/utils.cjs
CHANGED
|
@@ -113,7 +113,7 @@ function normalizeRenderedResult({
|
|
|
113
113
|
metadata,
|
|
114
114
|
options,
|
|
115
115
|
cache,
|
|
116
|
-
|
|
116
|
+
status
|
|
117
117
|
}) {
|
|
118
118
|
return {
|
|
119
119
|
renderedView,
|
|
@@ -128,7 +128,7 @@ function normalizeRenderedResult({
|
|
|
128
128
|
skipMetadataCollection: options ? options.skipMetadataCollection : false
|
|
129
129
|
},
|
|
130
130
|
cache: cache || {},
|
|
131
|
-
|
|
131
|
+
status
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
function reduceSourceAssetReferences(assets) {
|
package/build/es/index.js
CHANGED
|
@@ -292,7 +292,7 @@ export class LwrViewRegistry {
|
|
|
292
292
|
serverBundles: renderedContent.metadata.serverBundles, // 1st pass of SSR
|
|
293
293
|
},
|
|
294
294
|
cache: renderedContent.cache,
|
|
295
|
-
|
|
295
|
+
status: renderedContent.status,
|
|
296
296
|
},
|
|
297
297
|
// Render Content now contains a layout
|
|
298
298
|
{
|
|
@@ -364,7 +364,7 @@ export class LwrViewRegistry {
|
|
|
364
364
|
};
|
|
365
365
|
// Note: this is the TTL for the page NOT for the view registry cache
|
|
366
366
|
let pageTtl = renderedView.cache.ttl;
|
|
367
|
-
let
|
|
367
|
+
let pageStatus = renderedView.status;
|
|
368
368
|
for (const viewTransformer of this.viewTransformers) {
|
|
369
369
|
// eslint-disable-next-line no-await-in-loop
|
|
370
370
|
const linkResults = await getTracer().trace({
|
|
@@ -376,9 +376,9 @@ export class LwrViewRegistry {
|
|
|
376
376
|
// Keep track of the shortest TTL from each view transformer (e.g. lwcSsrViewTransformer)
|
|
377
377
|
const ttl = linkResults && linkResults.cache?.ttl;
|
|
378
378
|
pageTtl = shortestTtl(ttl || undefined, pageTtl);
|
|
379
|
-
// Set the
|
|
380
|
-
if (!
|
|
381
|
-
|
|
379
|
+
// Set the status info, if it doesn't already exist
|
|
380
|
+
if (!pageStatus && linkResults) {
|
|
381
|
+
pageStatus = linkResults.status;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
const linkedAssetContent = stringBuilder.toString();
|
|
@@ -420,7 +420,7 @@ export class LwrViewRegistry {
|
|
|
420
420
|
serverBundles: linkedMetadata.serverBundles,
|
|
421
421
|
},
|
|
422
422
|
cache: { ttl: pageTtl },
|
|
423
|
-
|
|
423
|
+
status: pageStatus,
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
426
|
return {
|
|
@@ -432,7 +432,7 @@ export class LwrViewRegistry {
|
|
|
432
432
|
serverBundles: linkedMetadata.serverBundles,
|
|
433
433
|
},
|
|
434
434
|
cache: { ttl: pageTtl },
|
|
435
|
-
|
|
435
|
+
status: pageStatus,
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
}
|
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, ViewParams, ViewRequest, ViewResponse, ViewDefinitionResponse, View } 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, cache,
|
|
4
|
+
export declare function normalizeRenderedResult({ renderedView, metadata, options, cache, status, }: 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
|
@@ -66,7 +66,7 @@ export async function generateHtmlTag(definition) {
|
|
|
66
66
|
}
|
|
67
67
|
throw new Error(`Invalid external Resource Definition: missing a "src": "${definition.specifier}"`);
|
|
68
68
|
}
|
|
69
|
-
export function normalizeRenderedResult({ renderedView, metadata, options, cache,
|
|
69
|
+
export function normalizeRenderedResult({ renderedView, metadata, options, cache, status, }) {
|
|
70
70
|
return {
|
|
71
71
|
renderedView,
|
|
72
72
|
metadata: {
|
|
@@ -80,7 +80,7 @@ export function normalizeRenderedResult({ renderedView, metadata, options, cache
|
|
|
80
80
|
skipMetadataCollection: options ? options.skipMetadataCollection : false,
|
|
81
81
|
},
|
|
82
82
|
cache: cache || {},
|
|
83
|
-
|
|
83
|
+
status,
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
export function reduceSourceAssetReferences(assets) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.15.0-alpha.
|
|
7
|
+
"version": "0.15.0-alpha.46",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"build": "tsc -b"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/app-service": "0.15.0-alpha.
|
|
37
|
-
"@lwrjs/diagnostics": "0.15.0-alpha.
|
|
38
|
-
"@lwrjs/instrumentation": "0.15.0-alpha.
|
|
39
|
-
"@lwrjs/shared-utils": "0.15.0-alpha.
|
|
36
|
+
"@lwrjs/app-service": "0.15.0-alpha.46",
|
|
37
|
+
"@lwrjs/diagnostics": "0.15.0-alpha.46",
|
|
38
|
+
"@lwrjs/instrumentation": "0.15.0-alpha.46",
|
|
39
|
+
"@lwrjs/shared-utils": "0.15.0-alpha.46",
|
|
40
40
|
"lru-cache": "^10.4.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@lwrjs/types": "0.15.0-alpha.
|
|
43
|
+
"@lwrjs/types": "0.15.0-alpha.46"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=18.0.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"volta": {
|
|
49
49
|
"extends": "../../../package.json"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "366b77f76c34626c9449da0042766fc107cc6b8f"
|
|
52
52
|
}
|