Sign In

@tanstack/solid-start-client

Package Overview
Dependencies
Maintainers
3
Versions
485
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/solid-start-client - npm Package Compare versions

Comparing version
1.168.16
to
1.168.17-pre.0
+1
dist/esm/tests/hydrateStart.test.d.ts
export {};
import { afterEach, expect, test, vi } from 'vitest'
import { hydrateStart } from '../hydrateStart'
const coreHydrateStart = vi.hoisted(() => vi.fn())
vi.mock('@tanstack/start-client-core/client', () => ({
hydrateStart: coreHydrateStart,
}))
afterEach(() => {
delete window.$_TSR
coreHydrateStart.mockReset()
})
test('signals streaming cleanup after hydration succeeds', async () => {
const router = {}
coreHydrateStart.mockResolvedValue(router)
const hydrated = vi.fn()
window.$_TSR = { h: hydrated } as any
await expect(hydrateStart()).resolves.toBe(router)
expect(hydrated).toHaveBeenCalledTimes(1)
})
test('signals streaming cleanup without hiding a hydration failure', async () => {
const error = new Error('hydration failed')
coreHydrateStart.mockRejectedValue(error)
const hydrated = vi.fn()
window.$_TSR = { h: hydrated } as any
await expect(hydrateStart()).rejects.toBe(error)
expect(hydrated).toHaveBeenCalledTimes(1)
})
+2
-4

@@ -6,6 +6,4 @@ import { hydrateStart } from "@tanstack/start-client-core/client";

*/
async function hydrateStart$1() {
const router = await hydrateStart();
window.$_TSR?.h();
return router;
function hydrateStart$1() {
return hydrateStart().finally(() => window.$_TSR?.h());
}

@@ -12,0 +10,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"hydrateStart.js","names":[],"sources":["../../src/hydrateStart.ts"],"sourcesContent":["import { hydrateStart as coreHydrateStart } from '@tanstack/start-client-core/client'\nimport type { AnyRouter } from '@tanstack/router-core'\n\n/**\n * Solid-specific wrapper for hydrateStart that signals hydration completion\n */\nexport async function hydrateStart(): Promise<AnyRouter> {\n const router = await coreHydrateStart()\n // Signal that router hydration is complete so cleanup can happen if stream has ended\n window.$_TSR?.h()\n return router\n}\n"],"mappings":";;;;;AAMA,eAAsB,iBAAmC;CACvD,MAAM,SAAS,MAAM,aAAiB;CAEtC,OAAO,OAAO,EAAE;CAChB,OAAO;AACT"}
{"version":3,"file":"hydrateStart.js","names":[],"sources":["../../src/hydrateStart.ts"],"sourcesContent":["import { hydrateStart as coreHydrateStart } from '@tanstack/start-client-core/client'\nimport type { AnyRouter } from '@tanstack/router-core'\n\n/**\n * Solid-specific wrapper for hydrateStart that signals hydration completion\n */\nexport function hydrateStart(): Promise<AnyRouter> {\n return coreHydrateStart().finally(() => window.$_TSR?.h())\n}\n"],"mappings":";;;;;AAMA,SAAgB,iBAAmC;CACjD,OAAO,aAAiB,EAAE,cAAc,OAAO,OAAO,EAAE,CAAC;AAC3D"}
{
"name": "@tanstack/solid-start-client",
"version": "1.168.16",
"version": "1.168.17-pre.0",
"description": "Modern and scalable routing for Solid applications",

@@ -58,5 +58,5 @@ "author": "Tanner Linsley",

"dependencies": {
"@tanstack/router-core": "1.171.15",
"@tanstack/solid-router": "1.170.18",
"@tanstack/start-client-core": "1.170.14"
"@tanstack/router-core": "1.171.16-pre.0",
"@tanstack/solid-router": "1.170.19-pre.0",
"@tanstack/start-client-core": "1.170.15-pre.0"
},

@@ -78,3 +78,2 @@ "devDependencies": {

"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",

@@ -84,3 +83,4 @@ "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",

"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",

@@ -87,0 +87,0 @@ "build": "vite build"

@@ -7,7 +7,4 @@ import { hydrateStart as coreHydrateStart } from '@tanstack/start-client-core/client'

*/
export async function hydrateStart(): Promise<AnyRouter> {
const router = await coreHydrateStart()
// Signal that router hydration is complete so cleanup can happen if stream has ended
window.$_TSR?.h()
return router
export function hydrateStart(): Promise<AnyRouter> {
return coreHydrateStart().finally(() => window.$_TSR?.h())
}