codemod
codemod copied to clipboard
Consolidated Next.js 15 Codemods: Route Handlers, Fetch Requests, Server Config, and Migration Recipe
📚 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
@nishant2253 is attempting to deploy a commit to the Codemod Team on Vercel.
A member of the Team first needs to authorize it.
@mohab-sameh please take a look at this pr and suggest any changes if possible
@nishant2253, awesome work here. but considering that nextjs team built their codemods id say lets close this out.
in the future, if you have codemods to contribute, do not check in the source in this repo. instead create a repo with your own github profile. You could name the repo something like codemods (or choose a name you prefer). For the README of that repo, you can use a format similar to what's in the commons repo.
thank you and looking forward to see you publishing more codemods! (specially those built with ast-grep)