@tanstack/vue-start 1.166.18 → 1.167.1

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.
@@ -9,7 +9,7 @@ function useServerFn(serverFn) {
9
9
  return res;
10
10
  } catch (err) {
11
11
  if (isRedirect(err)) {
12
- err.options._fromLocation = router.state.location;
12
+ err.options._fromLocation = router.stores.location.state;
13
13
  return router.navigate(router.resolveRedirect(err).options);
14
14
  }
15
15
  throw err;
@@ -1 +1 @@
1
- {"version":3,"file":"useServerFn.js","names":[],"sources":["../../src/useServerFn.ts"],"sourcesContent":["import { isRedirect, useRouter } from '@tanstack/vue-router'\n\nexport function useServerFn<T extends (...deps: Array<any>) => Promise<any>>(\n serverFn: T,\n): (...args: Parameters<T>) => ReturnType<T> {\n const router = useRouter()\n\n return (async (...args: Array<any>) => {\n try {\n const res = await serverFn(...args)\n\n if (isRedirect(res)) {\n throw res\n }\n\n return res\n } catch (err) {\n if (isRedirect(err)) {\n err.options._fromLocation = router.state.location\n return router.navigate(router.resolveRedirect(err).options)\n }\n\n throw err\n }\n }) as any\n}\n"],"mappings":";;AAEA,SAAgB,YACd,UAC2C;CAC3C,MAAM,SAAS,WAAW;AAE1B,SAAQ,OAAO,GAAG,SAAqB;AACrC,MAAI;GACF,MAAM,MAAM,MAAM,SAAS,GAAG,KAAK;AAEnC,OAAI,WAAW,IAAI,CACjB,OAAM;AAGR,UAAO;WACA,KAAK;AACZ,OAAI,WAAW,IAAI,EAAE;AACnB,QAAI,QAAQ,gBAAgB,OAAO,MAAM;AACzC,WAAO,OAAO,SAAS,OAAO,gBAAgB,IAAI,CAAC,QAAQ;;AAG7D,SAAM"}
1
+ {"version":3,"file":"useServerFn.js","names":[],"sources":["../../src/useServerFn.ts"],"sourcesContent":["import { isRedirect, useRouter } from '@tanstack/vue-router'\n\nexport function useServerFn<T extends (...deps: Array<any>) => Promise<any>>(\n serverFn: T,\n): (...args: Parameters<T>) => ReturnType<T> {\n const router = useRouter()\n\n return (async (...args: Array<any>) => {\n try {\n const res = await serverFn(...args)\n\n if (isRedirect(res)) {\n throw res\n }\n\n return res\n } catch (err) {\n if (isRedirect(err)) {\n err.options._fromLocation = router.stores.location.state\n return router.navigate(router.resolveRedirect(err).options)\n }\n\n throw err\n }\n }) as any\n}\n"],"mappings":";;AAEA,SAAgB,YACd,UAC2C;CAC3C,MAAM,SAAS,WAAW;AAE1B,SAAQ,OAAO,GAAG,SAAqB;AACrC,MAAI;GACF,MAAM,MAAM,MAAM,SAAS,GAAG,KAAK;AAEnC,OAAI,WAAW,IAAI,CACjB,OAAM;AAGR,UAAO;WACA,KAAK;AACZ,OAAI,WAAW,IAAI,EAAE;AACnB,QAAI,QAAQ,gBAAgB,OAAO,OAAO,SAAS;AACnD,WAAO,OAAO,SAAS,OAAO,gBAAgB,IAAI,CAAC,QAAQ;;AAG7D,SAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/vue-start",
3
- "version": "1.166.18",
3
+ "version": "1.167.1",
4
4
  "description": "Modern and scalable routing for Vue applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -101,12 +101,12 @@
101
101
  },
102
102
  "dependencies": {
103
103
  "pathe": "^2.0.3",
104
- "@tanstack/vue-start-client": "1.166.13",
105
- "@tanstack/vue-start-server": "1.166.13",
106
- "@tanstack/start-plugin-core": "1.167.2",
107
- "@tanstack/vue-router": "1.167.5",
108
- "@tanstack/start-client-core": "1.166.13",
109
- "@tanstack/start-server-core": "1.166.13"
104
+ "@tanstack/vue-start-client": "1.166.15",
105
+ "@tanstack/start-plugin-core": "1.167.4",
106
+ "@tanstack/vue-start-server": "1.166.15",
107
+ "@tanstack/vue-router": "1.168.1",
108
+ "@tanstack/start-client-core": "1.167.1",
109
+ "@tanstack/start-server-core": "1.167.1"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@tanstack/intent": "^0.0.14",
@@ -16,7 +16,7 @@ export function useServerFn<T extends (...deps: Array<any>) => Promise<any>>(
16
16
  return res
17
17
  } catch (err) {
18
18
  if (isRedirect(err)) {
19
- err.options._fromLocation = router.state.location
19
+ err.options._fromLocation = router.stores.location.state
20
20
  return router.navigate(router.resolveRedirect(err).options)
21
21
  }
22
22