nextjs - ✅(Solved) Fix User timings are lost in App Router [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#83956Fetched 2026-04-08 02:20:58
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

PR fix notes

PR #8069: Adds user timing marks and measures for hydration/render

Description (problem / solution / changelog)

For context, see Issue #8070.


This PR adds user timings for:

  • Link clicks
  • Before hydration and render
  • After hydration and render

With these marks, the following measures are added:

For page loads

  • Next.js-before-hydration: measures page load to "right before hydration"
  • Next.js-hydration: measures hydration step
<img width="1736" alt="Screen Shot 2019-07-22 at 4 50 01 PM" src="https://user-images.githubusercontent.com/12476932/61683343-1c51b980-acca-11e9-8ffa-3fd436c04b29.png">

For navigation

  • Next.js-nav-to-render: measures navigation start to "right before render"
  • Next.js-render: measures hydration step
<img width="1736" alt="Screen Shot 2019-07-22 at 4 52 12 PM" src="https://user-images.githubusercontent.com/12476932/61683391-2f648980-acca-11e9-8ce6-f1961feb6ec0.png">

Testing on a simple example app, hydration aligns with the hydrate method in the callstack (and the same for render)

<img width="1736" alt="Screen Shot 2019-07-17 at 2 10 43 PM" src="https://user-images.githubusercontent.com/12476932/61415715-5a07aa00-a8a6-11e9-9da7-95e5cf9cedeb.png">

Note: These marks are added for both development and production modes

Changed files

  • package.json (modified, +2/-1)
  • packages/next-server/lib/router/router.ts (modified, +6/-0)
  • packages/next-server/lib/utils.ts (modified, +6/-0)
  • packages/next/client/index.js (modified, +48/-3)

Code Example

any
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/vercel/next.js/tree/canary/examples/reproduction-template

To Reproduce

Open Perfomance tab on any App Router page

Current vs. Expected behavior

Work from https://github.com/vercel/next.js/pull/8069 is lost in App Router

Provide environment information

any

Which area(s) are affected? (Select all that apply)

Performance

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

extent analysis

TL;DR

Guidance

  • Check the App Router code for any discrepancies or missing optimizations that were introduced in the mentioned pull request.
  • Verify that the performance optimizations from the pull request are correctly applied and not overridden in the App Router implementation.
  • Compare the performance metrics of the App Router pages before and after the changes to identify any regressions.
  • Consider temporarily reverting changes or applying the optimizations from the pull request manually to the App Router to isolate the issue.

Notes

  • The lack of specific details about the performance issue and the changes made in the pull request limits the ability to provide a more targeted solution.
  • It is unclear whether the issue is due to a regression or an incomplete integration of the performance optimizations.

Recommendation

  • Apply workaround: Manually apply the performance optimizations from the pull request to the App Router code to verify if it resolves the issue, as the changes seem to be lost in the App Router implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING