@ultimat3/render 31.40.1 → 31.41.0
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 -1
- package/package.json +7 -7
- package/src/render-isr-types.ts +6 -0
- package/src/render-isr.ts +15 -0
package/README.md
CHANGED
|
@@ -684,7 +684,8 @@ a job boundary the class is gone and the `code` is what survives — match on th
|
|
|
684
684
|
`@ultimat3/storage`'s `StorageDriver` as it is), so every replica reads one copy. A write is
|
|
685
685
|
checked, written and checked again (a disk has no compare-and-put); eviction is oldest write
|
|
686
686
|
first. Every `IsrStore` method may answer a promise (`IsrAnswer<T>`); the controller awaits each,
|
|
687
|
-
and `revalidateByTags` / `markStale` are async
|
|
687
|
+
and `revalidateByTags` / `markStale` / `forgetAll` are async (`forgetAll`: every stored page and
|
|
688
|
+
every render in flight forgotten, so the next request renders anew — `x dev`'s rebuild). One regeneration holds its page for at most
|
|
688
689
|
`DEFAULT_ISR_REGENERATE_DEADLINE_MS` (30 s; `isrController({ regenerateDeadlineMs })`),
|
|
689
690
|
so a render that never settles no longer pins the page for the life of the process. A stored
|
|
690
691
|
path takes its TTL and tags from the most specific matching route (static > `:param` >
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/render",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.41.0",
|
|
4
4
|
"description": "The route primitive and the five render modes: static, isr, ssr, stream, spa.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"test": "bun test"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@ultimat3/cache": "31.
|
|
56
|
-
"@ultimat3/core": "31.
|
|
57
|
-
"@ultimat3/http": "31.
|
|
58
|
-
"@ultimat3/i18n": "31.
|
|
59
|
-
"@ultimat3/schema": "31.
|
|
60
|
-
"@ultimat3/seo": "31.
|
|
55
|
+
"@ultimat3/cache": "31.41.0",
|
|
56
|
+
"@ultimat3/core": "31.41.0",
|
|
57
|
+
"@ultimat3/http": "31.41.0",
|
|
58
|
+
"@ultimat3/i18n": "31.41.0",
|
|
59
|
+
"@ultimat3/schema": "31.41.0",
|
|
60
|
+
"@ultimat3/seo": "31.41.0",
|
|
61
61
|
"sass": "1.107.1"
|
|
62
62
|
}
|
|
63
63
|
}
|
package/src/render-isr-types.ts
CHANGED
|
@@ -98,6 +98,12 @@ export interface IsrController {
|
|
|
98
98
|
revalidateByTags(tags: readonly CacheTag[]): Promise<readonly string[]>;
|
|
99
99
|
inflight(): number;
|
|
100
100
|
store(): IsrStore;
|
|
101
|
+
/**
|
|
102
|
+
* Every page this controller stores or is rendering, forgotten: flights evicted, fences marked,
|
|
103
|
+
* the store emptied — so the next request renders, never joining a render begun before. `x dev`'s
|
|
104
|
+
* rebuild calls it on a save.
|
|
105
|
+
*/
|
|
106
|
+
forgetAll(): Promise<void>;
|
|
101
107
|
/**
|
|
102
108
|
* Register this controller as the framework's revalidator, so
|
|
103
109
|
* `action({ cache: { invalidates: [tag.post] } })` reaches ISR in the same hop as
|
package/src/render-isr.ts
CHANGED
|
@@ -383,6 +383,21 @@ export function isrController(options: IsrControllerOptions = {}): IsrController
|
|
|
383
383
|
regenerate,
|
|
384
384
|
markStale,
|
|
385
385
|
|
|
386
|
+
// `invalidate`'s purge, for every page: flights first, before the first await.
|
|
387
|
+
async forgetAll() {
|
|
388
|
+
for (const path of flight.keys()) {
|
|
389
|
+
failed.clear(path);
|
|
390
|
+
flight.evict(path);
|
|
391
|
+
fences.mark({ key: path });
|
|
392
|
+
forgetPath(path);
|
|
393
|
+
}
|
|
394
|
+
for (const path of await store.paths()) {
|
|
395
|
+
fences.mark({ key: path });
|
|
396
|
+
forgetPath(path);
|
|
397
|
+
await store.delete(path);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
|
|
386
401
|
async serve(path, render) {
|
|
387
402
|
const descriptor = descriptorFor(path);
|
|
388
403
|
const policy = isrPolicyOf(descriptor);
|