DEV Community

Alex Spinov
Alex Spinov

Posted on

Qwik Has a Free API: The Framework That Ships Zero JavaScript by Default

What if your web app loaded instantly because it sent zero JavaScript to the browser by default? That's Qwik.

What Is Qwik?

Qwik is built on resumability. Instead of hydrating your entire app on the client, Qwik serializes app state into HTML and only loads JavaScript when the user interacts with something.

import { component$, useSignal } from '@builder.io/qwik';

export default component$(() => {
  const count = useSignal(0);
  return (
    <div>
      <h1>Count: {count.value}</h1>
      <button onClick$={() => count.value++}>Increment</button>
    </div>
  );
});
Enter fullscreen mode Exit fullscreen mode

The $ suffix tells the compiler: this code loads only on first click. Builder.io benchmark: Next.js 198KB/4.2s TTI vs Qwik 3.5KB/0.8s TTI. O(1) JavaScript — app size doesn't affect load time.

npm create qwik@latest
Enter fullscreen mode Exit fullscreen mode

Building performance-critical apps? Check out my developer toolkit or reach out at spinov001@gmail.com.

Top comments (0)