@tanstack/react-form 1.2.1 → 1.2.2
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.
|
@@ -10,7 +10,7 @@ const initialFormState = {
|
|
|
10
10
|
};
|
|
11
11
|
const getFormData = async () => {
|
|
12
12
|
const data = await utils._tanstackInternalsCookie.parse(server.getHeader("Cookie"));
|
|
13
|
-
server.
|
|
13
|
+
server.deleteCookie(utils._tanstackInternalsCookie.name);
|
|
14
14
|
if (!data) return initialFormState;
|
|
15
15
|
return data;
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormData.cjs","sources":["../../../src/start/getFormData.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getFormData.cjs","sources":["../../../src/start/getFormData.tsx"],"sourcesContent":["import { deleteCookie, getHeader } from '@tanstack/react-start/server'\nimport { _tanstackInternalsCookie } from './utils'\nimport type { ServerFormState } from './types'\n\nexport const initialFormState = {\n errorMap: {\n onServer: undefined,\n },\n errors: [],\n}\n\nexport const getFormData = async () => {\n const data = (await _tanstackInternalsCookie.parse(getHeader('Cookie')!)) as\n | undefined\n | ServerFormState<any, undefined>\n // Delete the temporary cookie from the client after reading it\n deleteCookie(_tanstackInternalsCookie.name)\n if (!data) return initialFormState\n return data\n}\n"],"names":["_tanstackInternalsCookie","getHeader","deleteCookie"],"mappings":";;;;AAIO,MAAM,mBAAmB;AAAA,EAC9B,UAAU;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ,CAAA;AACV;AAEO,MAAM,cAAc,YAAY;AACrC,QAAM,OAAQ,MAAMA,MAAA,yBAAyB,MAAMC,OAAA,UAAU,QAAQ,CAAE;AAIvEC,SAAA,aAAaF,+BAAyB,IAAI;AACtC,MAAA,CAAC,KAAa,QAAA;AACX,SAAA;AACT;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHeader,
|
|
1
|
+
import { getHeader, deleteCookie } from "@tanstack/react-start/server";
|
|
2
2
|
import { _tanstackInternalsCookie } from "./utils.js";
|
|
3
3
|
const initialFormState = {
|
|
4
4
|
errorMap: {
|
|
@@ -8,7 +8,7 @@ const initialFormState = {
|
|
|
8
8
|
};
|
|
9
9
|
const getFormData = async () => {
|
|
10
10
|
const data = await _tanstackInternalsCookie.parse(getHeader("Cookie"));
|
|
11
|
-
|
|
11
|
+
deleteCookie(_tanstackInternalsCookie.name);
|
|
12
12
|
if (!data) return initialFormState;
|
|
13
13
|
return data;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormData.js","sources":["../../../src/start/getFormData.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getFormData.js","sources":["../../../src/start/getFormData.tsx"],"sourcesContent":["import { deleteCookie, getHeader } from '@tanstack/react-start/server'\nimport { _tanstackInternalsCookie } from './utils'\nimport type { ServerFormState } from './types'\n\nexport const initialFormState = {\n errorMap: {\n onServer: undefined,\n },\n errors: [],\n}\n\nexport const getFormData = async () => {\n const data = (await _tanstackInternalsCookie.parse(getHeader('Cookie')!)) as\n | undefined\n | ServerFormState<any, undefined>\n // Delete the temporary cookie from the client after reading it\n deleteCookie(_tanstackInternalsCookie.name)\n if (!data) return initialFormState\n return data\n}\n"],"names":[],"mappings":";;AAIO,MAAM,mBAAmB;AAAA,EAC9B,UAAU;AAAA,IACR,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ,CAAA;AACV;AAEO,MAAM,cAAc,YAAY;AACrC,QAAM,OAAQ,MAAM,yBAAyB,MAAM,UAAU,QAAQ,CAAE;AAIvE,eAAa,yBAAyB,IAAI;AACtC,MAAA,CAAC,KAAa,QAAA;AACX,SAAA;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-form",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Powerful, type-safe forms for React.",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,21 +67,21 @@
|
|
|
67
67
|
"src"
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@remix-run/node": "^2.
|
|
70
|
+
"@remix-run/node": "^2.16.2",
|
|
71
71
|
"@tanstack/react-store": "^0.7.0",
|
|
72
|
-
"decode-formdata": "^0.
|
|
73
|
-
"@tanstack/form-core": "1.
|
|
72
|
+
"decode-formdata": "^0.9.0",
|
|
73
|
+
"@tanstack/form-core": "1.2.2"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@tanstack/react-start": "^1.
|
|
76
|
+
"@tanstack/react-start": "^1.114.29",
|
|
77
77
|
"@types/react": "^19.0.7",
|
|
78
78
|
"@types/react-dom": "^19.0.3",
|
|
79
79
|
"@vitejs/plugin-react": "^4.3.4",
|
|
80
80
|
"eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
|
|
81
81
|
"react": "^19.0.0",
|
|
82
82
|
"react-dom": "^19.0.0",
|
|
83
|
-
"vinxi": "^0.5.
|
|
84
|
-
"vite": "^6.
|
|
83
|
+
"vinxi": "^0.5.3",
|
|
84
|
+
"vite": "^6.2.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@tanstack/react-start": "^1.112.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { deleteCookie, getHeader } from '@tanstack/react-start/server'
|
|
2
2
|
import { _tanstackInternalsCookie } from './utils'
|
|
3
3
|
import type { ServerFormState } from './types'
|
|
4
4
|
|
|
@@ -13,8 +13,8 @@ export const getFormData = async () => {
|
|
|
13
13
|
const data = (await _tanstackInternalsCookie.parse(getHeader('Cookie')!)) as
|
|
14
14
|
| undefined
|
|
15
15
|
| ServerFormState<any, undefined>
|
|
16
|
-
// Delete the cookie
|
|
17
|
-
|
|
16
|
+
// Delete the temporary cookie from the client after reading it
|
|
17
|
+
deleteCookie(_tanstackInternalsCookie.name)
|
|
18
18
|
if (!data) return initialFormState
|
|
19
19
|
return data
|
|
20
20
|
}
|