Beltran.bulbarella/nextjs app router integration#4143
Draft
BeltranBulbarellaDD wants to merge 11 commits intomainfrom
Draft
Beltran.bulbarella/nextjs app router integration#4143BeltranBulbarellaDD wants to merge 11 commits intomainfrom
BeltranBulbarellaDD wants to merge 11 commits intomainfrom
Conversation
|
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
# Conflicts: # eslint.config.mjs # packages/rum-react/package.json # test/e2e/lib/framework/createTest.ts # test/e2e/lib/framework/pageSetups.ts # yarn.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The idea is to implement the NextJS App Router integration. It is added as a optional parameter in the React Integration.
plugins: [reactPlugin({ nextjs: true })],This PR has 3 parts:
Plugin Implementation.
For
Plugin Implementationwe've expanded the React Integration Plugin to support NextJS App Router routing. This way we can use existing React Integration Components like:UNSTABLE_ReactComponentTrackerandaddReactError.DatadogRumProvider: This is the main entrypoint for the plugin. It uses a useEffect, so we need to make sure we are in the client side, to start a new view. We wrap<>children</>.Because NextJS components that use
use clientstill render partially on the server, we will need to provide documentation for an intermediary component were we init and re export it in the client side.historyTracking: Intercepts browser History API methods (pushState, replaceState) and the popstate event to detect navigation changes.viewTracking: Util functions to normalize a view name (e.g., /product/123 -> /product/:id) andstartNextjsViewE2E setup and tests.