Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Qwik Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-qwik-knowledge-patch-nevaberry-plugins)
---
name: qwik-knowledge-patch
description: Qwik
version: "1.19.0"
license: MIT
metadata:
author: Nevaberry
---
# Qwik knowledge patch
Load this skill when migrating Qwik applications or libraries, configuring builds,
or working with reactive state, components, routing, SSR, and deployment.
Use the topic references for complete guidance and version-specific behavior.
## Reference index
| Reference | Topics |
| --- | --- |
| [Async Reactivity and State](references/async-reactivity-and-state.md) | Async computations, signal reads, stores, task timing, cleanup, workers, serialization |
| [Build and Deployment](references/build-and-deployment.md) | Vite, optimizer, assets, manifests, environments, SSR, preloads, service workers, static generation |
| [Components and Events](references/components-and-events.md) | Error boundaries, Suspense, Show, JSX, listeners, runtime containers, MDX |
| [Migration and Packaging](references/migration-and-packaging.md) | Package imports, ESM, library compatibility, CLI integrations, Insights |
| [Router and Navigation](references/router-and-navigation.md) | Router setup, guards, transitions, prefetching, rewrites, error pages, document heads |
| [Server and Route Data](references/server-and-route-data.md) | Loader requests, caching, validation, server functions, mocks, request events, adapters |
## Breaking changes and deprecations
### Packages and bundler configuration
In v2, Qwik City becomes Qwik Router: change `@builder.io/qwik-city` imports to
`@qwik.dev/router`. Qwik drops CommonJS and UMD builds in v2 beta.14; switch tooling
that loads Qwik with `require()` to ESM imports.
V2 beta.40 requires Vite 8 and Rolldown. Migrate `output.manualChunks` rules to
`output.codeSplitting.groups`. From v2 beta.38, use `output.assetFileNames` to
relocate built assets; Qwik's handling of Vite's `build.assetsDir` was removed.
The client build rejects server-only modules from v2 beta.37; keep their imports
in server code.
Rebuild v1 libraries with v1.9 or later so the consumer build can apply the Qwik
transform. V2 consumers can keep `@builder.io/qwik` at `^1.11.0` alongside
`@qwik.dev/core` to resolve those libraries' v1 types.
### Async computation and scheduling
V2 beta.41 removes `useAsync$` and `createAsync$`; use `useComputed$` or
`createComputed$` for async computations. The v2 beta line deprecates `useResource$`
and `<Resource>`. The compute context provides `track()`, and `clientOnly: true`
skips SSR computation.
In v1.10, async `useComputed$` callbacks are deprecated because reads after the
first `await` escape dependency tracking. For v1, use `useResource$` for async data
or `useTask$` with explicit tracking to update a signal.
In v2 beta.39, replace `allowStale: false` with explicit `.clear()` to discard the
current value. Move computed signal scheduling out of `expires`, `poll`, or
`interval` and into `usePoll` from `@qwik.dev/utils`.
The `useTask$` option `eagerness` is deprecated in v1.13 for the v2 migration.
### Error boundary migration
In v2 beta.42, enable `experimental: ['errorBoundary']` in `qwikVite` and import
`ErrorBoundary` from `@qwik.dev/core` to replace the removed `useErrorBoundary()`.
`fallback$` receives `(error, reset)`, and `onError$` reports catches.
Production replaces server-origin errors with a generic message and digest,
including when serializing errored async signals. Client-origin errors render as
thrown. For a catch before the first SSR flush, `renderToStream` reports it through
`onBeforeFirstFlush`; the router sends `Cache-Control: no-store` for those pages
and for error documents.
### Route data migration
From v2 beta.37, remove `q-data.json` cache rules. SPA navigation requests individual
`q-loader-${hash}.${manifestHash}.json` resources; a new build changes their URLs
through the manifest hash.
In v2 beta.39, replace `expires` and `poll` on `routeLoader$` with `cacheControl`.
Every navigation requests loader data through the browser cache, and unchanged
responses leave the current render intact.
V2 beta.37 loader hooks return async signals: thrown errors appear on `.error`, and
reading `.value` rethrows them. From beta.38, returning `fail()` sets a loader value
with a `failed` field. Move action-state reads out of `routeLoader$` in beta.37:
read the action signal in the component or have the action update URL state that
the loader reads.
Use `search` to declare which query parameters a loader receives and re-runs for.
In v2 beta.37, omitting `search` with the default `qwikRouter({ strictLoaders: true })`
gives the loader no query parameters; `strictLoaders: false` passes all of them.
Update page and loader `cacheKey` callbacks to `(requestEv: RequestEvent, eTag: string)`.
### Preload options and service workers
In v2 beta.33, remove `preloads.ssrPreloadProbability`, `preloads.preloadProbability`,
`preloads.debug`, and legacy service worker `prefetchStrategy` from `renderToStream`
options. In v2 beta.41, remove imports from `@qwik.dev/router/service-worker`;
`setupServiceWorker` has no effect in v2.
For the v1 module-preload migration, keep an existing `<ServiceWorkerRegister />`
or `<PrefetchServiceWorker />` so it unregisters the legacy worker and, from v1.16,
removes associated caches. From v1.16.1, Qwik City preserves workers with custom
logic. To retire a prefetch-only worker, remove `service-worker.ts` files and keep
`<ServiceWorkerRegister />` mounted while returning users still need removal.
### Custom adapters and server functions
For v2 custom middleware setup, remove `qwikRouterConfig` and imports from
`@qwik-router-not-found-paths` and `@qwik-router-static-paths`. In beta.32, remove
reliance on the router factory's `notFound` export; use `router` to handle misses.
In v1.13, `@plugin` middleware can catch `server$` errors, and `server$` calls throw
4xx errors on the client. V2 beta.12 logs thrown server-function errors on the
server, except `ServerError`; beta.39 runs server-function requests outside route
middleware.
## Common features and operational guidance
### Async signals and task timing
For v2 async computed signals, a synchronous compute error populates `.error` and
rethrows when `.value` is read. An async computation can track an endpoint and
skip SSR computation:
```tsx
const result = useComputed$(async ({ track }) => {
const url = track(() => endpoint.value);
return (await fetch(url)).json();
}, { clientOnly: true });
```
In v2 beta.24, `signal.untrackedValue` reads without subscribing and permits
assignment without immediately notifying subscribers. Use `signal.trigger()` after
that assignment or an in-place object mutation that leaves identity unchanged.
In v2 beta.18–36, `useTask$` and `useVisibleTask$` await a promise returned by cleanup
before their next invocation. `render()` resolves independently of `useVisibleTask$`,
which runs after the flush. On resume, visibility-triggered tasks wait for visibility;
during client-only rendering, they run without waiting for visibility.
### Suspense and conditional rendering
Enable `<Suspense>` with `qwikVite({ experimental: ['suspense'] })` in v2 beta.35–39.
Client rendering applies the configured fallback delay. From beta.39, the fallback
appears only during initial loading, and `showStale` is removed. Out-of-order
Suspense streaming is experimental from beta.36.
Experimental `Reveal` in v2 beta.35 coordinates sibling `Suspense` boundaries with
`parallel`, `sequential`, `reverse`, or `together` ordering. Use `collapsed` to hide
pending boundaries waiting for their turn. Experimental `<Show>` in beta.38 uses
`when$` to select the `then$` branch or an optional `else$` branch.
### Loader caching and middleware
In v2 beta.37, a loader can use `eTag` to skip fetching unchanged data and `cacheKey`
to cache the result. `RequestEvent.internalRequest` identifies framework JSON
requests. Loader requests go through page middleware; same-path `index.*`
middleware applies only to loaders defined in that index module. Loader-originated
redirects travel in JSON responses. Beta.39 enforces blocking loader guards on
these requests.
In v2 beta.38, enable the experimental `blockSSR` flag and set `blockSSR: false` on
individual loaders to allow background execution. Give loaders created through
the same shared wrapper distinct `id` values: the wrapper can yield the same
optimizer-assigned ID, and development warns about distinct loaders sharing an ID.
### Navigation, error pages, and heads
From v2 beta.36, remove experimental opt-ins for `usePreventNavigate$` and
`request.rewrite()`; both are enabled by default. In beta.38, SPA view transitions
are opt-in through `viewTransition={true}` on `QwikRouterProvider`; rename the
separate `Link` prop `prefetchBundle` to `prefetchBundles`.
In v2 beta.38, returning `ev.redirect()`, `ev.error()`, or `ev.rewrite()` has the same
effect as throwing it in a request handler, loader, action, or server function.
Passing an absolute URL to `rewrite()` produces HTTP 400 from beta.26.
From v2 beta.38, route misses use the nearest `404.tsx`, static builds prerender it,
and `404.tsx` and `error.tsx` inherit their layouts. Use `404!.tsx` to opt out of
layout inheritance. `error.tsx` can use `useHttpStatus()` for other statuses.
In v2 beta.29, an object or function export named `routeConfig` takes precedence
over separate `head`, `eTag`, and `cacheKey` exports in the same module.
### SSR caching and static generation
In v2 beta.29–37, a page `eTag` can return 304 on a match before rendering.
`cacheKey` caches rendered HTML in memory; clear it with `clearSsrCache()` from the
request-handler middleware. From beta.37, with `cacheKey` alone, the router hashes
cached HTML to produce an ETag for subsequent requests.
From v2 beta.38, switch custom SSG builds from Vite's `build()` to
`createBuilder().buildApp()` to run the dedicated SSG environment. In beta.43,
static generation marks a route as failed when `<ErrorBoundary>` catches during
prerendering, even if it renders a fallback. Prerendered routes redirect requests
to the configured trailing-slash form, adding or removing the slash as needed.
### Build configuration and deployment
Use `vite build --app` for multiple Vite environments in v2 beta.28. Router adapters
with a separate Vite configuration still need their own `build.server` run.
When the Vite plugin reports a Qwik library as external, add it to `ssr.noExternal`.
The plugin checks during build; dependency auto-detection reads `package.json`
files upward from the Vite root, including workspace-root dependencies.
For v2, import `getClientManifest` from `@qwik.dev/core` instead of
`@qwik-client-manifest`. Configure a nonstandard SSR manifest location with
`qwikVite({ ssr: { manifestInputPath: 'dist/client/q-manifest.json' } })`.
For v1 module preloading, serve content-hashed files under `build/` and `assets/`
with `Cache-Control: public, max-age=31536000, immutable`; adapt the cache rule when
customizing filenames. From v1.16.1, `qwik check-client` verifies client bundle
freshness. Use `qwik add csr` for a client-only Qwik app from v2 beta.10.