query: Angular: `withDevtools` option `loadDevtools` no longer supports dependency injection
Describe the bug
Based on the documentation, you should be able to use inject within the loadDevtools option in the withDevtools function.
See https://github.com/TanStack/query/blob/main/docs/framework/angular/devtools.md
Now if you do this, you will get an NG0203 error.
Breaking PR: https://github.com/TanStack/query/pull/8817
Your minimal, reproducible example
Steps to reproduce
- Initialize angular with tanstack query
- Write a simple service with a boolean signal that will determine if the devtool is active
- Try injecting it in the “loadDevtools” option.
Expected behavior
As a developer I expected the devtools not to throw an NG0203 error
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Any browser
Tanstack Query adapter
angular-query
TanStack Query version
v5.68.1
TypeScript version
v5.8.2
Additional context
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 26
@k3nsei let me start by saying we generally appreciate feedback, and we also appreciate that you are using the angular adapter while it’s still experimental, because feedback in that phase that will help us getting to a good API.
That said, your tone is way out of line. At no point did you stop to consider that this was just an honest mistake by one of the maintainers - you assumed ill intent, tried to lecture everyone on “best practices” and insulted others who tried to chime on this issue, while at the same time bashing React 🤷♂️.
I strongly suggest you re-read your messages and try to reflect if this is really how you want to come across. This is not the kind of conversations and mindset I want to have in the TanStack community, and if this continues, I will lock this issue.
We are open source contributors and maintainers, offering something of value for free, for everyone in the world to use. We deserve better than being bashed by you.
@k3nsei There’s no need to get personal. I’ll fix the original issue as reported by @Eirmas. Clearly this was an oversight of me as it breaks my own code example.
🍿
I’m doing this because I think there’s a big ego on the part of the person who made the mistake of introducing this PR and these groundbreaking changes. Person who doesn’t want to agree that it was a mistake. Just deal with it and don’t be a weak snowflake.
Also, the purpose of libraries like Angular Query is to make things simpler and with less boilerplate. Choosing names like
injectQueryandinjectMutationstrongly suggests that things should run in an injection context. I don’t see why it’s a big problem to still have them as in the past. It makes everyone’s life easier and it’s nicer to use.The last bit of Angular is famous for its opinionated patterns, attention to detail and backwards compatibility. It is the same with the whole ecosystem. Obviously, if you make changes like this, you break all that trust.
If building trust among people who have chosen to rely on this library and not breaking their code base is not a priority here. In that case, I can say goodbye and good luck. There are project that spend multi-miltion dollars to build them, which are used by millions of people every day. Than introducing breaking changes like that, without any announcement and plan how to handle them in reasonable period of time is not trust worthy and better to not rely on libraries with that approach. It’s against philosophy of Angular ecosystem. Even React team when they changed how
Suspenseworks, they discarded their changes because of that reason.@BThomann it is possible that you are just a young, naive student who has never yet been responsible for anything big. And you don’t understand the importance of responsibility.
I don’t know why you keep bringing up the example with the effect. Yes you can pass a injector but still can not call inject inside!?
On the “with” naming convention you disagreed by making a point that I didn’t mention? Yes sure it has to do with providers, thats not the point I was referring to. It was about the injection context.
Well at this point I guess it’s best to “agree to disagree”… At least this is something to agree on.
Relax mate. No need to be personal here. For me there is no point in continuing this discussion here on that level. Happy to continue if it gets back on a technical level.
I am sorry for the author of this issue that this got out of context.