Skip to content

fix(nuxt): Parametrize routes on the server-side #16785

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

Merged
merged 13 commits into from
Jul 8, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 1, 2025

Adds route parametrization for server API routes for production builds.

part of #16684

@s1gr1d
Copy link
Member Author

s1gr1d commented Jul 2, 2025

image

The E2E tests are failing because the parametrized transaction name is /** when loading a parametrized page URL. But when calling an API route, it's keeping the full URL like this: /api/test-param/:param.

Trying to find a way to keep the URLs for the page requests.

@s1gr1d s1gr1d marked this pull request as draft July 7, 2025 12:28
@s1gr1d s1gr1d force-pushed the sig/nitro-parametrized-routes branch from 7e9af3b to 4e75465 Compare July 7, 2025 14:29
s1gr1d added a commit that referenced this pull request Jul 8, 2025
While working on route parametrization, [it came up in this
PR](#16785) that
there are different transactions/spans which should be parametrized:
- `pageload` transaction -> it's already parametrized because of the
`vueIntegration`
- SSR `http.server` transaction -> not parametrized
- `http.client` span when doing an extra server request -> not
parametrized
- `http.server` span when doing an extra server request -> not
parametrized

This test is added to have a visualization of the current state of
parametrization to be able to iterate on it.

**The PR is quite long but the test case and the tests are just
copy-pasted to all Nuxt E2E tests.**
@s1gr1d s1gr1d marked this pull request as ready for review July 8, 2025 09:29
@s1gr1d s1gr1d requested review from chargome and andreiborza July 8, 2025 09:30
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

none of my comments are blocking

@s1gr1d s1gr1d merged commit b746c23 into develop Jul 8, 2025
162 checks passed
@s1gr1d s1gr1d deleted the sig/nitro-parametrized-routes branch July 8, 2025 15:07
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.

3 participants