@octanejs/tanstack-router-ssr-query 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dominic Gannaway
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @octanejs/tanstack-router-ssr-query
2
+
3
+ Octane port of `@tanstack/react-router-ssr-query` — wires TanStack Query
4
+ dehydration/hydration into TanStack Router SSR streaming and wraps the app
5
+ in a `QueryClientProvider`. Delegates to the framework-agnostic
6
+ `@tanstack/router-ssr-query-core`.
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@octanejs/tanstack-router-ssr-query",
3
+ "version": "0.0.5",
4
+ "description": "Octane port of @tanstack/react-router-ssr-query — TanStack Router ⇄ Query SSR integration.",
5
+ "type": "module",
6
+ "main": "src/index.tsrx",
7
+ "types": "src/index.tsrx.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./src/index.tsrx.d.ts",
11
+ "default": "./src/index.tsrx"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "@tanstack/router-ssr-query-core": "1.169.1"
16
+ },
17
+ "peerDependencies": {
18
+ "@octanejs/tanstack-query": "0.1.15",
19
+ "@octanejs/tanstack-router": "0.1.15",
20
+ "octane": "0.1.16"
21
+ },
22
+ "devDependencies": {
23
+ "vitest": "^4.1.10",
24
+ "octane": "0.1.16",
25
+ "@octanejs/tanstack-query": "0.1.15",
26
+ "@octanejs/tanstack-router": "0.1.15"
27
+ },
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/octanejs/octane.git",
37
+ "directory": "packages/tanstack-router-ssr-query"
38
+ },
39
+ "license": "MIT",
40
+ "files": [
41
+ "src",
42
+ "README.md"
43
+ ],
44
+ "author": {
45
+ "name": "Dominic Gannaway",
46
+ "email": "dg@domgan.com"
47
+ },
48
+ "scripts": {
49
+ "test": "vitest run --project tanstack-router-ssr-query",
50
+ "typecheck": "tsrx-tsc --noEmit"
51
+ }
52
+ }
package/src/index.tsrx ADDED
@@ -0,0 +1,30 @@
1
+ // Octane port of @tanstack/react-router-ssr-query@1.167.1 (src/index.tsx,
2
+ // 29 lines): delegates to the framework-agnostic
3
+ // @tanstack/router-ssr-query-core and wraps the router's Wrap option in a
4
+ // QueryClientProvider. Fragment comes from octane; everything else is
5
+ // verbatim upstream.
6
+ import { Fragment } from 'octane';
7
+ import { QueryClientProvider } from '@octanejs/tanstack-query';
8
+ import { setupCoreRouterSsrQueryIntegration } from '@tanstack/router-ssr-query-core';
9
+ import type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core';
10
+ import type { AnyRouter } from '@octanejs/tanstack-router';
11
+
12
+ export type Options<TRouter extends AnyRouter> =
13
+ RouterSsrQueryOptions<TRouter> & {
14
+ wrapQueryClient?: boolean;
15
+ };
16
+
17
+ export function setupRouterSsrQueryIntegration<TRouter extends AnyRouter>(opts: Options<TRouter>) {
18
+ setupCoreRouterSsrQueryIntegration(opts as any);
19
+
20
+ if (opts.wrapQueryClient === false) {
21
+ return;
22
+ }
23
+ const OGWrap = opts.router.options.Wrap || Fragment;
24
+
25
+ opts.router.options.Wrap = ({ children }: { children?: unknown }) => {
26
+ return <QueryClientProvider client={opts.queryClient}>
27
+ <OGWrap>{children}</OGWrap>
28
+ </QueryClientProvider>;
29
+ };
30
+ }
@@ -0,0 +1,10 @@
1
+ import type { AnyRouter } from '@octanejs/tanstack-router';
2
+ import type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core';
3
+
4
+ export type Options<TRouter extends AnyRouter> = RouterSsrQueryOptions<TRouter> & {
5
+ wrapQueryClient?: boolean;
6
+ };
7
+
8
+ export declare function setupRouterSsrQueryIntegration<TRouter extends AnyRouter>(
9
+ options: Options<TRouter>,
10
+ ): void;