So I gave the same task to Codex, Jules, and Devin
Let's see what these AI Agents are all about...
Do they actually work?
Here was the prompt:
"Migrate the site from Next.js pages router to app router. In the process, update all dependencies to the latest versions. Ensure all checks pass, including compilation, linting, and a successful `next build`"
I specifically picked an old, outdated repo.
Let's start with OpenAI Codex:
+ Objectively the best looking UI
+ I really like the git diff viewer
+ Having a mobile app (especially with live activities) is sick
At first glance, code seems mostly okay. Nothing obviously wrong. However, there's no network access? That feels like a massive hole.
You can't update dependencies, which means that I can't run a build on the PR to validate that things work. This is pretty limiting. Anyways, made a PR: github.com/vercel/hyper-s…
I noticed that it only migrated one page, so I asked in the Codex chat UI to do the rest. That took 9 minutes. But... it didn't push it to the PR I made? It made me create an entirely new PR: github.com/vercel/hyper-s…
To summarize cons:
- No network access (big blocker)
- There's no two-way sync with GitHub
- Not a bad start but feels early
You have a `Request` – how do you get the visitor geolocation?
Just wrote new docs for @nextjs and wanted to share some of the interesting bits ↓
The `headers()` function allows you to read from the incoming request. For example, here we're pulling `x-forwarded-for` (or `x-real-ip`) in a function.
The `getIp` function can then be used in any Server Component. But we want the location, not the raw IP!
P.S. in the future with Partial Prerendering, you can use Suspense to wrap the dynamic component, allowing the rest of the page to still be prerendered.