github QwikDev/qwik v0.16.0

latest releases: @builder.io/qwik-city@1.9.0, @builder.io/qwik@1.9.0, eslint-plugin-qwik@1.9.0...
21 months ago

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$()?

The really is that useWatch$() before already behaved like useMount$() when no track was used:

Please look update 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

New Contributors

Full Changelog: v0.15.2...v0.16.0

Don't miss a new qwik release

NewReleases is sending notifications on new releases.