@teyik0/furin 0.2.0-alpha.4 → 0.3.0-alpha.1
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/README.md +2 -3
- package/dist/adapter/bun.d.ts +17 -1
- package/dist/adapter/package.d.ts +26 -0
- package/dist/adapter/static.d.ts +1 -1
- package/dist/build/bun-build.d.ts +3 -0
- package/dist/build/client.d.ts +1 -1
- package/dist/build/compile-entry.d.ts +3 -3
- package/dist/build/compile-entry.ts +88 -83
- package/dist/build/entry-template.d.ts +37 -9
- package/dist/build/entry-template.ts +109 -56
- package/dist/build/hydrate.d.ts +2 -2
- package/dist/build/index.js +6817 -4544
- package/dist/build/production-instrumentation.d.ts +1 -0
- package/dist/build/route-types.d.ts +1 -1
- package/dist/build/scan-server.d.ts +10 -4
- package/dist/build/server-routes-entry.d.ts +3 -3
- package/dist/build/server-routes-entry.ts +5 -11
- package/dist/build/ssg-cache.d.ts +1 -1
- package/dist/build/types.d.ts +37 -1
- package/dist/cli/config.d.ts +6 -1
- package/dist/cli/index.js +6854 -4549
- package/dist/client/boundaries.d.ts +4 -4
- package/dist/client/internal/runtime-types.d.ts +30 -0
- package/dist/client/link.d.ts +2 -1
- package/dist/client/link.js +712 -338
- package/dist/client/router/boundary-tree.d.ts +1 -1
- package/dist/client/router/index.d.ts +1 -1
- package/dist/client/router/link-utils.d.ts +5 -1
- package/dist/client/router/sync-catch-up.d.ts +4 -4
- package/dist/client/router/types.d.ts +2 -2
- package/dist/client-only.d.ts +1 -0
- package/dist/client-only.js +1 -0
- package/dist/client.d.ts +108 -111
- package/dist/client.js +16 -17
- package/dist/config.d.ts +11 -2
- package/dist/config.js +7 -3
- package/dist/devtools/devtools-element.d.ts +1 -0
- package/dist/devtools/protocol.d.ts +119 -0
- package/dist/furin.d.ts +40 -21
- package/dist/furin.js +7198 -3518
- package/dist/isomorphic.d.ts +18 -0
- package/dist/plugin/binding-scope.d.ts +2 -0
- package/dist/plugin/dead-code-elimination.d.ts +3 -0
- package/dist/plugin/index.js +933 -423
- package/dist/plugin/transform-client.d.ts +0 -2
- package/dist/plugin/transform-isomorphic.d.ts +9 -0
- package/dist/rsc/build/environment.d.ts +2 -0
- package/dist/rsc/build/index.d.ts +15 -0
- package/dist/rsc/client-codec.d.ts +1 -0
- package/dist/rsc/codec.d.ts +4 -0
- package/dist/rsc/flight-drain.d.ts +11 -0
- package/dist/rsc/render-error.d.ts +17 -0
- package/dist/rsc/server-codec.d.ts +2 -0
- package/dist/rsc/server-codec.js +24 -0
- package/dist/rsc/shared.d.ts +30 -0
- package/dist/rsc/symbols.d.ts +2 -0
- package/dist/rsc/transport-benchmark.d.ts +13 -0
- package/dist/rsc/version.d.ts +7 -0
- package/dist/rsc-client.d.ts +4 -0
- package/dist/rsc-client.js +166 -0
- package/dist/rsc-server.d.ts +11 -0
- package/dist/rsc.d.ts +11 -0
- package/dist/rsc.js +353 -0
- package/dist/server/auto-invalidate/registry.d.ts +8 -1
- package/dist/server/cache/dev-loader.d.ts +3 -2
- package/dist/server/cache/index.d.ts +2 -2
- package/dist/server/cache/invalidation.d.ts +20 -2
- package/dist/server/cache/isr-ssg.d.ts +5 -1
- package/dist/server/cache/isr.d.ts +15 -2
- package/dist/server/cache/registry.d.ts +3 -3
- package/dist/server/cache/route-cache.d.ts +10 -8
- package/dist/server/cache/ssg.d.ts +6 -2
- package/dist/server/cache/store-view.d.ts +11 -0
- package/dist/server/dev-page-plugin.d.ts +4 -0
- package/dist/server/devtools/hub.d.ts +11 -0
- package/dist/server/devtools/instrumentation.d.ts +22 -0
- package/dist/server/devtools/instrumentation.production.d.ts +44 -0
- package/dist/server/devtools/plugin.d.ts +3 -0
- package/dist/server/devtools/request-context.d.ts +6 -0
- package/dist/server/instance.d.ts +86 -0
- package/dist/server/internal.d.ts +18 -1
- package/dist/server/internal.js +74 -7
- package/dist/server/lang-detect.d.ts +1 -0
- package/dist/server/render/assemble.d.ts +4 -0
- package/dist/server/render/element.d.ts +1 -1
- package/dist/server/render/index.d.ts +2 -2
- package/dist/server/render/index.ts +6 -2
- package/dist/server/render/loaders.d.ts +8 -0
- package/dist/server/render/not-found.d.ts +1 -1
- package/dist/server/render/ppr-route.d.ts +8 -0
- package/dist/server/render/route-frame-transport.d.ts +2 -0
- package/dist/server/render/shell.ts +0 -1
- package/dist/server/render/ssr.d.ts +2 -3
- package/dist/server/render/template.d.ts +3 -2
- package/dist/server/router/discovery.d.ts +1 -1
- package/dist/server/router/hmr.d.ts +1 -1
- package/dist/server/router/index.d.ts +2 -1
- package/dist/server/router/index.js +23 -23
- package/dist/server/router/index.ts +1 -1
- package/dist/server/router/patterns.d.ts +1 -1
- package/dist/server/router/plugin.d.ts +4 -7
- package/dist/server/router/schema-merge.d.ts +3 -0
- package/dist/server/router/schemas.d.ts +12 -7
- package/dist/server/router/types.d.ts +1 -1
- package/dist/server/runtime-env.js +2 -2
- package/dist/server/sync/adapter.d.ts +45 -26
- package/dist/server/sync/config.d.ts +9 -2
- package/dist/server/sync/fingerprint.d.ts +2 -1
- package/dist/server/sync/index.d.ts +15 -4
- package/dist/server/sync/index.js +2868 -0
- package/dist/server/sync/notifier.d.ts +18 -0
- package/dist/server/sync/plugin.d.ts +53 -54
- package/dist/server/sync/postgres/index.d.ts +19 -0
- package/dist/server/sync/postgres/index.js +252 -0
- package/dist/server/sync/postgres/migrate.d.ts +2 -0
- package/dist/server/sync/postgres/migrate.js +16 -0
- package/dist/server/sync/postgres/migration.sql +66 -0
- package/dist/server/sync/redis/index.d.ts +30 -0
- package/dist/server/sync/redis/index.js +336 -0
- package/dist/server/sync/redis/scripts.d.ts +4 -0
- package/dist/server/sync/response.d.ts +10 -1
- package/dist/server/sync/runtime.d.ts +6 -0
- package/dist/server/sync/sqlite/index.d.ts +20 -0
- package/dist/server/sync/sqlite/index.js +250 -0
- package/dist/server/sync/stream.d.ts +12 -4
- package/dist/server-only.d.ts +1 -0
- package/dist/server-only.js +1 -0
- package/dist/shared/parser.d.ts +2 -0
- package/dist/shared/prefix.d.ts +15 -0
- package/dist/shared/route-frame.d.ts +49 -0
- package/dist/shared/utils/index.d.ts +1 -1
- package/package.json +59 -12
- package/src/adapter/bun.ts +175 -55
- package/src/adapter/package.ts +208 -0
- package/src/adapter/static.ts +94 -48
- package/src/build/bun-build.ts +11 -0
- package/src/build/client.ts +31 -27
- package/src/build/compile-entry.ts +88 -83
- package/src/build/entry-template.ts +109 -56
- package/src/build/hydrate.ts +37 -10
- package/src/build/index.ts +111 -28
- package/src/build/production-instrumentation.ts +14 -0
- package/src/build/route-types.ts +7 -8
- package/src/build/scan-server.ts +26 -9
- package/src/build/server-routes-entry.ts +5 -11
- package/src/build/ssg-cache.ts +13 -4
- package/src/build/types.ts +38 -1
- package/src/cli/config.ts +9 -3
- package/src/cli/index.ts +73 -24
- package/src/client/boundaries.tsx +42 -18
- package/src/client/default-screens.tsx +4 -4
- package/src/client/internal/runtime-types.ts +31 -0
- package/src/client/link.tsx +35 -37
- package/src/client/router/boundary-tree.tsx +2 -2
- package/src/client/router/context.ts +13 -9
- package/src/client/router/index.ts +3 -0
- package/src/client/router/link-utils.ts +66 -3
- package/src/client/router/navigation.ts +9 -15
- package/src/client/router/provider.tsx +74 -52
- package/src/client/router/search/index.ts +5 -7
- package/src/client/router/search-store.ts +5 -1
- package/src/client/router/spa-response.ts +3 -4
- package/src/client/router/sync-catch-up.ts +9 -8
- package/src/client/router/types.ts +2 -2
- package/src/client/sync.ts +3 -2
- package/src/client-only.ts +1 -0
- package/src/client.ts +221 -174
- package/src/config.ts +14 -1
- package/src/devtools/devtools-element.js +884 -0
- package/src/devtools/protocol.ts +139 -0
- package/src/furin.ts +414 -171
- package/src/isomorphic.ts +66 -0
- package/src/plugin/binding-scope.ts +158 -0
- package/src/plugin/dead-code-elimination.ts +202 -0
- package/src/plugin/index.ts +14 -18
- package/src/plugin/transform-client.ts +237 -273
- package/src/plugin/transform-isomorphic.ts +464 -0
- package/src/rsc/build/environment.ts +30 -0
- package/src/rsc/build/index.ts +94 -0
- package/src/rsc/client-codec.ts +11 -0
- package/src/rsc/codec.ts +85 -0
- package/src/rsc/flight-drain.ts +68 -0
- package/src/rsc/react-server-dom-webpack.d.ts +23 -0
- package/src/rsc/render-error.ts +120 -0
- package/src/rsc/server-codec.ts +25 -0
- package/src/rsc/shared.tsx +113 -0
- package/src/rsc/symbols.ts +2 -0
- package/src/rsc/transport-benchmark.ts +73 -0
- package/src/rsc/version.ts +57 -0
- package/src/rsc-client.ts +12 -0
- package/src/rsc-server.tsx +91 -0
- package/src/rsc.tsx +75 -0
- package/src/server/auto-invalidate/registry.ts +23 -1
- package/src/server/auto-invalidate/runtime.ts +58 -7
- package/src/server/cache/dev-loader.ts +143 -44
- package/src/server/cache/index.ts +7 -3
- package/src/server/cache/invalidation.ts +100 -41
- package/src/server/cache/isr-ssg.ts +12 -3
- package/src/server/cache/isr.ts +95 -5
- package/src/server/cache/registry.ts +17 -20
- package/src/server/cache/route-cache.ts +49 -36
- package/src/server/cache/ssg.ts +19 -4
- package/src/server/cache/store-view.ts +30 -0
- package/src/server/context-logger.ts +7 -7
- package/src/server/dev-page-plugin.ts +8 -6
- package/src/server/devtools/hub.ts +64 -0
- package/src/server/devtools/instrumentation.production.ts +80 -0
- package/src/server/devtools/instrumentation.ts +72 -0
- package/src/server/devtools/plugin.ts +267 -0
- package/src/server/devtools/request-context.ts +76 -0
- package/src/server/instance.ts +252 -0
- package/src/server/internal.ts +102 -5
- package/src/server/lang-detect.ts +14 -10
- package/src/server/render/assemble.ts +73 -10
- package/src/server/render/element.tsx +11 -8
- package/src/server/render/index.ts +6 -2
- package/src/server/render/isr.ts +154 -110
- package/src/server/render/loaders.ts +259 -45
- package/src/server/render/not-found.ts +18 -17
- package/src/server/render/ppr-route.ts +146 -0
- package/src/server/render/route-frame-transport.ts +62 -0
- package/src/server/render/shell.ts +0 -1
- package/src/server/render/ssg.ts +6 -5
- package/src/server/render/ssr.ts +170 -70
- package/src/server/render/template.ts +59 -25
- package/src/server/router/discovery.ts +39 -22
- package/src/server/router/hmr.ts +15 -13
- package/src/server/router/index.ts +1 -1
- package/src/server/router/patterns.ts +16 -15
- package/src/server/router/plugin.ts +151 -158
- package/src/server/router/schema-merge.ts +52 -0
- package/src/server/router/schemas.ts +55 -73
- package/src/server/router/types.ts +1 -1
- package/src/server/sync/adapter.ts +44 -28
- package/src/server/sync/config.ts +22 -9
- package/src/server/sync/fingerprint.ts +8 -3
- package/src/server/sync/index.ts +37 -13
- package/src/server/sync/notifier.ts +109 -0
- package/src/server/sync/plugin.ts +184 -90
- package/src/server/sync/postgres/index.ts +301 -0
- package/src/server/sync/postgres/migrate.ts +15 -0
- package/src/server/sync/postgres/migration.sql +66 -0
- package/src/server/sync/redis/index.ts +342 -0
- package/src/server/sync/redis/scripts.ts +74 -0
- package/src/server/sync/response.ts +141 -16
- package/src/server/sync/runtime.ts +27 -0
- package/src/server/sync/sql.d.ts +4 -0
- package/src/server/sync/sqlite/index.ts +337 -0
- package/src/server/sync/sqlite/migration.sql +70 -0
- package/src/server/sync/stream.ts +136 -70
- package/src/server-only.ts +1 -0
- package/src/shared/await.tsx +4 -4
- package/src/shared/deferred-ndjson.ts +34 -6
- package/src/shared/digest.ts +2 -2
- package/src/shared/parser.ts +5 -0
- package/src/shared/prefix.ts +38 -0
- package/src/shared/route-frame.ts +429 -0
- package/src/shared/search-params.ts +7 -7
- package/src/shared/utils/index.ts +5 -3
- package/dist/server/dev-inspector.d.ts +0 -89
- package/dist/server/sync/memory-adapter.d.ts +0 -17
- package/src/server/dev-inspector.ts +0 -60
- package/src/server/sync/memory-adapter.ts +0 -196
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type FurinInstance, instanceSlot } from "../instance.ts";
|
|
2
|
+
|
|
1
3
|
export class AutoInvalidateRegistry {
|
|
2
4
|
private readonly pathToTags = new Map<string, Set<string>>();
|
|
3
5
|
private readonly tagToPaths = new Map<string, Set<string>>();
|
|
@@ -57,4 +59,24 @@ export class AutoInvalidateRegistry {
|
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
const instanceAutoInvalidateRegistry = instanceSlot(() => new AutoInvalidateRegistry());
|
|
63
|
+
|
|
64
|
+
/** The current furin instance's registry (see server/instance.ts). */
|
|
65
|
+
export function getAutoInvalidateRegistry(instance?: FurinInstance): AutoInvalidateRegistry {
|
|
66
|
+
return instanceAutoInvalidateRegistry(instance);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Instance-scoped facade kept under the historical singleton name so call
|
|
71
|
+
* sites read the same — every method resolves the current instance's registry.
|
|
72
|
+
*/
|
|
73
|
+
export const autoInvalidateRegistry: Pick<
|
|
74
|
+
AutoInvalidateRegistry,
|
|
75
|
+
"registerLoaderTags" | "pathsForTags" | "unregisterPath" | "reset"
|
|
76
|
+
> = {
|
|
77
|
+
registerLoaderTags: (urlPath, tags) =>
|
|
78
|
+
instanceAutoInvalidateRegistry().registerLoaderTags(urlPath, tags),
|
|
79
|
+
pathsForTags: (tags) => instanceAutoInvalidateRegistry().pathsForTags(tags),
|
|
80
|
+
unregisterPath: (urlPath) => instanceAutoInvalidateRegistry().unregisterPath(urlPath),
|
|
81
|
+
reset: () => instanceAutoInvalidateRegistry().reset(),
|
|
82
|
+
};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { Context } from "elysia";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
callCachePurger,
|
|
4
|
+
consumePendingInvalidations,
|
|
5
|
+
revalidatePath,
|
|
6
|
+
revalidatePathForInstance,
|
|
7
|
+
} from "../cache/invalidation.ts";
|
|
8
|
+
import { pathWithoutSearch } from "../cache/route-cache.ts";
|
|
9
|
+
import {
|
|
10
|
+
currentInstrumentationRequest,
|
|
11
|
+
emitCacheInvalidated,
|
|
12
|
+
} from "../devtools/instrumentation.ts";
|
|
13
|
+
import { allInstances, withInstance } from "../instance.ts";
|
|
14
|
+
import { IS_DEV } from "../runtime-env.ts";
|
|
15
|
+
import { getAutoInvalidateRegistry } from "./registry.ts";
|
|
4
16
|
import type { InvalidationInput, InvalidationRule } from "./types.ts";
|
|
5
17
|
|
|
6
18
|
function toRules(input: InvalidationInput): readonly InvalidationRule[] {
|
|
@@ -12,18 +24,17 @@ function statusFromResponseValue(responseValue: unknown): number | undefined {
|
|
|
12
24
|
return responseValue.status;
|
|
13
25
|
}
|
|
14
26
|
if (responseValue && typeof responseValue === "object" && "status" in responseValue) {
|
|
15
|
-
const status =
|
|
27
|
+
const { status } = responseValue as { status?: unknown };
|
|
16
28
|
if (typeof status === "number") {
|
|
17
29
|
return status;
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
32
|
if (responseValue && typeof responseValue === "object" && "code" in responseValue) {
|
|
21
|
-
const code =
|
|
33
|
+
const { code } = responseValue as { code?: unknown };
|
|
22
34
|
if (typeof code === "number") {
|
|
23
35
|
return code;
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
|
-
return;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
export function isSuccessfulMutationResponse(
|
|
@@ -113,10 +124,50 @@ export function appendPendingInvalidationHeader(set: Context["set"]): string[] {
|
|
|
113
124
|
|
|
114
125
|
export function revalidateTag(tags: string | readonly string[]): boolean {
|
|
115
126
|
const tagList = typeof tags === "string" ? [tags] : [...tags];
|
|
127
|
+
// Tags are cross-app by design: with several mounted furin instances a
|
|
128
|
+
// shared mutation must be able to invalidate pages rendered by any of them.
|
|
129
|
+
// But each instance's tag-registered paths are evicted from THAT instance's
|
|
130
|
+
// caches only — the cross-app fan-out of `revalidatePath` would also evict
|
|
131
|
+
// a sibling app's unrelated page that merely shares the pathname.
|
|
116
132
|
let deleted = false;
|
|
117
|
-
|
|
118
|
-
|
|
133
|
+
const purgedPaths = new Set<string>();
|
|
134
|
+
for (const instance of allInstances()) {
|
|
135
|
+
let instanceDeleted = false;
|
|
136
|
+
const instancePurgedPaths = new Set<string>();
|
|
137
|
+
// Registry paths are LOGICAL (unprefixed); the CDN caches the PHYSICAL
|
|
138
|
+
// request URL, so prefix each with the instance's mount prefix before
|
|
139
|
+
// queueing it for purge — otherwise a mounted app's `/admin/x` stays stale.
|
|
140
|
+
for (const path of getAutoInvalidateRegistry(instance).pathsForTags(tagList)) {
|
|
141
|
+
const logicalPath = pathWithoutSearch(path);
|
|
142
|
+
const result = revalidatePathForInstance(instance, logicalPath, "page", false);
|
|
143
|
+
deleted = result.deleted || deleted;
|
|
144
|
+
instanceDeleted = result.deleted || instanceDeleted;
|
|
145
|
+
purgedPaths.add(`${instance.prefix}${logicalPath}`);
|
|
146
|
+
instancePurgedPaths.add(logicalPath);
|
|
147
|
+
for (const purged of result.purgedPaths) {
|
|
148
|
+
purgedPaths.add(`${instance.prefix}${purged}`);
|
|
149
|
+
instancePurgedPaths.add(purged);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (IS_DEV) {
|
|
153
|
+
withInstance(instance, () => {
|
|
154
|
+
const request = currentInstrumentationRequest();
|
|
155
|
+
const operationId = request === undefined ? null : request.operationId;
|
|
156
|
+
const requestId = request === undefined ? null : request.requestId;
|
|
157
|
+
emitCacheInvalidated({
|
|
158
|
+
deleted: instanceDeleted,
|
|
159
|
+
operationId,
|
|
160
|
+
purgedPaths: instancePurgedPaths.size,
|
|
161
|
+
reason: "tag",
|
|
162
|
+
requestId,
|
|
163
|
+
target: tagList.join(","),
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
119
167
|
}
|
|
168
|
+
// One batched CDN purge — the CDN sits in front of every mounted app, so
|
|
169
|
+
// physical paths from all instances go out together, deduped.
|
|
170
|
+
callCachePurger([...purgedPaths]);
|
|
120
171
|
return deleted;
|
|
121
172
|
}
|
|
122
173
|
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { statSync } from "node:fs";
|
|
2
|
+
import { relative } from "node:path";
|
|
2
3
|
import { autoInvalidateRegistry } from "../auto-invalidate/registry";
|
|
4
|
+
import {
|
|
5
|
+
currentInstrumentationRequest,
|
|
6
|
+
emitCacheInvalidated,
|
|
7
|
+
emitCacheAccess as emitInstrumentationCacheAccess,
|
|
8
|
+
} from "../devtools/instrumentation.ts";
|
|
9
|
+
import {
|
|
10
|
+
allStateBuckets,
|
|
11
|
+
currentInstance,
|
|
12
|
+
type FurinInstance,
|
|
13
|
+
instanceSlot,
|
|
14
|
+
withInstance,
|
|
15
|
+
} from "../instance.ts";
|
|
3
16
|
import { registerCacheInvalidator } from "./registry";
|
|
4
17
|
import { createRouteCache, type RevalidateType } from "./route-cache";
|
|
5
18
|
|
|
@@ -18,95 +31,156 @@ export interface InvalidateOutcome {
|
|
|
18
31
|
ssg: number;
|
|
19
32
|
}
|
|
20
33
|
|
|
21
|
-
const sourceFileToCacheKeys = new Map<string, Set<string>>();
|
|
22
|
-
|
|
23
34
|
interface CacheKindHandle {
|
|
24
35
|
cache: ReturnType<typeof createDevLoaderCache>;
|
|
25
36
|
kind: "isr" | "ssg";
|
|
26
37
|
}
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
interface DevLoaderState {
|
|
40
|
+
isr: CacheKindHandle;
|
|
41
|
+
sourceFileToCacheKeys: Map<string, Set<string>>;
|
|
42
|
+
ssg: CacheKindHandle;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function indexEntryDependencies(
|
|
46
|
+
index: Map<string, Set<string>>,
|
|
47
|
+
cacheKey: string,
|
|
48
|
+
deps: string[]
|
|
49
|
+
): void {
|
|
29
50
|
for (const dep of deps) {
|
|
30
|
-
let bucket =
|
|
51
|
+
let bucket = index.get(dep);
|
|
31
52
|
if (!bucket) {
|
|
32
53
|
bucket = new Set<string>();
|
|
33
|
-
|
|
54
|
+
index.set(dep, bucket);
|
|
34
55
|
}
|
|
35
56
|
bucket.add(cacheKey);
|
|
36
57
|
}
|
|
37
58
|
}
|
|
38
59
|
|
|
39
|
-
function unindexEntryDependencies(
|
|
60
|
+
function unindexEntryDependencies(
|
|
61
|
+
index: Map<string, Set<string>>,
|
|
62
|
+
cacheKey: string,
|
|
63
|
+
deps: string[]
|
|
64
|
+
): void {
|
|
40
65
|
for (const dep of deps) {
|
|
41
|
-
const bucket =
|
|
66
|
+
const bucket = index.get(dep);
|
|
42
67
|
if (!bucket) {
|
|
43
68
|
continue;
|
|
44
69
|
}
|
|
45
70
|
bucket.delete(cacheKey);
|
|
46
71
|
if (bucket.size === 0) {
|
|
47
|
-
|
|
72
|
+
index.delete(dep);
|
|
48
73
|
}
|
|
49
74
|
}
|
|
50
75
|
}
|
|
51
76
|
|
|
52
|
-
function createDevLoaderCache(name: string) {
|
|
77
|
+
function createDevLoaderCache(name: string, index: Map<string, Set<string>>) {
|
|
53
78
|
return createRouteCache<DevLoaderCacheEntry>({
|
|
54
79
|
name,
|
|
55
80
|
onDelete: (key, entry) => {
|
|
56
|
-
unindexEntryDependencies(key, entry.dependencies);
|
|
57
|
-
const urlPath =
|
|
81
|
+
unindexEntryDependencies(index, key, entry.dependencies);
|
|
82
|
+
const urlPath = urlPathWithSearchFromCacheKey(key);
|
|
58
83
|
if (urlPath) {
|
|
59
84
|
autoInvalidateRegistry.unregisterPath(urlPath);
|
|
60
85
|
}
|
|
61
86
|
},
|
|
62
87
|
onSet: (key, entry, previous) => {
|
|
63
88
|
if (previous) {
|
|
64
|
-
unindexEntryDependencies(key, previous.dependencies);
|
|
89
|
+
unindexEntryDependencies(index, key, previous.dependencies);
|
|
65
90
|
}
|
|
66
|
-
indexEntryDependencies(key, entry.dependencies);
|
|
91
|
+
indexEntryDependencies(index, key, entry.dependencies);
|
|
67
92
|
},
|
|
68
93
|
pathFromKey: urlPathFromCacheKey,
|
|
69
94
|
});
|
|
70
95
|
}
|
|
71
96
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
97
|
+
// Per-instance dev loader caches + source-dependency index — two furin
|
|
98
|
+
// instances in one dev process must not invalidate each other's loader data.
|
|
99
|
+
const instanceDevLoaderState = instanceSlot((instance): DevLoaderState => {
|
|
100
|
+
const sourceFileToCacheKeys = new Map<string, Set<string>>();
|
|
101
|
+
const isrCache = createDevLoaderCache("render:dev-isr-loader", sourceFileToCacheKeys);
|
|
102
|
+
const ssgCache = createDevLoaderCache("render:dev-ssg-loader", sourceFileToCacheKeys);
|
|
103
|
+
registerCacheInvalidator(isrCache, instance);
|
|
104
|
+
registerCacheInvalidator(ssgCache, instance);
|
|
105
|
+
return {
|
|
106
|
+
isr: { cache: isrCache, kind: "isr" },
|
|
107
|
+
sourceFileToCacheKeys,
|
|
108
|
+
ssg: { cache: ssgCache, kind: "ssg" },
|
|
109
|
+
};
|
|
110
|
+
});
|
|
77
111
|
|
|
78
|
-
function
|
|
79
|
-
|
|
112
|
+
function emitCacheAccess(
|
|
113
|
+
cache: "isr-loader" | "ssg-loader",
|
|
114
|
+
key: string,
|
|
115
|
+
entry: DevLoaderCacheEntry | undefined
|
|
116
|
+
): void {
|
|
117
|
+
const request = currentInstrumentationRequest();
|
|
118
|
+
const path = urlPathFromCacheKey(key);
|
|
119
|
+
if (request === undefined || path === null) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
let outcome: "hit" | "miss" | "stale";
|
|
123
|
+
if (entry === undefined) {
|
|
124
|
+
outcome = "miss";
|
|
125
|
+
} else {
|
|
126
|
+
outcome = isDevLoaderCacheValid(entry) ? "hit" : "stale";
|
|
127
|
+
}
|
|
128
|
+
emitInstrumentationCacheAccess({
|
|
129
|
+
cache,
|
|
130
|
+
operationId: request.operationId,
|
|
131
|
+
outcome,
|
|
132
|
+
path,
|
|
133
|
+
requestId: request.requestId,
|
|
134
|
+
});
|
|
80
135
|
}
|
|
81
136
|
|
|
82
137
|
export function getDevISRLoaderCache(key: string): DevLoaderCacheEntry | undefined {
|
|
83
|
-
|
|
138
|
+
const entry = instanceDevLoaderState().isr.cache.get(key);
|
|
139
|
+
emitCacheAccess("isr-loader", key, entry);
|
|
140
|
+
return entry;
|
|
84
141
|
}
|
|
85
142
|
|
|
86
143
|
export function setDevISRLoaderCache(key: string, entry: DevLoaderCacheEntry): void {
|
|
87
|
-
|
|
144
|
+
instanceDevLoaderState().isr.cache.set(key, entry);
|
|
88
145
|
}
|
|
89
146
|
|
|
90
147
|
export function getDevSSGLoaderCache(key: string): DevLoaderCacheEntry | undefined {
|
|
91
|
-
|
|
148
|
+
const entry = instanceDevLoaderState().ssg.cache.get(key);
|
|
149
|
+
emitCacheAccess("ssg-loader", key, entry);
|
|
150
|
+
return entry;
|
|
92
151
|
}
|
|
93
152
|
|
|
94
153
|
export function setDevSSGLoaderCache(key: string, entry: DevLoaderCacheEntry): void {
|
|
95
|
-
|
|
154
|
+
instanceDevLoaderState().ssg.cache.set(key, entry);
|
|
96
155
|
}
|
|
97
156
|
|
|
98
157
|
export function urlPathFromCacheKey(key: string): string | null {
|
|
99
|
-
const
|
|
158
|
+
const searchStart = key.indexOf("?");
|
|
159
|
+
const keyWithoutSearch = searchStart === -1 ? key : key.slice(0, searchStart);
|
|
160
|
+
const sep = keyWithoutSearch.lastIndexOf(":/");
|
|
100
161
|
if (sep === -1) {
|
|
101
162
|
return null;
|
|
102
163
|
}
|
|
103
|
-
return
|
|
164
|
+
return keyWithoutSearch.slice(sep + 1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function urlPathWithSearchFromCacheKey(key: string): string | null {
|
|
168
|
+
const urlPath = urlPathFromCacheKey(key);
|
|
169
|
+
if (urlPath === null) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
const searchStart = key.indexOf("?");
|
|
173
|
+
if (searchStart === -1) {
|
|
174
|
+
return urlPath;
|
|
175
|
+
}
|
|
176
|
+
return `${urlPath}${key.slice(searchStart)}`;
|
|
104
177
|
}
|
|
105
178
|
|
|
106
179
|
export function invalidateDevLoaderCacheByPath(
|
|
107
180
|
path: string,
|
|
108
181
|
type: RevalidateType
|
|
109
182
|
): InvalidateOutcome {
|
|
183
|
+
const state = instanceDevLoaderState();
|
|
110
184
|
const cleared: string[] = [];
|
|
111
185
|
let isr = 0;
|
|
112
186
|
let ssg = 0;
|
|
@@ -119,7 +193,7 @@ export function invalidateDevLoaderCacheByPath(
|
|
|
119
193
|
return urlPath === path || urlPath.startsWith(prefix);
|
|
120
194
|
};
|
|
121
195
|
|
|
122
|
-
for (const handle of [
|
|
196
|
+
for (const handle of [state.isr, state.ssg]) {
|
|
123
197
|
for (const key of [...handle.cache.keys()]) {
|
|
124
198
|
const urlPath = urlPathFromCacheKey(key);
|
|
125
199
|
if (urlPath === null || !matches(urlPath)) {
|
|
@@ -132,9 +206,9 @@ export function invalidateDevLoaderCacheByPath(
|
|
|
132
206
|
handle.cache.delete(key);
|
|
133
207
|
cleared.push(key);
|
|
134
208
|
if (handle.kind === "isr") {
|
|
135
|
-
isr
|
|
209
|
+
isr += 1;
|
|
136
210
|
} else {
|
|
137
|
-
ssg
|
|
211
|
+
ssg += 1;
|
|
138
212
|
}
|
|
139
213
|
}
|
|
140
214
|
}
|
|
@@ -143,7 +217,8 @@ export function invalidateDevLoaderCacheByPath(
|
|
|
143
217
|
}
|
|
144
218
|
|
|
145
219
|
export function invalidateDevLoaderCacheBySource(filePath: string): InvalidateOutcome {
|
|
146
|
-
const
|
|
220
|
+
const state = instanceDevLoaderState();
|
|
221
|
+
const keys = state.sourceFileToCacheKeys.get(filePath);
|
|
147
222
|
if (!keys || keys.size === 0) {
|
|
148
223
|
return { cleared: [], isr: 0, ssg: 0 };
|
|
149
224
|
}
|
|
@@ -154,21 +229,32 @@ export function invalidateDevLoaderCacheBySource(filePath: string): InvalidateOu
|
|
|
154
229
|
|
|
155
230
|
const snapshot = [...keys];
|
|
156
231
|
for (const key of snapshot) {
|
|
157
|
-
const isrEntry =
|
|
232
|
+
const isrEntry = state.isr.cache.get(key);
|
|
158
233
|
if (isrEntry) {
|
|
159
|
-
|
|
234
|
+
state.isr.cache.delete(key);
|
|
160
235
|
cleared.push(key);
|
|
161
|
-
isr
|
|
236
|
+
isr += 1;
|
|
162
237
|
continue;
|
|
163
238
|
}
|
|
164
|
-
const ssgEntry =
|
|
239
|
+
const ssgEntry = state.ssg.cache.get(key);
|
|
165
240
|
if (ssgEntry) {
|
|
166
|
-
|
|
241
|
+
state.ssg.cache.delete(key);
|
|
167
242
|
cleared.push(key);
|
|
168
|
-
ssg
|
|
243
|
+
ssg += 1;
|
|
169
244
|
}
|
|
170
245
|
}
|
|
171
246
|
|
|
247
|
+
const request = currentInstrumentationRequest();
|
|
248
|
+
const operationId = request === undefined ? null : request.operationId;
|
|
249
|
+
const requestId = request === undefined ? null : request.requestId;
|
|
250
|
+
emitCacheInvalidated({
|
|
251
|
+
deleted: cleared.length > 0,
|
|
252
|
+
operationId,
|
|
253
|
+
purgedPaths: cleared.length,
|
|
254
|
+
reason: "source",
|
|
255
|
+
requestId,
|
|
256
|
+
target: relative(process.cwd(), filePath).replaceAll("\\", "/"),
|
|
257
|
+
});
|
|
172
258
|
return { cleared, isr, ssg };
|
|
173
259
|
}
|
|
174
260
|
|
|
@@ -183,7 +269,7 @@ export function isDevLoaderCacheValid(entry: DevLoaderCacheEntry): boolean {
|
|
|
183
269
|
for (const dep of entry.dependencies) {
|
|
184
270
|
let mtimeMs: number;
|
|
185
271
|
try {
|
|
186
|
-
mtimeMs = statSync(dep)
|
|
272
|
+
({ mtimeMs } = statSync(dep));
|
|
187
273
|
} catch {
|
|
188
274
|
return false;
|
|
189
275
|
}
|
|
@@ -195,17 +281,30 @@ export function isDevLoaderCacheValid(entry: DevLoaderCacheEntry): boolean {
|
|
|
195
281
|
}
|
|
196
282
|
|
|
197
283
|
export function getAllDevISRLoaderEntries(): [string, DevLoaderCacheEntry][] {
|
|
198
|
-
return [...
|
|
284
|
+
return [...instanceDevLoaderState().isr.cache.entries()];
|
|
199
285
|
}
|
|
200
286
|
|
|
201
287
|
export function getAllDevSSGLoaderEntries(): [string, DevLoaderCacheEntry][] {
|
|
202
|
-
return [...
|
|
288
|
+
return [...instanceDevLoaderState().ssg.cache.entries()];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** @internal — clears dev loader caches for `instance` (default: current). */
|
|
292
|
+
export function clearDevLoaderCaches(instance?: FurinInstance): void {
|
|
293
|
+
const target = instance ?? currentInstance();
|
|
294
|
+
const state = instanceDevLoaderState(target);
|
|
295
|
+
// `.clear()` fires onDelete per entry, which unregisters the path from the
|
|
296
|
+
// auto-invalidate registry via the `currentInstance()`-scoped facade — bind
|
|
297
|
+
// the scope here so the unregistration hits the cleared instance's registry
|
|
298
|
+
// (re-entering an already-active identical scope is harmless).
|
|
299
|
+
withInstance(target, () => {
|
|
300
|
+
state.isr.cache.clear();
|
|
301
|
+
state.ssg.cache.clear();
|
|
302
|
+
});
|
|
303
|
+
state.sourceFileToCacheKeys.clear();
|
|
203
304
|
}
|
|
204
305
|
|
|
205
306
|
export function __resetDevLoaderCacheState(): void {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
registerCacheInvalidator(devISRLoaderCache);
|
|
210
|
-
registerCacheInvalidator(devSSGLoaderCache);
|
|
307
|
+
for (const instance of allStateBuckets()) {
|
|
308
|
+
clearDevLoaderCaches(instance);
|
|
309
|
+
}
|
|
211
310
|
}
|
|
@@ -20,12 +20,16 @@ export {
|
|
|
20
20
|
_runWithRequestInvalidationScope,
|
|
21
21
|
callCachePurger,
|
|
22
22
|
consumePendingInvalidations,
|
|
23
|
-
getBuildId,
|
|
24
23
|
revalidatePath,
|
|
25
|
-
setBuildId,
|
|
26
24
|
setCachePurger,
|
|
27
25
|
} from "./invalidation";
|
|
28
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
deleteISRCache,
|
|
28
|
+
getISRCache,
|
|
29
|
+
isrCache,
|
|
30
|
+
setISRCache,
|
|
31
|
+
waitForPendingISRRevalidations,
|
|
32
|
+
} from "./isr";
|
|
29
33
|
export type { ISRCacheEntry, SsgCacheEntry } from "./isr-ssg";
|
|
30
34
|
export type { CacheInvalidator } from "./registry";
|
|
31
35
|
export { registerCacheInvalidator } from "./registry";
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
1
|
import { createLogger } from "../context-logger";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
currentInstrumentationRequest,
|
|
4
|
+
emitCacheInvalidated,
|
|
5
|
+
} from "../devtools/instrumentation.ts";
|
|
6
|
+
import {
|
|
7
|
+
__clearInstanceRegistry,
|
|
8
|
+
allInstances,
|
|
9
|
+
allStateBuckets,
|
|
10
|
+
currentInstance,
|
|
11
|
+
type FurinInstance,
|
|
12
|
+
requestPendingInvalidations,
|
|
13
|
+
runWithInstanceScope,
|
|
14
|
+
withInstance,
|
|
15
|
+
} from "../instance.ts";
|
|
16
|
+
import { clearPprRouteCache } from "../render/ppr-route.ts";
|
|
17
|
+
import { IS_DEV } from "../runtime-env.ts";
|
|
18
|
+
import { clearDevLoaderCaches } from "./dev-loader";
|
|
19
|
+
import { clearPendingISRRevalidations, isrRouteCache } from "./isr";
|
|
20
|
+
import { getCacheInvalidators } from "./registry";
|
|
6
21
|
import type { RevalidateType } from "./route-cache";
|
|
7
22
|
import { ssgRouteCache } from "./ssg";
|
|
8
23
|
|
|
9
|
-
// Register core caches at module load time so revalidatePath works out of the box.
|
|
10
|
-
registerCacheInvalidator(isrRouteCache);
|
|
11
|
-
registerCacheInvalidator(ssgRouteCache);
|
|
12
|
-
registerCacheInvalidator(devISRLoaderCache);
|
|
13
|
-
registerCacheInvalidator(devSSGLoaderCache);
|
|
14
|
-
|
|
15
|
-
// ── Build ID ─────────────────────────────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
let _buildId = "";
|
|
18
|
-
|
|
19
|
-
export function setBuildId(id: string): void {
|
|
20
|
-
_buildId = id;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function getBuildId(): string {
|
|
24
|
-
return _buildId;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
24
|
// ── Pending invalidations (server → client bridge) ───────────────────────────
|
|
25
|
+
// The per-request set lives in the instance request scope (see instance.ts);
|
|
26
|
+
// outside a request scope invalidations accumulate in a process-global set.
|
|
28
27
|
|
|
29
|
-
const _requestInvalidationScope = new AsyncLocalStorage<Set<string>>();
|
|
30
28
|
const _globalPendingInvalidations = new Set<string>();
|
|
31
29
|
|
|
32
30
|
function _activeInvalidationSet(): Set<string> {
|
|
33
|
-
return
|
|
31
|
+
return requestPendingInvalidations() ?? _globalPendingInvalidations;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
export function _runWithRequestInvalidationScope<T>(fn: () => T): T {
|
|
37
|
-
return
|
|
35
|
+
return runWithInstanceScope(currentInstance(), fn);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
export function consumePendingInvalidations(): string[] {
|
|
@@ -47,7 +45,12 @@ export function consumePendingInvalidations(): string[] {
|
|
|
47
45
|
return paths;
|
|
48
46
|
}
|
|
49
47
|
|
|
48
|
+
export function peekPendingInvalidations(): string[] {
|
|
49
|
+
return [..._activeInvalidationSet()];
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
// ── CDN purger hook ───────────────────────────────────────────────────────────
|
|
53
|
+
// Process-global on purpose: the CDN sits in front of every mounted app.
|
|
51
54
|
|
|
52
55
|
type CachePurger = (paths: string[]) => Promise<void>;
|
|
53
56
|
let _cachePurger: CachePurger | null = null;
|
|
@@ -75,37 +78,93 @@ export function callCachePurger(paths: string[]): void {
|
|
|
75
78
|
|
|
76
79
|
// ── revalidatePath ───────────────────────────────────────────────────────────
|
|
77
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Invalidates `path` across EVERY mounted furin instance — paths are logical
|
|
83
|
+
* (unprefixed), and with shared data two apps can legitimately render the same
|
|
84
|
+
* logical path. This mirrors the historical shared-cache behaviour. Each
|
|
85
|
+
* instance's invalidation runs inside its own scope so cache `onDelete` hooks
|
|
86
|
+
* (auto-invalidate unregistration) hit the owning instance's registry.
|
|
87
|
+
*/
|
|
78
88
|
export function revalidatePath(path: string, type: RevalidateType): boolean {
|
|
79
|
-
_activeInvalidationSet().add(type === "layout" ? `${path}:layout` : path);
|
|
80
|
-
|
|
81
89
|
let deleted = false;
|
|
82
90
|
const purgedPaths: string[] = [];
|
|
83
|
-
for (const
|
|
84
|
-
const result =
|
|
91
|
+
for (const instance of allInstances()) {
|
|
92
|
+
const result = revalidatePathForInstance(instance, path, type);
|
|
85
93
|
deleted = result.deleted || deleted;
|
|
86
|
-
purgedPaths.push(
|
|
94
|
+
purgedPaths.push(`${instance.prefix}${path}`);
|
|
95
|
+
for (const purged of result.purgedPaths) {
|
|
96
|
+
purgedPaths.push(`${instance.prefix}${purged}`);
|
|
97
|
+
}
|
|
87
98
|
}
|
|
88
99
|
|
|
89
|
-
callCachePurger(dedupePaths(
|
|
100
|
+
callCachePurger(dedupePaths(purgedPaths));
|
|
90
101
|
return deleted;
|
|
91
102
|
}
|
|
92
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Invalidates `path` against a SINGLE instance's caches. `revalidateTag` uses
|
|
106
|
+
* this because it knows which instance registered each path — the cross-app
|
|
107
|
+
* fan-out of `revalidatePath` would also evict a sibling app's unrelated page
|
|
108
|
+
* that merely shares the pathname. Does NOT call the CDN purger; callers
|
|
109
|
+
* batch the returned `purgedPaths` themselves.
|
|
110
|
+
*/
|
|
111
|
+
export function revalidatePathForInstance(
|
|
112
|
+
instance: FurinInstance,
|
|
113
|
+
path: string,
|
|
114
|
+
type: RevalidateType,
|
|
115
|
+
emitPathEvent?: boolean
|
|
116
|
+
): { deleted: boolean; purgedPaths: string[] } {
|
|
117
|
+
_activeInvalidationSet().add(type === "layout" ? `${path}:layout` : path);
|
|
118
|
+
|
|
119
|
+
let deleted = false;
|
|
120
|
+
const purgedPaths: string[] = [];
|
|
121
|
+
withInstance(instance, () => {
|
|
122
|
+
for (const invalidator of getCacheInvalidators(instance)) {
|
|
123
|
+
const result = invalidator.invalidatePath(path, type);
|
|
124
|
+
deleted = result.deleted || deleted;
|
|
125
|
+
purgedPaths.push(...result.purgedPaths);
|
|
126
|
+
}
|
|
127
|
+
if (IS_DEV && emitPathEvent !== false) {
|
|
128
|
+
const request = currentInstrumentationRequest();
|
|
129
|
+
const operationId = request === undefined ? null : request.operationId;
|
|
130
|
+
const requestId = request === undefined ? null : request.requestId;
|
|
131
|
+
emitCacheInvalidated({
|
|
132
|
+
deleted,
|
|
133
|
+
operationId,
|
|
134
|
+
purgedPaths: new Set(purgedPaths).size,
|
|
135
|
+
reason: "path",
|
|
136
|
+
requestId,
|
|
137
|
+
target: path,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return { deleted, purgedPaths };
|
|
142
|
+
}
|
|
143
|
+
|
|
93
144
|
function dedupePaths(paths: string[]): string[] {
|
|
94
145
|
return [...new Set(paths)];
|
|
95
146
|
}
|
|
96
147
|
|
|
97
148
|
/** @internal — resets all module state between tests */
|
|
98
149
|
export function __resetCacheState(): void {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
150
|
+
for (const instance of allStateBuckets()) {
|
|
151
|
+
// `.clear()` fires each entry's onDelete hook, and those hooks resolve
|
|
152
|
+
// the auto-invalidate registry via `currentInstance()` — scope to the
|
|
153
|
+
// bucket being cleared so unregistrations hit ITS registry instead of
|
|
154
|
+
// the ambient (default) one.
|
|
155
|
+
withInstance(instance, () => {
|
|
156
|
+
isrRouteCache(instance).clear();
|
|
157
|
+
ssgRouteCache(instance).clear();
|
|
158
|
+
clearDevLoaderCaches(instance);
|
|
159
|
+
clearPprRouteCache(instance);
|
|
160
|
+
clearPendingISRRevalidations(instance);
|
|
161
|
+
});
|
|
162
|
+
instance.buildId = "";
|
|
163
|
+
}
|
|
164
|
+
// Forget mounted instances (fresh furin() calls between tests must not hit
|
|
165
|
+
// prefix collisions) but keep the default bucket — cache slots above are
|
|
166
|
+
// cleared, while process-wide defaults like a beforeAll template survive.
|
|
167
|
+
__clearInstanceRegistry();
|
|
104
168
|
_globalPendingInvalidations.clear();
|
|
105
169
|
_cachePurger = null;
|
|
106
|
-
clearCacheInvalidators();
|
|
107
|
-
registerCacheInvalidator(isrRouteCache);
|
|
108
|
-
registerCacheInvalidator(ssgRouteCache);
|
|
109
|
-
registerCacheInvalidator(devISRLoaderCache);
|
|
110
|
-
registerCacheInvalidator(devSSGLoaderCache);
|
|
111
170
|
}
|