9/18 | Validate feature ideas earlier with AI-driven prototypes

What are best AI tools? Take the State of AI survey

Builder.io
Builder.io
Contact sales

9/18 | Validate feature ideas earlier with AI-driven prototypes

What are best AI tools? Take the State of AI survey

Builder.io
Builder.io
< Back to blog

QWIK

Astro + Qwik: Houston, we have Resumability!

November 8, 2023

Written By Jack Shelton

Hey Devs! My name is Jack, and I am a freelance fullstack developer based in Texas. I also work on this thing called Qwik UI in my free time. 🙂

The problem

In mid-late 2022, I had the opportunity to try Astro, a server-first, content-focused, and extremely flexible meta-framework on my day job.

It quickly became my go-to for creating landing pages, marketing websites, and even small web apps. If my clients needed something, it was almost always a click and integration guide away.

An image of a rocket on a notebook in space.

Astro sites significantly outperformed the previous static site generators I had used. I appreciated the speed and found it intuitive to work with.

Unfortunately, as I added more interactivity, my Astro sites began to slow down, despite Astro being the fastest meta-framework I had used up to that point!

My clients and I took notice of this. I spent a lot of time researching how to improve site speed, but in the end it always felt like an uphill battle of optimizing versus adding the stuff my clients needed.

The journey

In an ideal world, you could build your application, and it would be extremely fast, regardless of the level of interactivity or the size of your page. This appears to be an unsolvable problem. The more components we add, the slower it gets.

I wondered, did it have to be this way? Is it even possible to have a fast and easy development process? Is it the developer’s fault when our apps are slow?

Looking back, I’d say no! Developers should focus on what matters most: building the product! So, how do we solve this issue? For a while, it was a big what if. 😅

That what if quickly became a reality when I discovered Qwik’s resumability. I was 100% certain it was exactly what I was looking for.

So I did some research. I saw a lot of comparisons between the two in terms of performance. April this year I thought “why don’t we use them together?” One is a meta-framework, and the other a UI framework.

Would it still be resumable?

Is Astro’s partial hydration approach going to be a problem with a framework that doesn’t have hydration?

How would it work with islands?

Well, turns out I wasn’t the only one!

A screenshot of a Discord chat between Misko and Jack.

After some awesome help from Misko, creator of Angular and Qwik, as well as the Astro core team, I can finally answer that question I had back in April.

Introducing @qwikdev/astro:

Astro’s first resumable UI framework.

Starts fast, stays fast

One of Astro's key features is Zero JS, by default.

Unfortunately, this is usually not the case after adding a JavaScript framework and any subsequent components.

If we want to introduce interactivity with a framework, such as React, Vue, Svelte, and so on, the framework runtime is then introduced. The number of components added to the page also increases linearly O(n) with the amount of JavaScript.

Adding Qwik

Qwik builds on top of Astro's Zero JS, by default principle and then some. Thanks to resumability, the components are not executed unless resumed. Even with interactivity, the framework is also not executed until it needs to be. It is O(1) constant, … with zero effort on the developer.

An Illustration of hydration vs resumability.

This integration for Astro enables resumability, fine-grained lazy loading, and many of the Qwik core stuff we know and love.

This includes all of the Astro goodies, like view transitions, MDX collections, and the hundreds of integrations that Astro provides.

So where would @qwikdev/astro make sense?

You can use it anywhere you’re currently using a framework component in Astro! Using Qwik and resumability should significantly speed up your site.

Do Qwik components need hydration directives?

Short answer, no!

In other UI frameworks, a hydration directive, such as client:only or client:load, would be needed for interactivity. However, these are not needed with Qwik because there is no hydration!

When using Qwik inside a meta-framework like Astro or Qwik City, components are loaded on the server, prefetched in a separate thread, and "resumed" on the client.

For example, here's how we use a Qwik counter component in Astro.

counter.tsx

index.astro

Does resumability work?

Yes! We can lazily execute code on interaction, just like using Qwik with Qwik City.

Here, we are refreshing the page, and you'll notice that nothing was executed until the button was clicked. Without resumability, our component would have been executed on page load.

The 402 byte q-chunk is our Counter's onClick$ handler.

What's in that 17.61kb chunk?

That's the framework! We do not execute it until it is needed. In this case, it is gzipped using SSG.

How about islands?

Instead of islands, we have Qwik containers! These fit quite well into Astro’s island model, having similar limitations.

Below is an example of a Qwik container in Astro. In the DOM, you'll notice there aren't any custom elements. This is because, to Astro, Qwik appears as static data.

Untitled

This is just the beginning! You can try out the integration in Alpha today, by running:

This integration is currently in Alpha release. We encourage you to try it and share your feedback. If you run into any problems, open up an issue in our GitHub Repository.

You can also view the package on NPM, Github, Qwik integration page, and the Astro integration page.

Join the fun and contribute!

Stay awesome devs,

-Jack

Light bulb tip icon.

Tip: Visit our Qwik hub and Astro Hub to learn more.

Share

Twitter
LinkedIn
Facebook
Share this blog
Copy icon
Twitter "X" icon
LinkedIn icon
Facebook icon

Visually edit your codebase with AI

Using simple prompts or Figma-like controls.

Try it nowGet a demo

Design to Code Automation

A pragmatic guide for engineering leaders and development teams


Continue Reading
design9 MIN
How to generate (actually good) designs with AI
September 17, 2025
AI9 MIN
7 Levels of Context Engineering for Designers
September 16, 2025
Design to Code8 MIN
Git Branching for Designers
September 11, 2025

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Resources

User Guides

Developer Docs

Forum

Blog

Github

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

  • Fusion

  • Publish

  • Product Updates

  • Design to Code

  • Headless CMS

    Multi-Brand CMS

  • Landing Pages

  • Web Apps

  • Prototypes

  • Marketing Sites

  • Headless Commerce

  • Documentation

  • Fusion Docs

  • Publish Docs

  • Blog

  • Webinars

  • Guides

  • Case Studies

  • Community Forum

  • Partners

  • Affiliate Program

  • CMS Integrations

  • CMS Blueprints

  • Glossary

  • Figma to Code Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

  • About

  • Careers

  • Contact Sales

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

YouTube icon
Github icon
Blsky Icon
Twitter "X" icon
LinkedIn icon
Feed Icon
Gartner Cool Vendor 2024