Consolidated Next.js 15 Codemods: Route Handlers, Fetch Requests, Server Config, and Migration Recipe #1348
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📚 Description
This pull request consolidates all previous Next.js 15 codemods into one for easier review and merging. The included codemods are:
Update Route Handlers to Handle Caching
Refactors route handlers to manage caching for GET functions by adding the dynamic configuration option where needed.Link
Update Fetch Requests to Handle Caching
Updates fetch requests to introduce the cache option and allows global control of caching behavior using fetchCache in layouts or pages.Link
Configure staleTimes in next.config.js
Adds the staleTimes property in the next.config.js file to manage cache durations for dynamic and static pages.Link
Add Codemod Recipe for Next.js 15 Migration
A set of codemods to help migrate to Next.js 15, including updates to:Link
Route Handlers
Fetch requests
Stale times configuration in next.config.js