Loading video...

Video Failed to Load

Go Home

What if you could use web workers directly from JSX? 🤯 expensiveStuff())} > Run in web worker!

222,545 views • 3 years ago •via X (Twitter)

10 Comments

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

worker$ is powered by @QwikDev code extraction, check out how it works:

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

worker$ is an experimental feature you can try installing @builder.io/qwik-worker, but Qwik 1.0 is already released!

Aral Roca's profile picture
Aral Roca3 years ago

I like much this approach wrapping the function with server$ or worker$ than using "use server" or "use client" as Next.js do. It's more natural.

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

it is really a primitive (not a feature) that developers can use to build on top (not only the core team), wrote about it here:

José Donato 🦋's profile picture
José Donato 🦋3 years ago

this is mind blowing 🤯 at this point @QwikDev must be the most innovative frontend framework out there

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

@QwikDev The most amazing thing, is that this is built on top of the serialization and code extraction primitives that power resumability! this util is 100% user-land code!

Tob 🌿📯 𝕏's profile picture
Tob 🌿📯 𝕏3 years ago

@manucorporat Are there any plans for abortController api for worker$ and server$? I have a use case already in our new store for aborting relation fetch when link is navigating.

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

I am keeping it in a different repo, so we can experiment, discover what's needed and eventually graduate it into an API of QwikCity! so i would say so! abortController support would be amazing

real007's profile picture
real0073 years ago

@QwikDev The animation did stop for a little bit tho🙈. Nevertheless really really impressive stuff 👌

Manu (Qwik)'s profile picture
Manu (Qwik)3 years ago

@MrH26750794 @QwikDev ah!! i think it's actually some dev server + the instantiation of the worker itself (if called a second time, it would not see it). Nothing compared to running the same thing in main though :)

Related Videos