Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: passthrough of query - #2975

#2975
Merged
serhalp merged 1 commit into
npmx-dev:mainnpmx-dev/npmx.dev:mainfrom
johnnyreilly:fix-passthrough-of-queryjohnnyreilly/npmx.dev:fix-passthrough-of-queryCopy head branch name to clipboard
Jun 29, 2026
Merged

fix: passthrough of query#2975
serhalp merged 1 commit into
npmx-dev:mainnpmx-dev/npmx.dev:mainfrom
johnnyreilly:fix-passthrough-of-queryjohnnyreilly/npmx.dev:fix-passthrough-of-queryCopy head branch name to clipboard

Conversation

@johnnyreilly

Copy link
Copy Markdown
Contributor

🔗 Linked issue

The hope is that this fix will make the change implemented in #2800 work when npmx is deployed. That fix worked locally, but not when live.

🧭 Context

For reasons that I don't fully understand (still a nuxt noob) the query options were not being passed through.

📚 Description

This PR changes the nuxt config in a way that I think will mean it passes through what we need and things should start to work. I hope. I don't know how to test this though. Working locally isn't enough I know; is there a way to push this to a preview environment or similar? Dunno. cc @gameroman

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jun 29, 2026 7:02am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Jun 29, 2026 7:02am
npmx-lunaria Ignored Ignored Jun 29, 2026 7:02am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Package pages now preserve selected query parameters during page regeneration, helping links keep the current tab or filtered view.
    • Improved incremental page updates for package routes so query-based states are handled more consistently.

Walkthrough

getISRConfig in nuxt.config.ts is extended with optional passQuery and allowQuery fields on ISRConfigOptions. These are conditionally merged into the returned isr config. The /package/** route rule is updated to use passQuery: true and allowQuery: ['activeTab'].

Changes

Query-aware ISR for /package/**

Layer / File(s) Summary
ISRConfigOptions extension and route rule update
nuxt.config.ts
ISRConfigOptions gains allowQuery?: string[] and passQuery?: boolean. getISRConfig constructs an extraISR object that conditionally injects these into the returned isr config for both the fallback and non-fallback branches. The /package/** route rule is updated to pass passQuery: true and allowQuery: ['activeTab'] to the helper.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: making query parameters pass through Nuxt ISR routing.
Description check ✅ Passed The description is directly related to the query passthrough fix and the deployment issue it aims to resolve.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
nuxt.config.ts (1)

465-472: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid masking the ISR shape with a narrow assertion.

as { expiration: number } disables checking for the new passQuery/allowQuery fields in this branch, so a typo or unsupported key here will still compile. Please give getISRConfig an explicit return type, or use satisfies against the Nuxt ISR type, so these additions stay type-checked. As per coding guidelines, "Ensure you write strictly type-safe code".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nuxt.config.ts` around lines 465 - 472, The `getISRConfig` return shape is
being narrowed by the `as { expiration: number }` assertion, which bypasses
type-checking for `passQuery`, `allowQuery`, and other ISR fields in this
branch. Update `getISRConfig` to use an explicit return type or a `satisfies`
check against the Nuxt ISR config type so the `isr` object remains fully
type-safe. Keep the existing logic in the `options.fallback` and `extraISR`
merge, but remove the narrow assertion so typos or unsupported keys are caught
at compile time.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@nuxt.config.ts`:
- Around line 465-472: The `getISRConfig` return shape is being narrowed by the
`as { expiration: number }` assertion, which bypasses type-checking for
`passQuery`, `allowQuery`, and other ISR fields in this branch. Update
`getISRConfig` to use an explicit return type or a `satisfies` check against the
Nuxt ISR config type so the `isr` object remains fully type-safe. Keep the
existing logic in the `options.fallback` and `extraISR` merge, but remove the
narrow assertion so typos or unsupported keys are caught at compile time.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: af9d374c-9485-40ed-a787-8405da3d1a31

📥 Commits

Reviewing files that changed from the base of the PR and between 04a35e7 and 982d7e9.

📒 Files selected for processing (1)
  • nuxt.config.ts

@johnnyreilly

Copy link
Copy Markdown
Contributor Author

Hmmm I tried testing with:

https://npmxdev-git-fork-johnnyreilly-fix-passthrough-of-query-npmx.vercel.app/

but going here doesn't seem to work:

https://npmxdev-git-fork-johnnyreilly-fix-passthrough-of-query-npmx.vercel.app/package/webpack?activeTab=versions

This leads me to think that the fix potentially hasn't worked? If anyone understands nuxt better than me I'd love to hear a suggestion!

@johnnyreilly

Copy link
Copy Markdown
Contributor Author

Oh wait! It seems to work now! I don't know what's different, but it just worked! Yay!

@gameroman gameroman added the needs review This PR is waiting for a review from a maintainer label Jun 29, 2026
@gameroman
gameroman requested a review from a team June 29, 2026 10:32
@serhalp serhalp removed the needs review This PR is waiting for a review from a maintainer label Jun 29, 2026
@serhalp
serhalp added this pull request to the merge queue Jun 29, 2026
Merged via the queue into npmx-dev:main with commit 888b2e3 Jun 29, 2026
25 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 29, 2026
@johnnyreilly
johnnyreilly deleted the fix-passthrough-of-query branch June 29, 2026 11:11
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.