Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: utm parameters takes precedence over route params #82

Conversation

feugy
Copy link
Member

@feugy feugy commented Nov 5, 2024

📓 What's in there?

We've been reported that compute route could be using some search parameter names instead of path parameter names.
This PR fixes it.

🧪 How to test?

It has been tested locally with various version of Next.js, both pages and app router, and a special version of the debug script (soon released) which prints collected metrics to console.

In the following snapshots, the page has a single [slug] parameter, and a utm_content search parameter.

Version Pages App
[email protected] image image
next@14 image image
next@15 image image

❗ Notes to reviewers

Please note that I've updated our example next.js app to latest router, which includes a change how the Page component can access its path params.
The Node.js version is required by Next@15.
Finally, @jest/globals is needed because of biome (which we should consider migrating to, as well as vitest).

@feugy feugy requested a review from tobiaslins November 5, 2024 15:14
Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
speed-insights-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am
speed-insights-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am
speed-insights-nuxt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am
speed-insights-remix ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am
speed-insights-sveltekit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am
speed-insights-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 0:07am

Copy link

socket-security bot commented Nov 5, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem, network, shell, unsafe +70 118 MB vercel-release-bot
npm/[email protected] environment +1 6.45 MB fb, gnoff, react-bot, ...2 more
npm/[email protected] environment 0 239 kB react-bot

View full report↗︎

Copy link
Collaborator

@tobiaslins tobiaslins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

packages/web/src/nextjs/utils.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants