Elvis .N.

monorepo

devlog

Decomposing Monoliths: A Journey into Converting an Open Source Project to a Monorepo

6 months ago . 2 min read

Share:

article

Suspense> works by wrapping a component that performs an asynchronous action (e.g. fetch data), showing fallback UI (e.g. skeleton, spinner) while it's happening, and then swapping in your component once the action completes.

app/dashboard/page.tsx

import { Suspense } from 'react' import { PostFeed, Weather } from './Components' export default function Posts() { return ( <section> <Suspense fallback={<p>Loading feed...</p>}> <PostFeed /> </Suspense> <Suspense fallback={<p>Loading weather...</p>}> <Weather /> </Suspense> </section> ) }

By using Suspense, you get the benefits of:

Streaming Server Rendering - Progressively rendering HTML from the server to the client.

Selective Hydration - React prioritizes what components to make interactive first based on user interaction.

For more Suspense examples and use cases, please see the React Documentation

.

SEO

tool from Google to see how your page appears to Google's web crawlers and view the serialized HTML (source

Status Codes

When streaming, a 200 status code will be returned to signal that the request was successful.

The server can still communicate errors or issues to the client within the streamed content itself, for example, when using redirect or notFound. Since the response headers have already been sent to the client, the status code of the response cannot be updated. This does not affect SEO.

More Articles

profile

My journey Converting a Sveltekit Repo into a Monorepo using Turbo

Bringing all 3 ClassroomIO.com projects into one repository. Challenges setting up build steps and configs.

monorepo
open source
portfolio v1