veryfront 0.1.840 → 0.1.842
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/esm/deno.js +1 -1
- package/esm/src/cache/keys/prefixes.d.ts +3 -3
- package/esm/src/cache/keys/prefixes.d.ts.map +1 -1
- package/esm/src/cache/keys/prefixes.js +14 -0
- package/esm/src/cache/keys/utils.d.ts.map +1 -1
- package/esm/src/cache/keys/utils.js +18 -9
- package/esm/src/config/schemas/config.schema.d.ts +4 -4
- package/esm/src/config/schemas/config.schema.js +2 -2
- package/esm/src/release-assets/build-executor.d.ts +2 -2
- package/esm/src/release-assets/build-executor.d.ts.map +1 -1
- package/esm/src/release-assets/build-executor.js +26 -56
- package/esm/src/rendering/renderer.d.ts +2 -2
- package/esm/src/rendering/renderer.js +2 -2
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +3 -10
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -36,13 +36,13 @@ export type FileSourceType = "branch" | "release" | "environment";
|
|
|
36
36
|
* Query parameter handling policy for cache keys.
|
|
37
37
|
*
|
|
38
38
|
* - "ignore-all": Ignore all query params (best for marketing UTM params)
|
|
39
|
-
* - "include-all": Include all query params in cache key
|
|
39
|
+
* - "include-all": Include all query params in cache key
|
|
40
40
|
* - "include-list": Only include specified params
|
|
41
|
-
* - "exclude-list": Include all except specified params
|
|
41
|
+
* - "exclude-list": Include all except specified params (default behavior)
|
|
42
42
|
*/
|
|
43
43
|
export type QueryParamPolicy = "ignore-all" | "include-all" | "include-list" | "exclude-list";
|
|
44
44
|
export interface QueryParamCacheOptions {
|
|
45
|
-
/** How to handle query params. Default: "
|
|
45
|
+
/** How to handle query params. Default: "exclude-list" */
|
|
46
46
|
policy?: QueryParamPolicy;
|
|
47
47
|
/** List of param names for include-list or exclude-list policies */
|
|
48
48
|
params?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefixes.d.ts","sourceRoot":"","sources":["../../../../src/src/cache/keys/prefixes.ts"],"names":[],"mappings":"AAAA;;;;;;kFAMkF;AAElF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CA0CjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,
|
|
1
|
+
{"version":3,"file":"prefixes.d.ts","sourceRoot":"","sources":["../../../../src/src/cache/keys/prefixes.ts"],"names":[],"mappings":"AAAA;;;;;;kFAMkF;AAElF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CA0CjB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6FAA6F;AAC7F,eAAO,MAAM,6BAA6B,UA+CzC,CAAC"}
|
|
@@ -58,20 +58,34 @@ export const DEFAULT_EXCLUDED_QUERY_PARAMS = [
|
|
|
58
58
|
"dclid",
|
|
59
59
|
"_ga",
|
|
60
60
|
"_gl",
|
|
61
|
+
"gad_source",
|
|
62
|
+
"gbraid",
|
|
63
|
+
"wbraid",
|
|
61
64
|
// Facebook
|
|
62
65
|
"fbclid",
|
|
63
66
|
"fb_action_ids",
|
|
64
67
|
"fb_action_types",
|
|
68
|
+
// LinkedIn
|
|
69
|
+
"li_fat_id",
|
|
65
70
|
// Microsoft / Bing
|
|
66
71
|
"msclkid",
|
|
67
72
|
// Mailchimp
|
|
68
73
|
"mc_cid",
|
|
69
74
|
"mc_eid",
|
|
75
|
+
// Cache-busting probes
|
|
76
|
+
"_",
|
|
77
|
+
"cb",
|
|
78
|
+
"cacheBust",
|
|
79
|
+
"cache_bust",
|
|
80
|
+
"cachebuster",
|
|
81
|
+
"cache_buster",
|
|
70
82
|
// Other tracking
|
|
71
83
|
"ref",
|
|
72
84
|
"referrer",
|
|
73
85
|
"source",
|
|
74
86
|
"_openstat",
|
|
87
|
+
"igshid",
|
|
88
|
+
"twclid",
|
|
75
89
|
"yclid",
|
|
76
90
|
"zanpid",
|
|
77
91
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/src/cache/keys/utils.ts"],"names":[],"mappings":"AAAA;;;;;;kFAMkF;AASlF,OAAO,EAAiC,KAAK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AM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAE7E;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,YAAY,GAAE,OAAc,GAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAU1E;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAW1D"}
|
|
@@ -10,6 +10,7 @@ import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
|
10
10
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
11
11
|
import { cacheRegistry } from "../registry.js";
|
|
12
12
|
import { DEFAULT_EXCLUDED_QUERY_PARAMS } from "./prefixes.js";
|
|
13
|
+
const querySegmentEncoder = new TextEncoder();
|
|
13
14
|
export function parseRenderCacheKey(cacheKey) {
|
|
14
15
|
const parts = cacheKey.split(":");
|
|
15
16
|
if (parts.length < 5)
|
|
@@ -89,15 +90,17 @@ export function filterQueryParams(params, options) {
|
|
|
89
90
|
case "include-list":
|
|
90
91
|
return entries.filter(([key]) => paramList.includes(key));
|
|
91
92
|
case "exclude-list": {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return entries.filter(([key]) => !excludeSet.has(key));
|
|
93
|
+
const excludeSet = new Set([...DEFAULT_EXCLUDED_QUERY_PARAMS, ...paramList].map(normalizeQueryParamName));
|
|
94
|
+
return entries.filter(([key]) => !excludeSet.has(normalizeQueryParamName(key)));
|
|
95
95
|
}
|
|
96
96
|
case "include-all":
|
|
97
97
|
default:
|
|
98
98
|
return entries;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
function normalizeQueryParamName(param) {
|
|
102
|
+
return param.toLowerCase();
|
|
103
|
+
}
|
|
101
104
|
/**
|
|
102
105
|
* Sanitize query params for use in cache keys.
|
|
103
106
|
* Converts query params to a format safe for API cache key validation.
|
|
@@ -114,22 +117,28 @@ export function sanitizeQueryParamsForCacheKey(url, options) {
|
|
|
114
117
|
const filtered = filterQueryParams(params, options);
|
|
115
118
|
if (filtered.length === 0)
|
|
116
119
|
return "";
|
|
117
|
-
// Sort for consistent ordering
|
|
118
|
-
const sorted = filtered.sort(([
|
|
120
|
+
// Sort for consistent ordering, including duplicate keys.
|
|
121
|
+
const sorted = filtered.sort(([leftKey, leftValue], [rightKey, rightValue]) => leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey));
|
|
119
122
|
// Build sanitized string using allowed characters:
|
|
120
123
|
// - Use hyphen (-) instead of equals (=)
|
|
121
124
|
// - Use underscore (_) instead of ampersand (&)
|
|
122
|
-
// -
|
|
125
|
+
// - Percent-encode special characters using * as the escape marker
|
|
123
126
|
const sanitized = sorted
|
|
124
127
|
.map(([key, value]) => {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
const safeValue = value.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
128
|
+
const safeKey = encodeCacheKeySegment(key);
|
|
129
|
+
const safeValue = encodeCacheKeySegment(value);
|
|
128
130
|
return `${safeKey}-${safeValue}`;
|
|
129
131
|
})
|
|
130
132
|
.join("_");
|
|
131
133
|
return sanitized;
|
|
132
134
|
}
|
|
135
|
+
function encodeCacheKeySegment(value) {
|
|
136
|
+
return Array.from(value, (char) => {
|
|
137
|
+
if (/^[a-zA-Z0-9_.-]$/.test(char))
|
|
138
|
+
return char;
|
|
139
|
+
return Array.from(querySegmentEncoder.encode(char), (byte) => `*${byte.toString(16).toUpperCase().padStart(2, "0")}`).join("");
|
|
140
|
+
}).join("");
|
|
141
|
+
}
|
|
133
142
|
export function createCacheKeyFilter(options) {
|
|
134
143
|
return (key) => {
|
|
135
144
|
const parts = key.split(":");
|
|
@@ -57,9 +57,9 @@ export declare const getVeryfrontConfigSchema: () => import("../../internal-agen
|
|
|
57
57
|
*
|
|
58
58
|
* Policies:
|
|
59
59
|
* - "ignore-all": Ignore all query params (pages with ?utm_campaign=x share cache with /)
|
|
60
|
-
* - "include-all": Include all query params (
|
|
60
|
+
* - "include-all": Include all query params (each unique query = separate cache)
|
|
61
61
|
* - "include-list": Only include specified params in cache key
|
|
62
|
-
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*)
|
|
62
|
+
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*) (default)
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* // Ignore all marketing/tracking params (recommended for most sites)
|
|
@@ -461,9 +461,9 @@ export declare const veryfrontConfigSchema: import("../../internal-agents/schema
|
|
|
461
461
|
*
|
|
462
462
|
* Policies:
|
|
463
463
|
* - "ignore-all": Ignore all query params (pages with ?utm_campaign=x share cache with /)
|
|
464
|
-
* - "include-all": Include all query params (
|
|
464
|
+
* - "include-all": Include all query params (each unique query = separate cache)
|
|
465
465
|
* - "include-list": Only include specified params in cache key
|
|
466
|
-
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*)
|
|
466
|
+
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*) (default)
|
|
467
467
|
*
|
|
468
468
|
* @example
|
|
469
469
|
* // Ignore all marketing/tracking params (recommended for most sites)
|
|
@@ -97,9 +97,9 @@ export const getVeryfrontConfigSchema = defineSchema((v) => v
|
|
|
97
97
|
*
|
|
98
98
|
* Policies:
|
|
99
99
|
* - "ignore-all": Ignore all query params (pages with ?utm_campaign=x share cache with /)
|
|
100
|
-
* - "include-all": Include all query params (
|
|
100
|
+
* - "include-all": Include all query params (each unique query = separate cache)
|
|
101
101
|
* - "include-list": Only include specified params in cache key
|
|
102
|
-
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*)
|
|
102
|
+
* - "exclude-list": Exclude specified params (+ common tracking params like utm_*) (default)
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
105
|
* // Ignore all marketing/tracking params (recommended for most sites)
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* uploads each asset, then assembles and PUTs the manifest (→ ready).
|
|
9
9
|
*
|
|
10
10
|
* Defensive by construction:
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
11
|
+
* - Browser graph failures that can fall back to JIT are recorded as gaps.
|
|
12
|
+
* - Other build failures (list/hash/upload/PUT) report `failed`.
|
|
13
13
|
* - The temp dir is always cleaned up by the caller.
|
|
14
14
|
*
|
|
15
15
|
* @module release-assets/build-executor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+BH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA0B/C,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,MAAM,EAAE,uBAAuB,CAAC;IAChC,sDAAsD;IAEtD,OAAO,EAAE,GAAG,CAAC;IACb;;;;OAIG;IACH,SA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AAE,aAAa,CAAC,CAAC;IAC5C,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC,CAqCD;AA4DD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC,CA2ClC"}
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
* uploads each asset, then assembles and PUTs the manifest (→ ready).
|
|
9
9
|
*
|
|
10
10
|
* Defensive by construction:
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
11
|
+
* - Browser graph failures that can fall back to JIT are recorded as gaps.
|
|
12
|
+
* - Other build failures (list/hash/upload/PUT) report `failed`.
|
|
13
13
|
* - The temp dir is always cleaned up by the caller.
|
|
14
14
|
*
|
|
15
15
|
* @module release-assets/build-executor
|
|
16
16
|
*/
|
|
17
17
|
import { serverLogger } from "../utils/index.js";
|
|
18
18
|
import { VERSION } from "../utils/version.js";
|
|
19
|
-
import { resolve } from "../extensions/contracts.js";
|
|
20
19
|
import { createFileSystem } from "../platform/compat/fs.js";
|
|
21
20
|
import { getHostEnv } from "../platform/compat/process.js";
|
|
22
21
|
import { dirname, join, normalize } from "../platform/compat/path/index.js";
|
|
@@ -88,46 +87,6 @@ function isBrowserModule(path) {
|
|
|
88
87
|
return false;
|
|
89
88
|
return BROWSER_MODULE_DIRS.some((dir) => path.startsWith(dir));
|
|
90
89
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Statically resolve runtime imports in a TS/JSX source file to logical paths.
|
|
93
|
-
* Uses the CodeParser AST contract so type-only imports do not enter route
|
|
94
|
-
* preload closure.
|
|
95
|
-
*/
|
|
96
|
-
async function collectStaticProjectModuleImports(source, moduleLogicalPath, knownPaths) {
|
|
97
|
-
return await collectAstStaticProjectModuleImports(source, moduleLogicalPath, knownPaths);
|
|
98
|
-
}
|
|
99
|
-
function readModuleSource(node) {
|
|
100
|
-
return typeof node.source?.value === "string" ? node.source.value : null;
|
|
101
|
-
}
|
|
102
|
-
function isTypeOnlyModuleDeclaration(node) {
|
|
103
|
-
if (node.importKind === "type" || node.exportKind === "type")
|
|
104
|
-
return true;
|
|
105
|
-
if (!node.specifiers?.length)
|
|
106
|
-
return false;
|
|
107
|
-
return node.specifiers.every((specifier) => specifier.importKind === "type" || specifier.exportKind === "type");
|
|
108
|
-
}
|
|
109
|
-
async function collectAstStaticProjectModuleImports(source, moduleLogicalPath, knownPaths) {
|
|
110
|
-
const parser = resolve("CodeParser");
|
|
111
|
-
const ast = await parser.parse({ code: source, filePath: moduleLogicalPath });
|
|
112
|
-
const results = new Set();
|
|
113
|
-
const visit = (path) => {
|
|
114
|
-
const node = path.node;
|
|
115
|
-
if (isTypeOnlyModuleDeclaration(node))
|
|
116
|
-
return;
|
|
117
|
-
const specifier = readModuleSource(node);
|
|
118
|
-
if (!specifier)
|
|
119
|
-
return;
|
|
120
|
-
const importedPath = resolveProjectModuleSpecifier(specifier, moduleLogicalPath, knownPaths);
|
|
121
|
-
if (importedPath)
|
|
122
|
-
results.add(importedPath);
|
|
123
|
-
};
|
|
124
|
-
parser.traverse(ast, {
|
|
125
|
-
ImportDeclaration: visit,
|
|
126
|
-
ExportNamedDeclaration: visit,
|
|
127
|
-
ExportAllDeclaration: visit,
|
|
128
|
-
});
|
|
129
|
-
return [...results];
|
|
130
|
-
}
|
|
131
90
|
function resolveKnownModulePath(path, knownPaths) {
|
|
132
91
|
const normalized = normalizeLogicalPath(path
|
|
133
92
|
.replace(/^\/?_vf_modules\//, "")
|
|
@@ -956,11 +915,11 @@ function addFrameworkDependencyUrlAliases(urls, dependencies) {
|
|
|
956
915
|
}
|
|
957
916
|
}
|
|
958
917
|
/**
|
|
959
|
-
* Walk the
|
|
918
|
+
* Walk the transformed import graph from a set of entry points using BFS.
|
|
960
919
|
* Returns all reachable logical paths (entries included).
|
|
961
|
-
* Modules not in `
|
|
920
|
+
* Modules not in `transformedModules` are recorded as closure gaps.
|
|
962
921
|
*/
|
|
963
|
-
async function
|
|
922
|
+
async function collectRouteClosure(entrypoints, transformedModules, knownPaths) {
|
|
964
923
|
const visited = new Set();
|
|
965
924
|
const queue = [...entrypoints];
|
|
966
925
|
const gaps = [];
|
|
@@ -969,16 +928,27 @@ async function collectClosure(entrypoints, sourceByPath, knownPaths) {
|
|
|
969
928
|
if (visited.has(current))
|
|
970
929
|
continue;
|
|
971
930
|
visited.add(current);
|
|
972
|
-
const
|
|
973
|
-
if (!
|
|
974
|
-
// Module referenced but not
|
|
931
|
+
const transformed = transformedModules.get(current);
|
|
932
|
+
if (!transformed) {
|
|
933
|
+
// Module referenced but not transformable or not successfully transformed.
|
|
975
934
|
gaps.push(`closure-missing:${current}`);
|
|
976
935
|
continue;
|
|
977
936
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
937
|
+
let imports;
|
|
938
|
+
try {
|
|
939
|
+
imports = await collectProjectModuleImports(transformed.code, current, knownPaths);
|
|
940
|
+
}
|
|
941
|
+
catch (error) {
|
|
942
|
+
pushGap(gaps, `closure-import-parse-failed:${current}`);
|
|
943
|
+
logger.warn("Route closure import parse failed during release asset build", {
|
|
944
|
+
path: current,
|
|
945
|
+
error: sanitizeError(error),
|
|
946
|
+
});
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
for (const importedPath of imports.values()) {
|
|
950
|
+
if (!visited.has(importedPath))
|
|
951
|
+
queue.push(importedPath);
|
|
982
952
|
}
|
|
983
953
|
}
|
|
984
954
|
return { modules: [...visited], gaps };
|
|
@@ -1248,15 +1218,15 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
1248
1218
|
// M3: drop bytes immediately after upload.
|
|
1249
1219
|
pendingBytes.delete(asset.contentHash);
|
|
1250
1220
|
});
|
|
1251
|
-
// B2. Routes: walk the
|
|
1252
|
-
// Modules
|
|
1221
|
+
// B2. Routes: walk the transformed browser import closure from each page entrypoint.
|
|
1222
|
+
// Modules missing from transformedModules are recorded as closure gaps.
|
|
1253
1223
|
const routes = {};
|
|
1254
1224
|
const pageModules = Object.keys(modules).filter((p) => p.startsWith("pages/"));
|
|
1255
1225
|
for (const logicalPath of pageModules) {
|
|
1256
1226
|
const route = routeForPage(logicalPath);
|
|
1257
1227
|
if (!route)
|
|
1258
1228
|
continue;
|
|
1259
|
-
const { modules: closureModules, gaps: closureGaps } = await
|
|
1229
|
+
const { modules: closureModules, gaps: closureGaps } = await collectRouteClosure([logicalPath], transformedModules, knownPaths);
|
|
1260
1230
|
// Include only modules we actually have in the manifest (transformed +
|
|
1261
1231
|
// within size limit). Framework lib/* modules are excluded per contract
|
|
1262
1232
|
// (they are embedded by the runtime, not shipped as release assets).
|
|
@@ -57,9 +57,9 @@ export declare class Renderer {
|
|
|
57
57
|
*
|
|
58
58
|
* Query param handling is configurable via `config.cache.queryParams`:
|
|
59
59
|
* - "ignore-all": Ignore all query params (pages share cache regardless of URL params)
|
|
60
|
-
* - "include-all": Include all query params (
|
|
60
|
+
* - "include-all": Include all query params (each unique query = separate cache)
|
|
61
61
|
* - "include-list": Only include specified params
|
|
62
|
-
* - "exclude-list": Exclude common tracking params (
|
|
62
|
+
* - "exclude-list": Exclude common tracking/cache-busting params (default)
|
|
63
63
|
*/
|
|
64
64
|
private buildCacheKey;
|
|
65
65
|
private doRenderPage;
|
|
@@ -216,9 +216,9 @@ export class Renderer {
|
|
|
216
216
|
*
|
|
217
217
|
* Query param handling is configurable via `config.cache.queryParams`:
|
|
218
218
|
* - "ignore-all": Ignore all query params (pages share cache regardless of URL params)
|
|
219
|
-
* - "include-all": Include all query params (
|
|
219
|
+
* - "include-all": Include all query params (each unique query = separate cache)
|
|
220
220
|
* - "include-list": Only include specified params
|
|
221
|
-
* - "exclude-list": Exclude common tracking params (
|
|
221
|
+
* - "exclude-list": Exclude common tracking/cache-busting params (default)
|
|
222
222
|
*/
|
|
223
223
|
buildCacheKey(slug, ctx, options) {
|
|
224
224
|
if (options?.cacheKey)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-data-endpoint-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/request/module/page-data-endpoint-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"page-data-endpoint-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/request/module/page-data-endpoint-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8EhE,wBAAgB,oCAAoC,IAAI,IAAI,CAE3D;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,cAAc,EACnB,qBAAqB,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,eAAe,EAC/D,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,aAAa,EAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,GAC1C,OAAO,CAAC,aAAa,CAAC,CA6GxB"}
|
|
@@ -8,6 +8,7 @@ import { HTTP_GATEWAY_TIMEOUT } from "../../../../utils/constants/http.js";
|
|
|
8
8
|
import { serverLogger } from "../../../../utils/index.js";
|
|
9
9
|
import { Singleflight } from "../../../../utils/singleflight.js";
|
|
10
10
|
import { requestHasCacheSensitiveState } from "../../../../cache/request-cacheability.js";
|
|
11
|
+
import { sanitizeQueryParamsForCacheKey, } from "../../../../cache/keys.js";
|
|
11
12
|
import { getEnv } from "../../../../platform/compat/process.js";
|
|
12
13
|
const PAGE_DATA_TIMEOUT_MS = 25_000;
|
|
13
14
|
const PAGE_DATA_CACHE_TTL_MS = readPositiveIntegerEnv("VERYFRONT_PAGE_DATA_CACHE_TTL_MS", 60_000);
|
|
@@ -216,7 +217,8 @@ function buildPageDataCacheKey(ctx, slug, url) {
|
|
|
216
217
|
(environment === "production"
|
|
217
218
|
? ctx.releaseId ?? "release"
|
|
218
219
|
: ctx.requestContext?.branch ?? "main");
|
|
219
|
-
const
|
|
220
|
+
const queryParamOptions = ctx.config?.cache?.queryParams;
|
|
221
|
+
const query = sanitizeQueryParamsForCacheKey(url, queryParamOptions);
|
|
220
222
|
return [
|
|
221
223
|
projectKey,
|
|
222
224
|
environment,
|
|
@@ -225,12 +227,3 @@ function buildPageDataCacheKey(ctx, slug, url) {
|
|
|
225
227
|
query,
|
|
226
228
|
].join("|");
|
|
227
229
|
}
|
|
228
|
-
function buildSortedQueryKey(url) {
|
|
229
|
-
const entries = Array.from(url.searchParams.entries());
|
|
230
|
-
if (entries.length === 0)
|
|
231
|
-
return "";
|
|
232
|
-
return entries
|
|
233
|
-
.sort(([leftKey, leftValue], [rightKey, rightValue]) => leftKey === rightKey ? leftValue.localeCompare(rightValue) : leftKey.localeCompare(rightKey))
|
|
234
|
-
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
235
|
-
.join("&");
|
|
236
|
-
}
|