✨ NextJS Pages Router Integration#4290
Conversation
Bundles Sizes Evolution
🚀 CPU PerformancePending... 🧠 Memory PerformancePending... |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 11afd17 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
|
@codex pls review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed231d8b5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a3bb4f6cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
mormubis
left a comment
There was a problem hiding this comment.
The Pages Router section doesn't mention that instrumentation-client.js requires Next.js v15.3+. Easy to miss if someone jumps straight to the Pages Router section.
…n datadogPagesRouter, fixes for comments
Motivation
Adds NextJS Pages Router support to
@datadog/browser-rum-nextjs, complementing the existing App Router integration.Small one pager on the implementation
Changes
Package (
packages/rum-nextjs/)DatadogPagesRouter— Client component that starts RUM views on route changes, usinguseRouter().pathnamefromnext/routerwhich already provides the normalized route pattern (e.g. /user/[id], /guides/[...slug]).E2E infrastructure
test/apps/nextjs-pages-router/) with dynamic routes (/user/[id],/guides/[...slug])withNextjsPagesApp()test builder method for Pages Router-specific E2E scenariosE2E tests
Same as for App Router:
Test instructions
yarn test:unit --spec packages/rum-nextjs/src/domain/nextjsPlugin.spec.tsyarn typecheckyarn test:e2e -g "pages router"Checklist