-
Notifications
You must be signed in to change notification settings - Fork 425
feat: server function inspector #2049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e597239
add seroval json mode
lxsmnsyc f7c3d70
Fix client-server comms
lxsmnsyc 6ff0178
Update server-functions-handler.ts
lxsmnsyc 49e6eb7
Add server function inspector
lxsmnsyc 0b33f97
Fix styling
lxsmnsyc c0bd34d
Fix new lines
lxsmnsyc 7b6e954
Create HexViewer.tsx
lxsmnsyc 1e1631f
Add `FormDataViewer`
lxsmnsyc 3f44067
add the remaining viewers
lxsmnsyc 88b0542
Add plugin and sequence renderer
lxsmnsyc e01488f
add more tests
lxsmnsyc 6f326c8
final output
lxsmnsyc fb97cf0
fix paths
lxsmnsyc 579a9ca
Fix paths
lxsmnsyc 5ac93e1
move dev overlay
lxsmnsyc 2f6c9dd
Update icons.tsx
lxsmnsyc 99ff9a4
Update terracotta
lxsmnsyc 05762e2
Move server-function-inspector
lxsmnsyc b72d59e
Update tracker.ts
lxsmnsyc a28a9e7
initial rework for the dev toolbar
lxsmnsyc e2e2fcd
Update (no-side-effects).tsx
lxsmnsyc a60ca5f
fix build
lxsmnsyc fb23081
fix styles
lxsmnsyc 91dfda4
fix border colors
lxsmnsyc 0d55980
fix styling
lxsmnsyc 5ead42d
Create chilly-rabbits-lie.md
lxsmnsyc 64a64c4
Merge branch 'main' into feat-server-function-inspector
birkskyum 204e0f7
Merge branch 'main' into feat-server-function-inspector
birkskyum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| --- | ||
| "@solidjs/start": minor | ||
| --- | ||
|
|
||
| add new dev toolbar |
This file contains hidden or 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,23 @@ | ||
| import { createEffect, createSignal } from "solid-js"; | ||
|
|
||
| async function ping(file: File) { | ||
| "use server"; | ||
| return await file.text(); | ||
| } | ||
|
|
||
| export default function App() { | ||
| const [output, setOutput] = createSignal<{ result?: boolean }>({}); | ||
|
|
||
| createEffect(async () => { | ||
| const file = new File(['Hello, World!'], 'hello-world.txt'); | ||
| const result = await ping(file); | ||
| const value = await file.text(); | ||
| setOutput(prev => ({ ...prev, result: value === result })); | ||
| }); | ||
|
|
||
| return ( | ||
| <main> | ||
| <span id="server-fn-test">{JSON.stringify(output())}</span> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or 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,35 @@ | ||
| import { createEffect, createSignal } from "solid-js"; | ||
|
|
||
| async function ping(value: Date) { | ||
| "use server"; | ||
|
|
||
| const current = [ | ||
| value, | ||
| { | ||
| name: 'example', | ||
| *[Symbol.iterator]() { | ||
| yield 'foo'; | ||
| yield 'bar'; | ||
| yield 'baz'; | ||
| } | ||
| } | ||
| ]; | ||
|
|
||
| return current; | ||
| } | ||
|
|
||
| export default function App() { | ||
| const [output, setOutput] = createSignal<{ result?: boolean }>({}); | ||
|
|
||
| createEffect(async () => { | ||
| const value = new Date(); | ||
| const result = await ping(value); | ||
| setOutput((prev) => ({ ...prev, result: value.toString() === result[0].toString() })); | ||
| }); | ||
|
|
||
| return ( | ||
| <main> | ||
| <span id="server-fn-test">{JSON.stringify(output())}</span> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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,38 @@ | ||
| import { createEffect, createSignal } from "solid-js"; | ||
|
|
||
| async function sleep(value: unknown, ms: number) { | ||
| return new Promise((res) => { | ||
| setTimeout(res, ms, value); | ||
| }) | ||
| } | ||
|
|
||
| async function ping(value: URLSearchParams, clone: URLSearchParams) { | ||
| "use server"; | ||
|
|
||
| const current = [ | ||
| value.toString() === clone.toString(), | ||
| value, | ||
| clone, | ||
| ] as const; | ||
|
|
||
| return current; | ||
| } | ||
|
|
||
| export default function App() { | ||
| const [output, setOutput] = createSignal<{ result?: boolean }>({}); | ||
|
|
||
| createEffect(async () => { | ||
| const value = new URLSearchParams([ | ||
| ['foo', 'bar'], | ||
| ['hello', 'world'], | ||
| ]); | ||
| const result = await ping(value, value); | ||
| setOutput((prev) => ({ ...prev, result: result[0] })); | ||
| }); | ||
|
|
||
| return ( | ||
| <main> | ||
| <span id="server-fn-test">{JSON.stringify(output())}</span> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or 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,39 @@ | ||
| import { createEffect, createSignal } from "solid-js"; | ||
|
|
||
| async function sleep<T>(value: T, ms: number) { | ||
| return new Promise<T>((res) => { | ||
| setTimeout(res, ms, value); | ||
| }) | ||
| } | ||
|
|
||
| async function ping(value: ReadableStream<string>) { | ||
| "use server"; | ||
| return value; | ||
| } | ||
|
|
||
| export default function App() { | ||
| const [output, setOutput] = createSignal<{ result?: boolean }>({}); | ||
|
|
||
| createEffect(async () => { | ||
| const result = await ping( | ||
| new ReadableStream({ | ||
| async start(controller) { | ||
| controller.enqueue(await sleep('foo', 100)); | ||
| controller.enqueue(await sleep('bar', 100)); | ||
| controller.enqueue(await sleep('baz', 100)); | ||
| controller.close(); | ||
| }, | ||
| }) | ||
| ); | ||
|
|
||
| const reader = result.getReader(); | ||
| const first = await reader.read(); | ||
| setOutput((prev) => ({ ...prev, result: first.value === 'foo' })); | ||
| }); | ||
|
|
||
| return ( | ||
| <main> | ||
| <span id="server-fn-test">{JSON.stringify(output())}</span> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.