@tanstack/start-client-core 1.132.43 → 1.132.45
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/start-client-core",
|
|
3
|
-
"version": "1.132.
|
|
3
|
+
"version": "1.132.45",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"seroval": "^1.3.2",
|
|
67
67
|
"tiny-invariant": "^1.3.3",
|
|
68
68
|
"tiny-warning": "^1.0.3",
|
|
69
|
-
"@tanstack/router-core": "1.132.
|
|
70
|
-
"@tanstack/start-storage-context": "1.132.
|
|
69
|
+
"@tanstack/router-core": "1.132.45",
|
|
70
|
+
"@tanstack/start-storage-context": "1.132.45"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {}
|
|
73
73
|
}
|
|
@@ -2,7 +2,12 @@ import { describe, expectTypeOf, test } from 'vitest'
|
|
|
2
2
|
import { createMiddleware } from '../createMiddleware'
|
|
3
3
|
import { createServerFn } from '../createServerFn'
|
|
4
4
|
import { TSS_SERVER_FUNCTION } from '../constants'
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
Constrain,
|
|
7
|
+
Register,
|
|
8
|
+
TsrSerializable,
|
|
9
|
+
Validator,
|
|
10
|
+
} from '@tanstack/router-core'
|
|
6
11
|
import type { ConstrainValidator } from '../createServerFn'
|
|
7
12
|
|
|
8
13
|
test('createServerFn method with autocomplete', () => {
|
|
@@ -638,3 +643,15 @@ test('createServerFn returns sync array', () => {
|
|
|
638
643
|
|
|
639
644
|
expectTypeOf(serverFn()).toEqualTypeOf<Promise<Array<{ a: number }>>>()
|
|
640
645
|
})
|
|
646
|
+
|
|
647
|
+
test('createServerFn respects TsrSerializable', () => {
|
|
648
|
+
type MyCustomType = { f: () => void; value: string }
|
|
649
|
+
type MyCustomTypeSerializable = MyCustomType & TsrSerializable
|
|
650
|
+
const fn1 = createServerFn().handler(() => {
|
|
651
|
+
const custom: MyCustomType = { f: () => {}, value: 'test' }
|
|
652
|
+
return { nested: { custom: custom as MyCustomTypeSerializable } }
|
|
653
|
+
})
|
|
654
|
+
expectTypeOf(fn1()).toEqualTypeOf<
|
|
655
|
+
Promise<{ nested: { custom: MyCustomTypeSerializable } }>
|
|
656
|
+
>()
|
|
657
|
+
})
|