-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Feature/angular query #6195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/angular query #6195
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2af306d:
|
examples/angular/default-query-function/src/default-query-function-example.component.ts
Outdated
Show resolved
Hide resolved
| postIdSignal = signal<number>(0) | ||
| postQuery = injectQuery(() => ({ | ||
| enabled: this.postIdSignal() > 0, | ||
| queryKey: ['post', this.postIdSignal()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the possibility to pass an Observable into the queryKey? Great things are now available with signals, but we still have observables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example:
queryKey: ['post', this.postId$]
// or
queryKey: this.postId$.pipe(map(id => ['post', id]))There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also other props like enabled might be reactive. Probably injectQuery itself should be able to receive Observable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, what do you think about using toSignal()?
queryKey: ['post', toSignal(this.postId$)]Would that be sufficient? Willing to look into adding first class support for observables if many people want it but on the other hand it might increase complexity quite a bit and Angular has good interop between observables and signals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it might suffice, but it needs to be tested in real situations for potential leaks or other issues.
feat: update angular version, code DX, examples and tests
fix(angular-query): improve development workflow
build working for angular-query-devtools-experimental
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2af306d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (87.83%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6195 +/- ##
=========================================
+ Coverage 0 87.83% +87.83%
=========================================
Files 0 87 +87
Lines 0 2926 +2926
Branches 0 803 +803
=========================================
+ Hits 0 2570 +2570
- Misses 0 297 +297
- Partials 0 59 +59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@tanstack/react-query](https://tanstack.com/query) ([source](https://togithub.com/TanStack/query)) | [`5.10.0` -> `5.12.2`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query/5.10.0/5.12.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>TanStack/query (@​tanstack/react-query)</summary> ### [`v5.12.2`](https://togithub.com/TanStack/query/releases/tag/v5.12.2) [Compare Source](https://togithub.com/TanStack/query/compare/v5.12.1...v5.12.2) Version 5.12.2 - 12/2/2023, 9:37 AM ##### Changes ##### Fix - useQueries: add type tests for useQueries and fix a couple of type bugs ([#​6471](https://togithub.com/TanStack/query/issues/6471)) ([`b54936f`](https://togithub.com/TanStack/query/commit/b54936f1)) by Charlotte Grace (Bone) ##### Docs - angular-query: fix quickstart ([`23374bb`](https://togithub.com/TanStack/query/commit/23374bb4)) by [@​eneajaho](https://togithub.com/eneajaho) - angular-query: compatible with angular 17 ([#​6469](https://togithub.com/TanStack/query/issues/6469)) ([`ac046b1`](https://togithub.com/TanStack/query/commit/ac046b11)) by Arnoud ##### Packages - [@​tanstack/react-query](https://togithub.com/tanstack/react-query)[@​5](https://togithub.com/5).12.2 - [@​tanstack/vue-query](https://togithub.com/tanstack/vue-query)[@​5](https://togithub.com/5).12.2 - [@​tanstack/react-query-devtools](https://togithub.com/tanstack/react-query-devtools)[@​5](https://togithub.com/5).12.2 - [@​tanstack/react-query-persist-client](https://togithub.com/tanstack/react-query-persist-client)[@​5](https://togithub.com/5).12.2 - [@​tanstack/react-query-next-experimental](https://togithub.com/tanstack/react-query-next-experimental)[@​5](https://togithub.com/5).12.2 ### [`v5.12.1`](https://togithub.com/TanStack/query/releases/tag/v5.12.1) [Compare Source](https://togithub.com/TanStack/query/compare/v5.12.0...v5.12.1) Version 5.12.1 - 12/1/2023, 3:42 PM ##### Changes ##### Feat - experimental angular query adapter ([https://github.com/TanStack/query/pull/6195](https://togithub.com/TanStack/query/pull/6195)) (TanStack/query@46034aa) by Arnoud ##### Fix - angular release process ([#​6468](https://togithub.com/TanStack/query/issues/6468)) ([`4e8a6c5`](https://togithub.com/TanStack/query/commit/4e8a6c5a)) by Dominik Dorfmeister ##### Chore - Use prettier v4 alpha ([#​6466](https://togithub.com/TanStack/query/issues/6466)) ([`3a60413`](https://togithub.com/TanStack/query/commit/3a60413d)) by Lachlan Collins ##### Packages - [@​tanstack/eslint-plugin-query](https://togithub.com/tanstack/eslint-plugin-query)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-async-storage-persister](https://togithub.com/tanstack/query-async-storage-persister)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-broadcast-client-experimental](https://togithub.com/tanstack/query-broadcast-client-experimental)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-core](https://togithub.com/tanstack/query-core)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-devtools](https://togithub.com/tanstack/query-devtools)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-persist-client-core](https://togithub.com/tanstack/query-persist-client-core)[@​5](https://togithub.com/5).12.1 - [@​tanstack/query-sync-storage-persister](https://togithub.com/tanstack/query-sync-storage-persister)[@​5](https://togithub.com/5).12.1 - [@​tanstack/react-query](https://togithub.com/tanstack/react-query)[@​5](https://togithub.com/5).12.1 - [@​tanstack/react-query-devtools](https://togithub.com/tanstack/react-query-devtools)[@​5](https://togithub.com/5).12.1 - [@​tanstack/react-query-persist-client](https://togithub.com/tanstack/react-query-persist-client)[@​5](https://togithub.com/5).12.1 - [@​tanstack/react-query-next-experimental](https://togithub.com/tanstack/react-query-next-experimental)[@​5](https://togithub.com/5).12.1 - [@​tanstack/solid-query](https://togithub.com/tanstack/solid-query)[@​5](https://togithub.com/5).12.1 - [@​tanstack/solid-query-devtools](https://togithub.com/tanstack/solid-query-devtools)[@​5](https://togithub.com/5).12.1 - [@​tanstack/solid-query-persist-client](https://togithub.com/tanstack/solid-query-persist-client)[@​5](https://togithub.com/5).12.1 - [@​tanstack/svelte-query](https://togithub.com/tanstack/svelte-query)[@​5](https://togithub.com/5).12.1 - [@​tanstack/svelte-query-devtools](https://togithub.com/tanstack/svelte-query-devtools)[@​5](https://togithub.com/5).12.1 - [@​tanstack/svelte-query-persist-client](https://togithub.com/tanstack/svelte-query-persist-client)[@​5](https://togithub.com/5).12.1 - [@​tanstack/vue-query](https://togithub.com/tanstack/vue-query)[@​5](https://togithub.com/5).12.1 - [@​tanstack/vue-query-devtools](https://togithub.com/tanstack/vue-query-devtools)[@​5](https://togithub.com/5).12.1 - [@​tanstack/angular-query-devtools-experimental](https://togithub.com/tanstack/angular-query-devtools-experimental)[@​5](https://togithub.com/5).12.1 - [@​tanstack/angular-query-experimental](https://togithub.com/tanstack/angular-query-experimental)[@​5](https://togithub.com/5).12.1 ### [`v5.12.0`](https://togithub.com/TanStack/query/compare/v5.10.0...v5.12.0) [Compare Source](https://togithub.com/TanStack/query/compare/v5.10.0...v5.12.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ariakit/ariakit). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Experimental Angular adapter
Uses signals, will support Angular 17+
The Svelte adapter served as a very good base, thanks! ❤️
Feedback is very welcome! Contact me on the Tanstack Discord in the angular-query channel or in this Github discussion.
To do