@octanejs/tanstack-query 0.1.43 → 0.1.44

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": "@octanejs/tanstack-query",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -40,7 +40,7 @@
40
40
  "@tanstack/query-core": "^5.101.3"
41
41
  },
42
42
  "peerDependencies": {
43
- "octane": "0.1.44"
43
+ "octane": "0.1.45"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@tanstack/react-query": "^5.101.3",
@@ -49,7 +49,7 @@
49
49
  "react": "^19.2.7",
50
50
  "react-dom": "^19.2.7",
51
51
  "vitest": "^4.1.10",
52
- "octane": "0.1.44"
52
+ "octane": "0.1.45"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "vitest run"
package/src/types.ts CHANGED
@@ -128,7 +128,8 @@ export type UseQueryResult<TData = unknown, TError = DefaultError> = UseBaseQuer
128
128
 
129
129
  export type UseSuspenseQueryResult<TData = unknown, TError = DefaultError> = DistributiveOmit<
130
130
  DefinedQueryObserverResult<TData, TError>,
131
- 'isPlaceholderData' | 'promise'
131
+ // Query core 5.102 removed the experimental promise result field.
132
+ Extract<'isPlaceholderData' | 'promise', keyof DefinedQueryObserverResult<TData, TError>>
132
133
  >;
133
134
 
134
135
  export type DefinedUseQueryResult<
@@ -148,7 +149,7 @@ export type DefinedUseInfiniteQueryResult<
148
149
 
149
150
  export type UseSuspenseInfiniteQueryResult<TData = unknown, TError = DefaultError> = OmitKeyof<
150
151
  DefinedInfiniteQueryObserverResult<TData, TError>,
151
- 'isPlaceholderData' | 'promise'
152
+ Extract<'isPlaceholderData' | 'promise', keyof DefinedInfiniteQueryObserverResult<TData, TError>>
152
153
  >;
153
154
 
154
155
  export type AnyUseMutationOptions = UseMutationOptions<any, any, any, any>;
@@ -133,10 +133,11 @@ export function useBaseQuery(
133
133
 
134
134
  (client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(defaultedOptions, result);
135
135
 
136
- // experimental_prefetchInRender: kick the fetch during render so
137
- // `result.promise` settles even if the component unmounts, and finalize the
138
- // observer's thenable (via updateResult) when the data lands.
136
+ // Query core before 5.102 supports experimental_prefetchInRender. Start the
137
+ // fetch during render so `result.promise` settles even if the component
138
+ // unmounts, then finalize the observer's thenable when the data lands.
139
139
  if (
140
+ 'experimental_prefetchInRender' in defaultedOptions &&
140
141
  defaultedOptions.experimental_prefetchInRender &&
141
142
  !environmentManager.isServer() &&
142
143
  willFetch(result, isRestoring)