Skip to content

Commit 282e7a3

Browse files
authored
Merge branch 'main' into fix-replaceEqualDeep-array-undefined
2 parents 29f12a3 + 32d1e82 commit 282e7a3

23 files changed

+480
-40
lines changed

docs/framework/angular/guides/disabling-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class TodosComponent {
8585

8686
todosQuery = injectQuery(() => ({
8787
queryKey: ['todos', this.filter()],
88-
queryFn: this.filter ? () => fetchTodos(this.filter()) : skipToken,
88+
queryFn: this.filter() ? () => fetchTodos(this.filter()) : skipToken,
8989
}))
9090
}
9191
```

docs/framework/angular/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: installation
33
title: Installation
44
---
55

6-
> VERY IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Use at your own risk. If you choose to rely on this in production in an experimental stage, please lock your version to a patch-level version to avoid unexpected breakages.
6+
> IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Upgrade carefully. If you use this in production while in experimental stage, please lock your version to a patch-level version to avoid unexpected breaking changes.
77
88
### NPM
99

docs/framework/angular/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: overview
33
title: Overview
44
---
55

6-
> VERY IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Use at your own risk. If you choose to rely on this in production in an experimental stage, please lock your version to a patch-level version to avoid unexpected breakages.
6+
> IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Upgrade carefully. If you use this in production while in experimental stage, please lock your version to a patch-level version to avoid unexpected breaking changes.
77
88
The `@tanstack/angular-query-experimental` package offers a 1st-class API for using TanStack Query via Angular.
99

docs/framework/angular/quick-start.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: quick-start
33
title: Quick Start
44
---
55

6-
> VERY IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Use at your own risk. If you choose to rely on this in production in an experimental stage, please lock your version to a patch-level version to avoid unexpected breakages.
6+
> IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Upgrade carefully. If you use this in production while in experimental stage, please lock your version to a patch-level version to avoid unexpected breaking changes.
77
88
[//]: # 'Example'
99

@@ -23,6 +23,24 @@ bootstrapApplication(AppComponent, {
2323
})
2424
```
2525

26+
or in a NgModule-based app
27+
28+
```ts
29+
import { provideHttpClient } from '@angular/common/http'
30+
import {
31+
provideAngularQuery,
32+
QueryClient,
33+
} from '@tanstack/angular-query-experimental'
34+
35+
@NgModule({
36+
declarations: [AppComponent],
37+
imports: [BrowserModule],
38+
providers: [provideAngularQuery(new QueryClient())],
39+
bootstrap: [AppComponent],
40+
})
41+
export class AppModule {}
42+
```
43+
2644
### Component with query and mutation
2745

2846
```ts

examples/angular/basic/src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { provideHttpClient, withFetch } from '@angular/common/http'
2-
import { ApplicationConfig } from '@angular/core'
32
import {
43
QueryClient,
54
provideAngularQuery,
65
} from '@tanstack/angular-query-experimental'
6+
import type { ApplicationConfig } from '@angular/core'
77

88
export const appConfig: ApplicationConfig = {
99
providers: [

packages/angular-query-devtools-experimental/src/angular-query-devtools.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export class AngularQueryDevtools
3939
/*
4040
* It is intentional that there are no default values on inputs.
4141
* Core devtools will set defaults when values are undefined.
42-
* */
42+
*
43+
* Signal inputs are not used to remain compatible with previous Angular versions.
44+
*/
4345

4446
/**
4547
* Add this attribute if you want the dev tools to default to being open

packages/angular-query-experimental/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
# Angular Query
99

10-
> This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Use at your own risk. If you choose to rely on this in production in an experimental stage, please lock your version to a patch-level version to avoid unexpected breakages.
10+
> IMPORTANT: This library is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Upgrade carefully. If you use this in production while in experimental stage, please lock your version to a patch-level version to avoid unexpected breaking changes.
1111
1212
Functions for fetching, caching and updating asynchronous data in Angular
1313

1414
# Documentation
1515

16-
Visit https://tanstack.com/query/latest/docs/angular/overview
16+
Visit https://tanstack.com/query/latest/docs/framework/angular/overview
1717

1818
## Quick Features
1919

@@ -54,6 +54,23 @@ Visit https://tanstack.com/query/latest/docs/angular/overview
5454
})
5555
```
5656

57+
or in a NgModule-based app
58+
59+
```ts
60+
import { provideHttpClient } from '@angular/common/http'
61+
import {
62+
provideAngularQuery,
63+
QueryClient,
64+
} from '@tanstack/angular-query-experimental'
65+
66+
@NgModule({
67+
declarations: [AppComponent],
68+
imports: [BrowserModule],
69+
providers: [provideAngularQuery(new QueryClient())],
70+
bootstrap: [AppComponent],
71+
})
72+
```
73+
5774
3. Inject query
5875

5976
```ts

packages/angular-query-experimental/src/__tests__/inject-mutation-state.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { QueryClient } from '@tanstack/query-core'
33
import { TestBed } from '@angular/core/testing'
44
import { describe, expect, test, vi } from 'vitest'
55
import { By } from '@angular/platform-browser'
6-
import { JsonPipe } from '@angular/common'
76
import { injectMutation } from '../inject-mutation'
87
import { injectMutationState } from '../inject-mutation-state'
98
import { provideAngularQuery } from '../providers'
@@ -139,7 +138,6 @@ describe('injectMutationState', () => {
139138
}
140139
`,
141140
standalone: true,
142-
imports: [JsonPipe],
143141
})
144142
class FakeComponent {
145143
name = input.required<string>()

packages/angular-query-experimental/src/create-base-query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function createBaseQuery<
3131
TQueryData,
3232
TQueryKey extends QueryKey,
3333
>(
34-
options: (
34+
optionsFn: (
3535
client: QueryClient,
3636
) => CreateBaseQueryOptions<
3737
TQueryFnData,
@@ -57,7 +57,7 @@ export function createBaseQuery<
5757
*/
5858
const defaultedOptionsSignal = computed(() => {
5959
const defaultedOptions = queryClient.defaultQueryOptions(
60-
options(queryClient),
60+
optionsFn(queryClient),
6161
)
6262
defaultedOptions._optimisticResults = 'optimistic'
6363
return defaultedOptions

packages/angular-query-experimental/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,5 @@ export * from './inject-mutation'
2020
export * from './inject-mutation-state'
2121
export * from './inject-queries'
2222
export * from './inject-query'
23-
export {
24-
injectQueryClient,
25-
provideQueryClient,
26-
QUERY_CLIENT,
27-
} from './inject-query-client'
23+
export { injectQueryClient, provideQueryClient } from './inject-query-client'
2824
export { provideAngularQuery } from './providers'

0 commit comments

Comments
 (0)