feat: make usePreventNavigate$ and request.rewrite() stable#8631
Conversation
…moving their experimental feature flags
🦋 Changeset detectedLatest 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 |
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
There was a problem hiding this comment.
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/enableRequestRewritefrom the Qwik ViteExperimentalFeaturesenum and generated optimizer API docs. - Remove runtime throws that required experimental flags for
usePreventNavigate$andrequest.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 referenceusePreventNavigate$()is misleading. Consider changing it tousePreventNavigate$(without()) or explicitly mention it’s called asusePreventNavigate$((url) => ...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

No description provided.