Skip to content

feat: make usePreventNavigate$ and request.rewrite() stable#8631

Merged
wmertens merged 1 commit into
build/v2from
v2-prevent-navigate-request-rewrite-stable
May 15, 2026
Merged

feat: make usePreventNavigate$ and request.rewrite() stable#8631
wmertens merged 1 commit into
build/v2from
v2-prevent-navigate-request-rewrite-stable

Conversation

@Varixo
Copy link
Copy Markdown
Member

@Varixo Varixo commented May 13, 2026

No description provided.

@Varixo Varixo self-assigned this May 13, 2026
@Varixo Varixo requested review from a team as code owners May 13, 2026 19:45
@Varixo Varixo added the V2 label May 13, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 137c075

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Varixo Varixo linked an issue May 13, 2026 that may be closed by this pull request
@maiieul maiieul moved this from Backlog to Waiting For Review in Qwik Development May 13, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8631

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8631

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8631

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8631

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8631

commit: 137c075

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 137c075

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR promotes usePreventNavigate$ and request.rewrite() from experimental to stable by removing their feature-flag gates, and updates the related docs/configuration to reflect that these APIs no longer require experimental: [...] opt-in.

Changes:

  • Remove preventNavigate / enableRequestRewrite from the Qwik Vite ExperimentalFeatures enum and generated optimizer API docs.
  • Remove runtime throws that required experimental flags for usePreventNavigate$ and request.rewrite()-driven rewrites.
  • Update docs site config + docs pages + redirects to point to the stable documentation locations.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/qwik-vite/src/qwik.optimizer.api.md Drops the two experimental enum members from generated optimizer API docs.
packages/qwik-vite/src/plugins/plugin.ts Removes preventNavigate and enableRequestRewrite from ExperimentalFeatures.
packages/qwik-router/src/runtime/src/use-functions.ts Removes the experimental-flag guard/throw from usePreventNavigateQrl.
packages/qwik-router/src/runtime/src/qwik-router-component.tsx Removes the experimental-flag guard/throw for request rewrite behavior.
packages/docs/vite.config.ts Removes preventNavigate from the docs site qwikVite({ experimental: [...] }) config.
packages/docs/src/routes/plugin@redirects.ts Adds redirects from the old labs URL to the stable prevent-navigation docs.
packages/docs/src/routes/docs/(qwikrouter)/routing/index.mdx Updates routing docs to reference stable usePreventNavigate$ docs URL.
packages/docs/src/routes/docs/(qwikrouter)/advanced/prevent-navigation/index.mdx Removes “experimental” framing and updates wording for stable API.
packages/docs/src/routes/api/qwik-optimizer/index.mdx Removes the two experimental entries from optimizer API docs page.
packages/docs/src/routes/api/qwik-optimizer/api.json Removes the two enum-member entries from the generated API index JSON.
packages/docs/scripts/generate-llms.ts Adds LLM index entries for Prevent Navigation and Rewrites docs pages.
packages/docs/public/_redirects Adds public redirects for the old prevent-navigate labs URL.
.changeset/six-candies-grab.md Adds a changeset announcing stabilization of both APIs.
Comments suppressed due to low confidence (2)

packages/docs/src/routes/docs/(qwikrouter)/advanced/prevent-navigation/index.mdx:16

  • The docs say the prevent-navigation callback is called with "the URL" the user is navigating to, but the public type is (url?: number | URL) and SPA history navigations can pass a number. Consider updating this wording to reflect the actual callback parameter shape (URL | number | undefined) so users don’t implement checks that break on numeric values.

This issue also appears on line 12 of the same file.
packages/docs/src/routes/docs/(qwikrouter)/advanced/prevent-navigation/index.mdx:13

  • usePreventNavigate$ requires a callback argument, so the inline reference usePreventNavigate$() is misleading. Consider changing it to usePreventNavigate$ (without ()) or explicitly mention it’s called as usePreventNavigate$((url) => ...).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/qwik-vite/src/plugins/plugin.ts
Copy link
Copy Markdown
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

LGTM

@wmertens wmertens merged commit 9276d1c into build/v2 May 15, 2026
36 checks passed
@wmertens wmertens deleted the v2-prevent-navigate-request-rewrite-stable branch May 15, 2026 13:02
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

V2 features not experimental anymore

4 participants