ovr

ovr

A lightweight server framework built for streaming with asynchronous generator JSX.


Demo

Check out the demos to see ovr in action.


Introduction

Designed to optimize Time-To-First-Byte, ovr evaluates components in parallel and streams HTML in order by producing an AsyncGenerator of HTML that feeds directly into the streamed response.

For the following component:

tsx
function Component() {
	return <p>hello world</p>;
}

ovr generates three Chunks of HTML:

ts
"<p>"; // streamed immediately
"hello world"; // next
"</p>"; // last

Asynchronous streaming

While this streaming is trivial for a paragraph, consider when a component is asynchronous:

tsx
async function Username() {
	const user = await getUser(); // slow...

	return <span>{user.name}</span>;
}

function Component() {
	return (
		<p>
			hello <Username />
		</p>
	);
}

Instead of waiting for Username to resolve before sending the entire Component, ovr will send what it has immediately and stream the rest as it becomes available.

ts
"<p>";
"hello ";
// streamed immediately

// for await (const chunk of Username()) { ...
"<span>";
"username";
"</span>";
"</p>";

Render how browsers read

Web browsers are built for streaming, they parse and paint HTML as it arrives. Most critically, the head of the document can be sent immediately to start the requests for linked assets (JavaScript, CSS, etc.) and start parsing before the HTML has finished streaming.

ovr’s architecture gives you streaming server-side rendering out of the box. No hydration bundle, no buffering—just HTML delivered in order, as soon as it’s ready.