v0.16.0
Introduces several deprecations in aim to simplify the lifecycle model and prepare Qwik for the future and stable release.
useTask$()
The deprecations include useMount$()
, useWatch$()
, useServerMount()
and useClientMount$()
, all of them now become useTask$()
!
useMount$()
->useTask$()
useWatch$()
->useTask$()
useServerMount$()
->useTask$()
+isServer
useClientMount$()
->useTask$()
+isBrowser
You might be surprised, how all of them can be replaced with useTask$()
?
Actually, useWatch$()
already behaved like useMount$()
when no track
was used.
Please look at the updated lifecycle docs:
https://qwik.builder.io/docs/components/lifecycle/
Old code:
import { useMount$, useWatch$ } from '@builder.io/qwik';
export function MyComponent() {
const signal = useSignal(0);
useMount$(() => {
console.log('mount');
});
useWatch$(({track}) => {
track(signal)
console.log('watch');
});
useServerMount$(() => {
console.log('server mount');
});
useClientMount$(() => {
console.log('client mount');
});
}
New code:
import { useTask$ } from '@builder.io/qwik';
import { isServer, isBrowser } from '@builder.io/qwik/build';
export function MyComponent() {
const signal = useSignal(0);
useTask$(() => {
console.log('mount');
});
useTask$(({track}) => {
track(signal);
console.log('watch');
});
useTask$(() => {
if (isServer) {
console.log('server mount');
}
});
useTask$(() => {
if (isBrowser) {
console.log('client mount');
}
});
}
Deprecating node-fetch
in favor of undici
Future versions of node will include fetch()
natively. This version is based on undici.
In order to prepare for a future where we dont need a polifyll, we are deprecating node-fetch
in favor of undici
.
Vite 4
We are updating Qwik to Vite 4!! Read about the announcement!
QwikCity!
Soon we will release 0.1.0 of QwikCity features a brand new API that will drastically simplify how you build your apps. It's called Server Functions and it's gonna be awesome!
Coming soon!
What's Changed
- docs: removed unnecessary fragments by @the-r3aper7 in #2361
- docs: Add Guide On Using Map Functions In JSX by @Kesmek in #2373
- docs: remove async from component$ overview by @shairez in #2377
- feat: add config for dev inspector by @zanettin in #2375
- docs(qwik-v-react): fix array key consistency in docs by @jweb89 in #2383
- fix(vite): module side effect by @manucorporat in #2387
- feat: detect invalid HTML by @manucorporat in #2389
- chore: fix link accessibility by @reemardelarosa in #2386
- feat: standardize params/query api by @adamdbradley in #2385
- docs(contributing): Add install note for wasm-pack by @machineloop in #2390
- docs: Add latest 'Qwik City for Resumable, Dynamic Apps' interview with Misko by @machineloop in #2401
- fix: scope vite plugin qwik manifest so that apps can run in parallel by @dario-piotrowicz in #2398
- fix: options like maxWorkers not passed to the generate method by @jwickers in #2400
- feat(adaptors): add adaptor for Azure Static Web Apps by @derkoe in #2384
- feat: add Google Cloud Run integration by @DustinJSilk in #2395
- refactor: merge useMount and useWatch into useTask by @manucorporat in #2379
- docs: add example of using :global() css selector by @DustinJSilk in #2408
- Remove irrelevant netlify notes from node docs by @elyobo in #2420
- docs: fix link useTask by @forresst in #2425
- docs: add builder.io OSS header bar by @mhevery in #2430
- fix: error messages typos by @shairez in #2434
- docs: add builder.io OSS header bar by @mhevery in #2438
- docs: cleanup adapters files (fixes #2421) by @zanettin in #2445
- fix: preview server should use the configured outDir by @dmitry-stepanenko in #2423
- feat: server actions by @manucorporat in #2394
- fix: add eslint serialization classes by @manucorporat in #2453
- Release 0 16 0 by @manucorporat in #2455
- fix: streaming loader by @manucorporat in #2454
- fix: number values for style by @manucorporat in #2456
- chore: add node-fetch by @manucorporat in #2457
New Contributors
- @Kesmek made their first contribution in #2373
- @jweb89 made their first contribution in #2383
- @machineloop made their first contribution in #2390
- @derkoe made their first contribution in #2384
- @DustinJSilk made their first contribution in #2395
- @elyobo made their first contribution in #2420
- @dmitry-stepanenko made their first contribution in #2423
Full Changelog: v0.15.2...v0.16.0