From 261f3bdb77799009344aab4a60686b7186ebd3b0 Mon Sep 17 00:00:00 2001 From: "netop://ウィビ" Date: Fri, 24 Apr 2026 14:17:38 -0700 Subject: Implement v0.4 subscriptions + v0.5 theming and plugin slots - SSE and WebSocket fetchers via graphql-sse and graphql-ws, returning AsyncIterable results - SessionStore.run consumes AsyncIterable streams with subscriptionMode "append" (timestamped) or "replace" and honors an AbortSignal for cancellation - Chrome CSS variables documented in styles/theme.scss with prefers-color-scheme light/dark gating and .graphiql-light override - Svelte 5 snippet slots on GraphiQL: toolbarExtras, tabExtras, resultFooter --- deno.json | 4 +- deno.lock | 16 +++++ source/library/GraphiQL.svelte | 30 ++++++-- source/library/components/ResultViewer.svelte | 16 ++++- source/library/components/TabBar.svelte | 6 +- source/library/components/Toolbar.svelte | 4 ++ source/library/fetcher/sse.ts | 100 +++++++++++++++++++++++--- source/library/fetcher/websocket.ts | 97 ++++++++++++++++++++++--- source/library/index.ts | 9 ++- source/library/state/session.svelte.ts | 53 +++++++++++++- source/library/styles/theme.scss | 47 ++++++++++++ 11 files changed, 353 insertions(+), 29 deletions(-) create mode 100644 source/library/styles/theme.scss diff --git a/deno.json b/deno.json index 61efce7..b4d79a1 100644 --- a/deno.json +++ b/deno.json @@ -15,7 +15,9 @@ "@lezer/highlight": "npm:@lezer/highlight@^1.2.0", "cm6-graphql": "npm:cm6-graphql@^0.2.1", "codemirror": "npm:codemirror@^6.0.1", - "graphql": "npm:graphql@^16.8.0" + "graphql": "npm:graphql@^16.8.0", + "graphql-sse": "npm:graphql-sse@^2.5.3", + "graphql-ws": "npm:graphql-ws@^5.16.0" }, "name": "@eol/graphiql", "publish": { diff --git a/deno.lock b/deno.lock index 8774cf1..0081354 100644 --- a/deno.lock +++ b/deno.lock @@ -13,6 +13,8 @@ "npm:@lezer/highlight@^1.2.0": "1.2.3", "npm:cm6-graphql@~0.2.1": "0.2.1_@codemirror+autocomplete@6.20.1_@codemirror+language@6.12.3_@codemirror+lint@6.9.5_@codemirror+state@6.6.0_@codemirror+view@6.41.1_@lezer+highlight@1.2.3_graphql@16.13.2", "npm:codemirror@^6.0.1": "6.0.2", + "npm:graphql-sse@^2.5.3": "2.6.0_graphql@16.13.2", + "npm:graphql-ws@^5.16.0": "5.16.2_graphql@16.13.2", "npm:graphql@^16.8.0": "16.13.2" }, "jsr": { @@ -170,6 +172,18 @@ ], "bin": true }, + "graphql-sse@2.6.0_graphql@16.13.2": { + "integrity": "sha512-BXT5Rjv9UFunjQsmN9WWEIq+TFNhgYibgwo1xkXLxzguQVyOd6paJ4v5DlL9K5QplS0w74bhF+aUiqaGXZBaug==", + "dependencies": [ + "graphql" + ] + }, + "graphql-ws@5.16.2_graphql@16.13.2": { + "integrity": "sha512-E1uccsZxt/96jH/OwmLPuXMACILs76pKF2i3W861LpKBCYtGIyPQGtWLuBLkND4ox1KHns70e83PS4te50nvPQ==", + "dependencies": [ + "graphql" + ] + }, "graphql@16.13.2": { "integrity": "sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==" }, @@ -198,6 +212,8 @@ "npm:@lezer/highlight@^1.2.0", "npm:cm6-graphql@~0.2.1", "npm:codemirror@^6.0.1", + "npm:graphql-sse@^2.5.3", + "npm:graphql-ws@^5.16.0", "npm:graphql@^16.8.0" ] } diff --git a/source/library/GraphiQL.svelte b/source/library/GraphiQL.svelte index 0a8f01a..329dd6f 100644 --- a/source/library/GraphiQL.svelte +++ b/source/library/GraphiQL.svelte @@ -1,7 +1,7 @@ @@ -15,7 +17,7 @@
Response
+ {#if footer} + + {/if}
diff --git a/source/library/components/TabBar.svelte b/source/library/components/TabBar.svelte index d87449d..9c34f20 100644 --- a/source/library/components/TabBar.svelte +++ b/source/library/components/TabBar.svelte @@ -1,9 +1,10 @@