mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1063] [MERGED] feat(app-router): add navigation trace reason-code shell #1061
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1061
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1063
Author: @NathanDrake2406
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @james-elicx
Base:
main← Head:nathan/726-ops-01-navigation-trace-shell📝 Commits (2)
28562c0feat(app-router): add navigation trace reason-code shella508dccfix(app-router): tighten navigation trace shell📊 Changes
4 files changed (+239 additions, -7 deletions)
View changed files
📝
packages/vinext/src/server/app-browser-navigation-controller.ts(+9 -1)📝
packages/vinext/src/server/app-browser-state.ts(+68 -6)➕
packages/vinext/src/server/navigation-trace.ts(+60 -0)📝
tests/app-browser-entry.test.ts(+102 -0)📄 Description
What this changes
Adds the
#726-OPS-01compact navigation trace shell for the App Router navigation commit seam. Pending commit classification can now opt into a structuredNavigationTracewith compact reason codes for current dispatch, stale operation skip, root-boundary hard navigation, and unknown root-layout legacy fallback.Why
Issue #726 calls out that
NavigationTraceshould use compact reason codes and structured fields instead of narrative logs. The current commit classification path only returned a string disposition, which made follow-up lifecycle work choose between losing operational context or inventing ad hoc logs at each call site.Approach
Added
packages/vinext/src/server/navigation-trace.tswith schema version 0, compact reason codes, structured field names, and small trace construction helpers.Threaded traces through
resolvePendingNavigationCommitDispositionDecision()while preserving the existingresolvePendingNavigationCommitDisposition()string-only helper as the allocation-light hot-path API used by browser navigation.resolveAndClassifyNavigationCommit()stays on the allocation-light disposition path because the current controller does not consume traces yet.Non-goals: this does not promote new navigation planner semantics, change visible commit behavior, add runtime logging, or claim cache or skip-transport authority. It is the trace contract shell only.
Validation
vp test run tests/app-browser-entry.test.tsvp check packages/vinext/src/server/navigation-trace.ts packages/vinext/src/server/app-browser-state.ts tests/app-browser-entry.test.tsvp run knip --no-progressvp check --fixandknip --no-progressRisks / follow-ups
The trace field set is intentionally narrow to stay parallel-safe with the other Wave01 branches. Later #726 OPS tasks can extend the field/code taxonomy as more semantic owners move behind typed commit decisions.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.