mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
With this PR, we're changing the experimental cache handler interface that's used for `"use cache"` cache handlers:
- A new method `refreshTags(): Promise<void>` has been added.
- Next.js will call this function periodically, but always before starting a new request. When working with a remote tags service, this method should communicate with the tags service to refresh the local tags manifest accordingly.
- A new method `getExpiration(...tags: string[]): Promise<Timestamp>` has been added.
- Next.js will call this function for each set of soft tags that are relevant at the start of a request. The result is the maximum timestamp of a revalidate event for the tags.
- The `get` method does not accept the soft tags anymore as its second arg: `get(cacheKey: string): Promise<undefined | CacheEntry>`
- Checking the expiration of a cache entry via soft tags is now handled by Next.js.
- The `receiveExpiredTags` method has been removed.
- This was used for two things:
1. Refreshing the tags in the tags manifest. This was replaced by `refreshTags`.
2. Setting the passed-in tags as expired in the tags manifest. This was used for redirecting server actions. Discarding cache entries based on these tags is now handled by Next.js internally.
To ease migration, the previous cache handler interface is still supported for now.
closes NAR-110
32 lines
954 B
JSON
32 lines
954 B
JSON
{
|
|
"compilerOptions": {
|
|
"noEmit": true,
|
|
"strict": false,
|
|
"allowJs": true,
|
|
"esModuleInterop": true,
|
|
"resolveJsonModule": true,
|
|
"jsx": "react-jsx",
|
|
"module": "ESNext",
|
|
"target": "ESNext",
|
|
"moduleResolution": "node",
|
|
"types": ["react", "jest", "node", "trusted-types", "jest-extended"],
|
|
"paths": {
|
|
"development-sandbox": ["./test/lib/development-sandbox"],
|
|
"next-test-utils": ["./test/lib/next-test-utils"],
|
|
"amp-test-utils": ["./test/lib/amp-test-utils"],
|
|
"next-webdriver": ["./test/lib/next-webdriver"],
|
|
"e2e-utils": ["./test/lib/e2e-utils"],
|
|
"e2e-utils/*": ["./test/lib/e2e-utils/*"],
|
|
"test-data-service/*": ["./test/lib/test-data-service/*"],
|
|
"test-log": ["./test/lib/test-log"]
|
|
}
|
|
},
|
|
"include": [
|
|
"test/**/*.test.ts",
|
|
"test/**/*.test.tsx",
|
|
"test/e2e/app-dir/use-cache-custom-handler/*.js",
|
|
"test/lib/**/*.ts",
|
|
"turbo/**/*.ts"
|
|
]
|
|
}
|