-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a button to parse from
__next_f
from script tags in @rsc-parse/…
…embedded Next.js stores the RSC payload in script tags. I've added a button to the panel in `@rsc-parse/embedded` to make #923 easier to debug.
- Loading branch information
1 parent
2cd0dd4
commit 55421c4
Showing
5 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@rsc-parser/embedded": patch | ||
"@rsc-parser/core": patch | ||
"@rsc-parser/embedded-example": patch | ||
"@rsc-parser/chrome-extension": patch | ||
"@rsc-parser/storybook": patch | ||
"@rsc-parser/website": patch | ||
--- | ||
|
||
Add a button to read Next.js payload script tags |
14 changes: 14 additions & 0 deletions
14
packages/core/src/components/ReadNextScriptTagsButton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { ReadNextScriptTagsButton } from "./ReadNextScriptTagsButton"; | ||
|
||
const meta: Meta<typeof ReadNextScriptTagsButton> = { | ||
component: ReadNextScriptTagsButton, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ReadNextScriptTagsButton>; | ||
|
||
export const example: Story = { | ||
name: "example", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
export function ReadNextScriptTagsButton({ | ||
onClickRead, | ||
}: { | ||
onClickRead: () => void; | ||
}) { | ||
return ( | ||
<button | ||
className="rounded-md bg-slate-600 px-2 py-0.5 text-white dark:bg-slate-300 dark:text-black" | ||
onClick={onClickRead} | ||
> | ||
Read Next.js script tag payload | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters