Skip to content

Commit

Permalink
Merge branch 'main' into feature/suspense-gc-time
Browse files Browse the repository at this point in the history
  • Loading branch information
TkDodo authored Aug 7, 2024
2 parents 742c1ee + 1fc6124 commit 169a48d
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/framework/react/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function useQueryFocusAware(notifyOnChangeProps?: NotifyOnChangeProps) {
}, []),
)

return () => focusRef.current
return () => focusedRef.current

useQuery({
queryKey: ['key'],
Expand Down
4 changes: 2 additions & 2 deletions examples/angular/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^17.3.12",
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@tanstack/angular-query-experimental": "^5.51.21",
"@tanstack/angular-query-experimental": "^5.51.22",
"rxjs": "^7.8.1",
"tslib": "^2.6.3",
"zone.js": "^0.14.8"
Expand All @@ -23,7 +23,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@tanstack/angular-query-devtools-experimental": "^5.51.21",
"@tanstack/angular-query-devtools-experimental": "^5.51.22",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/angular/infinite-query-with-max-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/core": "^17.3.12",
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@tanstack/angular-query-experimental": "^5.51.21",
"@tanstack/angular-query-experimental": "^5.51.22",
"rxjs": "^7.8.1",
"tslib": "^2.6.3",
"zone.js": "^0.14.8"
Expand All @@ -23,7 +23,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@tanstack/angular-query-devtools-experimental": "^5.51.21",
"@tanstack/angular-query-devtools-experimental": "^5.51.22",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/angular/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@angular/router": "^17.3.12",
"@tanstack/angular-query-experimental": "^5.51.21",
"@tanstack/angular-query-experimental": "^5.51.22",
"rxjs": "^7.8.1",
"tslib": "^2.6.3",
"zone.js": "^0.14.8"
Expand All @@ -24,7 +24,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@tanstack/angular-query-devtools-experimental": "^5.51.21",
"@tanstack/angular-query-devtools-experimental": "^5.51.22",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/angular/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@angular/router": "^17.3.12",
"@tanstack/angular-query-experimental": "^5.51.21",
"@tanstack/angular-query-experimental": "^5.51.22",
"rxjs": "^7.8.1",
"tslib": "^2.6.3",
"zone.js": "^0.14.8"
Expand All @@ -24,7 +24,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@tanstack/angular-query-devtools-experimental": "^5.51.21",
"@tanstack/angular-query-devtools-experimental": "^5.51.22",
"typescript": "5.3.3"
}
}
2 changes: 1 addition & 1 deletion packages/angular-query-devtools-experimental/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/angular-query-devtools-experimental",
"version": "5.51.21",
"version": "5.51.22",
"description": "Developer tools to interact with and visualize the TanStack/angular-query cache",
"author": "Arnoud de Vries",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { EnvironmentProviders } from '@angular/core';
import type { InfiniteData } from '@tanstack/query-core';
import type { InfiniteQueryObserverOptions } from '@tanstack/query-core';
import type { InfiniteQueryObserverResult } from '@tanstack/query-core';
import type { InitialDataFunction } from '@tanstack/query-core';
import { InjectOptions } from '@angular/core';
import { Injector } from '@angular/core';
import type { MutateFunction } from '@tanstack/query-core';
Expand Down Expand Up @@ -120,20 +121,20 @@ export type DefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultEr
};

// @public
export function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
export function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
};

// @public
export function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
export function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & {
queryKey: DataTag<TQueryKey, InfiniteData<TQueryFnData>>;
};

// @public
export function injectInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(optionsFn: (client: QueryClient) => UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, injector?: Injector): CreateInfiniteQueryResult<TData, TError>;
export function injectInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(optionsFn: (client: QueryClient) => DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, injector?: Injector): DefinedCreateInfiniteQueryResult<TData, TError>;

// @public
export function injectInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(optionsFn: (client: QueryClient) => DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, injector?: Injector): DefinedCreateInfiniteQueryResult<TData, TError>;
export function injectInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(optionsFn: (client: QueryClient) => UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, injector?: Injector): CreateInfiniteQueryResult<TData, TError>;

// @public
export function injectInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(optionsFn: (client: QueryClient) => CreateInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey, TPageParam>, injector?: Injector): CreateInfiniteQueryResult<TData, TError>;
Expand Down Expand Up @@ -224,12 +225,12 @@ GetResults<Head>
]> : T extends Array<QueryObserverOptionsForCreateQueries<infer TQueryFnData, infer TError, infer TData, any>> ? Array<QueryObserverResult<unknown extends TData ? TQueryFnData : TData, unknown extends TError ? DefaultError : TError>> : Array<QueryObserverResult>;

// @public
export function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
export function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
queryKey: DataTag<TQueryKey, TQueryFnData>;
};

// @public
export function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
export function queryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
queryKey: DataTag<TQueryKey, TQueryFnData>;
};

Expand All @@ -240,7 +241,7 @@ export type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = DefaultEr

// @public (undocumented)
export type UndefinedInitialDataOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
initialData?: undefined;
initialData?: undefined | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>;
};


Expand Down
2 changes: 1 addition & 1 deletion packages/angular-query-experimental/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/angular-query-experimental",
"version": "5.51.21",
"version": "5.51.22",
"description": "Signals for managing, caching and syncing asynchronous and remote data in Angular",
"author": "Arnoud de Vries",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export function infiniteQueryOptions<
TQueryKey extends QueryKey = QueryKey,
TPageParam = unknown,
>(
options: UndefinedInitialDataInfiniteOptions<
options: DefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
TQueryKey,
TPageParam
>,
): UndefinedInitialDataInfiniteOptions<
): DefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
Expand All @@ -95,14 +95,14 @@ export function infiniteQueryOptions<
TQueryKey extends QueryKey = QueryKey,
TPageParam = unknown,
>(
options: DefinedInitialDataInfiniteOptions<
options: UndefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
TQueryKey,
TPageParam
>,
): DefinedInitialDataInfiniteOptions<
): UndefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export function injectInfiniteQuery<
>(
optionsFn: (
client: QueryClient,
) => UndefinedInitialDataInfiniteOptions<
) => DefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
TQueryKey,
TPageParam
>,
injector?: Injector,
): CreateInfiniteQueryResult<TData, TError>
): DefinedCreateInfiniteQueryResult<TData, TError>

/**
* Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
Expand All @@ -63,15 +63,15 @@ export function injectInfiniteQuery<
>(
optionsFn: (
client: QueryClient,
) => DefinedInitialDataInfiniteOptions<
) => UndefinedInitialDataInfiniteOptions<
TQueryFnData,
TError,
TData,
TQueryKey,
TPageParam
>,
injector?: Injector,
): DefinedCreateInfiniteQueryResult<TData, TError>
): CreateInfiniteQueryResult<TData, TError>

/**
* Injects an infinite query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
Expand Down
8 changes: 4 additions & 4 deletions packages/angular-query-experimental/src/query-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export function queryOptions<
TData = TQueryFnData,
TQueryKey extends QueryKey = QueryKey,
>(
options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,
): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,
): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
queryKey: DataTag<TQueryKey, TQueryFnData>
}

Expand Down Expand Up @@ -93,8 +93,8 @@ export function queryOptions<
TData = TQueryFnData,
TQueryKey extends QueryKey = QueryKey,
>(
options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,
): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,
): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> & {
queryKey: DataTag<TQueryKey, TQueryFnData>
}

Expand Down
6 changes: 6 additions & 0 deletions packages/angular-query-experimental/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"target": "ES2022",
"types": ["vitest/globals"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"include": ["src", "eslint.config.js", "vite.config.ts"]
}
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 169a48d

Please sign in to comment.