Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A parser for the React Server Components when sent over the network

License

NotificationsYou must be signed in to change notification settings

alvarlagerlof/rsc-parser

Repository files navigation

This is a parser for React Server Components (RSC) when sent over the network. React uses a format to represent a tree of components/html or metadata such as required imports, suspense boundaries, and css/fonts that needs to be loaded.

I made this tool to more easily let you understand the data and explore it visually.

Comparison

imageimage

How do I use this?

Extension

There is a Chrome Extension that you can addhere.

npm package

You can also add the parser as a package to your project. You'll get an embedded panel component that you can render in a layout.tsx for example.

First, install@rsc-parser/embedded from npm like:yarn add @rsc-parser/embedded

Then you can load it in alayout.tsx for example.

import{Suspense,lazy}from"react";constRscDevtoolsPanel=lazy(()=>import("@rsc-parser/embedded").then(module=>({default:module.RscDevtoolsPanel,})),);exportdefaultfunctionRootLayout({ children}){return(<htmllang="en"><body>{children}{/* Use any condition or flag you want here */}{process.env.NODE_ENV==="development" ?(<Suspense><RscDevtoolsPanel/></Suspense>) :null}</body></html>);

Website

There is also a website that you can use by manually copy pasting RSC payloads.

  1. Go to a site that uses the NextJS App router or generally is based on React Server components.
  2. Open the network tab in your dev tools
  3. Reload.
  4. Look for fetch responses the payload roughly looks like json, but each like starts with something likeO:,1:I,b: or similar.
  5. Copy the text and paste it into the form onhttps://rsc-parser.vercel.app/
  6. Explore!

It crashed!

Please make an issue onhttps://github.com/alvarlagerlof/rsc-parser/issues/new and include the text content that the parser was unable to handle.

About

A parser for the React Server Components when sent over the network

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp