Skip to content
Source
Sign inSign up
TanStack/query

Angular pre-release updates #10470

Closedbenjavicente(GitHub profile, opens in a new tab)wants to merge 9 commits intomain fromrefs/pull/10470/headopened View on GitHub

🎯 Changes

I joined my previous PR's #10340 and #9986, that continued the work of @arnoud-dv at #9893, into 2 step PRs, one for fixing multiple issues, and another one for preparing the non-experimental release.


This one gets upgrades the deps to angular +20, fixes most reported issues, and ads a couple of features that might be expected to work for SSR (like in Analog).

The core idea is that this PR is as backwards compatible as it can be, but it prepares everything for a stable release that removes the usage of deprecated angular APIs (that are not part of LTS) and marks as deprecated some of the exported APIs. It is a heavy PR since it includes some new features for SSR plus examples for it, and a lot of tests to verify correct behavior. The commits are split in a way that is easier to review commit by commit.

Ordering the changes was heavelly powered by AI, but the core internal changes were not made by it.

New things and things to be aware of:

  • Bump Angular to +20 since 18 has no active support.
  • Implementation uses linked signals, lazy store initialization and lazy proxy reads to avoid issues when reading signals to early, fixing issues like #7488. Most of the work here is taking what was started on @arnoud-dv's PR at #9893
  • Better pending task support, allowing proper SSR and better test integration via pending tasks, fixing issues like #10046
  • Devtools as it's own package, following the same pattern as other adapters (explicit dep instead of optional dep).
  • Fixes the implementation and types of injectQueries
  • Added withHydrationKey() and withNoQueryHydration(), allowing multiple clients for hydratationa and using the same opt out of hydratation behaviour as the Angular HTTP Client withNoHttpTransferCache(). This might match some users expectation of how the client should work in Angular.
  • Support for SSR for withPersistQueryClient by allowing a different signature that only runs on the browser.

I'm pushing some changes to my own scope @benjavicente/angular-query-experimental, but I will love to have a more official PR preview channel with pkg-pr-new for the PR, and then the fixes and features in the official package.


The next PR for the stable release would be this one: https://github.com/benjavicente/query/pull/8

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).
    1. Important

      Review skipped

      Too many files!

      This PR contains 192 files, which is 42 over the limit of 150.

      To get a review, narrow the scope: • coderabbit review --type committed # exclude uncommitted changes • coderabbit review --dir # limit to a subdirectory • coderabbit review --base # compare against a closer base

      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: 741d2b0d-7be8-4e18-b529-349298080547

      📥 Commits

      Reviewing files that changed from the base of the PR and between f3d8d2abbf15bf81ff7575d3be9845d7b402f25a and 014ed44c3f9c1f03120f4bfc9ed914dc20557fef.

      ⛔ Files ignored due to path filters (2)
      • examples/angular/dynamic-devtools/src/favicon.ico is excluded by !**/*.ico
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (192)
      • .changeset/angular-20-ssr-lazy-signals.md
      • docs/framework/angular/angular-httpclient-and-other-data-fetching-clients.md
      • docs/framework/angular/devtools.md
      • docs/framework/angular/guides/default-query-function.md
      • docs/framework/angular/guides/dependent-queries.md
      • docs/framework/angular/guides/parallel-queries.md
      • docs/framework/angular/guides/query-retries.md
      • docs/framework/angular/guides/ssr.md
      • docs/framework/angular/guides/testing.md
      • docs/framework/angular/installation.md
      • docs/framework/angular/overview.md
      • docs/framework/angular/quick-start.md
      • docs/framework/angular/reference/functions/injectInfiniteQuery.md
      • docs/framework/angular/reference/functions/injectMutation.md
      • docs/framework/angular/reference/functions/injectQueries.md
      • docs/framework/angular/reference/functions/injectQuery.md
      • docs/framework/angular/reference/functions/provideAngularQuery.md
      • docs/framework/angular/reference/functions/provideQueryClient.md
      • docs/framework/angular/reference/functions/provideTanStackQuery.md
      • docs/framework/angular/reference/functions/queryFeature.md
      • docs/framework/angular/reference/functions/queryOptions.md
      • docs/framework/angular/reference/functions/withHydrationKey.md
      • docs/framework/angular/reference/functions/withNoQueryHydration.md
      • docs/framework/angular/reference/index.md
      • docs/framework/angular/reference/interfaces/BaseQueryNarrowing.md
      • docs/framework/angular/reference/interfaces/CreateInfiniteQueryOptions.md
      • docs/framework/angular/reference/interfaces/CreateQueryOptions.md
      • docs/framework/angular/reference/interfaces/InjectInfiniteQueryOptions.md
      • docs/framework/angular/reference/interfaces/InjectMutationOptions.md
      • docs/framework/angular/reference/interfaces/InjectQueriesOptions.md
      • docs/framework/angular/reference/interfaces/InjectQueryOptions.md
      • docs/framework/angular/reference/interfaces/QueryFeature.md
      • docs/framework/angular/reference/type-aliases/CreateBaseQueryOptions.md
      • docs/framework/angular/reference/type-aliases/CreateBaseQueryResult.md
      • docs/framework/angular/reference/type-aliases/CreateInfiniteQueryResult.md
      • docs/framework/angular/reference/type-aliases/CreateMutationResult.md
      • docs/framework/angular/reference/type-aliases/CreateQueryOptions.md
      • docs/framework/angular/reference/type-aliases/CreateQueryResult.md
      • docs/framework/angular/reference/type-aliases/DefinedCreateInfiniteQueryResult.md
      • docs/framework/angular/reference/type-aliases/DefinedCreateQueryResult.md
      • docs/framework/angular/reference/type-aliases/DefinedInitialDataOptions.md
      • docs/framework/angular/reference/type-aliases/DevtoolsFeature.md
      • docs/framework/angular/reference/type-aliases/PersistQueryClientFeature.md
      • docs/framework/angular/reference/type-aliases/QueriesOptions.md
      • docs/framework/angular/reference/type-aliases/QueriesResults.md
      • docs/framework/angular/reference/type-aliases/QueryFeatures.md
      • docs/framework/angular/reference/type-aliases/UndefinedInitialDataOptions.md
      • docs/framework/angular/reference/type-aliases/UnusedSkipTokenOptions.md
      • examples/angular/auto-refetching/package.json
      • examples/angular/auto-refetching/src/app/app.config.ts
      • examples/angular/basic-persister/package.json
      • examples/angular/basic-persister/src/app/app.config.ts
      • examples/angular/basic/package.json
      • examples/angular/basic/src/app/app.config.ts
      • examples/angular/devtools-panel/package.json
      • examples/angular/devtools-panel/src/app/app.config.ts
      • examples/angular/devtools-panel/src/app/components/basic-devtools-panel-example.component.ts
      • examples/angular/devtools-panel/src/app/components/lazy-load-devtools-panel-example.component.ts
      • examples/angular/dynamic-devtools/.devcontainer/devcontainer.json
      • examples/angular/dynamic-devtools/.eslintrc.cjs
      • examples/angular/dynamic-devtools/README.md
      • examples/angular/dynamic-devtools/angular.json
      • examples/angular/dynamic-devtools/package.json
      • examples/angular/dynamic-devtools/src/app/app.component.ts
      • examples/angular/dynamic-devtools/src/app/app.config.ts
      • examples/angular/dynamic-devtools/src/app/components/dynamic-devtools-example.component.html
      • examples/angular/dynamic-devtools/src/app/components/dynamic-devtools-example.component.ts
      • examples/angular/dynamic-devtools/src/app/devtools-options.manager.ts
      • examples/angular/dynamic-devtools/src/index.html
      • examples/angular/dynamic-devtools/src/main.ts
      • examples/angular/dynamic-devtools/src/styles.css
      • examples/angular/dynamic-devtools/tsconfig.app.json
      • examples/angular/dynamic-devtools/tsconfig.json
      • examples/angular/infinite-query-with-max-pages/package.json
      • examples/angular/infinite-query-with-max-pages/src/app/app.config.ts
      • examples/angular/optimistic-updates/package.json
      • examples/angular/optimistic-updates/src/app/app.config.ts
      • examples/angular/pagination/package.json
      • examples/angular/pagination/src/app/app.config.ts
      • examples/angular/query-options-from-a-service/package.json
      • examples/angular/query-options-from-a-service/src/app/app.config.ts
      • examples/angular/router/package.json
      • examples/angular/router/src/app/app.config.ts
      • examples/angular/rxjs/package.json
      • examples/angular/rxjs/src/app/app.config.ts
      • examples/angular/simple/package.json
      • examples/angular/simple/src/app/app.config.ts
      • examples/angular/ssr-persist/.devcontainer/devcontainer.json
      • examples/angular/ssr-persist/.eslintrc.cjs
      • examples/angular/ssr-persist/README.md
      • examples/angular/ssr-persist/angular.json
      • examples/angular/ssr-persist/package.json
      • examples/angular/ssr-persist/src/app/app.component.ts
      • examples/angular/ssr-persist/src/app/app.config.server.ts
      • examples/angular/ssr-persist/src/app/app.config.ts
      • examples/angular/ssr-persist/src/app/app.routes.server.ts
      • examples/angular/ssr-persist/src/app/components/client-persist-demo.component.ts
      • examples/angular/ssr-persist/src/app/components/posts.component.ts
      • examples/angular/ssr-persist/src/app/query-client.ts
      • examples/angular/ssr-persist/src/app/query-persist-scope.ts
      • examples/angular/ssr-persist/src/app/services/posts.service.ts
      • examples/angular/ssr-persist/src/index.html
      • examples/angular/ssr-persist/src/main.server.ts
      • examples/angular/ssr-persist/src/main.ts
      • examples/angular/ssr-persist/src/server.ts
      • examples/angular/ssr-persist/src/styles.css
      • examples/angular/ssr-persist/tsconfig.app.json
      • examples/angular/ssr-persist/tsconfig.json
      • examples/angular/ssr/.devcontainer/devcontainer.json
      • examples/angular/ssr/.eslintrc.cjs
      • examples/angular/ssr/README.md
      • examples/angular/ssr/angular.json
      • examples/angular/ssr/package.json
      • examples/angular/ssr/src/app/app.component.ts
      • examples/angular/ssr/src/app/app.config.server.ts
      • examples/angular/ssr/src/app/app.config.ts
      • examples/angular/ssr/src/app/app.routes.server.ts
      • examples/angular/ssr/src/app/components/posts.component.ts
      • examples/angular/ssr/src/app/query-client.ts
      • examples/angular/ssr/src/app/services/posts.service.ts
      • examples/angular/ssr/src/index.html
      • examples/angular/ssr/src/main.server.ts
      • examples/angular/ssr/src/main.ts
      • examples/angular/ssr/src/server.ts
      • examples/angular/ssr/src/styles.css
      • examples/angular/ssr/tsconfig.app.json
      • examples/angular/ssr/tsconfig.json
      • integrations/angular-cli-20/package.json
      • integrations/angular-cli-20/src/app/app.config.ts
      • knip.json
      • packages/angular-query-devtools/package.json
      • packages/angular-query-devtools/src/__tests__/inject-devtools-panel.test.ts
      • packages/angular-query-devtools/src/__tests__/test-utils.ts
      • packages/angular-query-devtools/src/__tests__/with-devtools.test.ts
      • packages/angular-query-devtools/src/devtools-panel/index.ts
      • packages/angular-query-devtools/src/devtools-panel/inject-devtools-panel.ts
      • packages/angular-query-devtools/src/devtools-panel/production/index.ts
      • packages/angular-query-devtools/src/devtools-panel/stub.ts
      • packages/angular-query-devtools/src/devtools-panel/types.ts
      • packages/angular-query-devtools/src/index.ts
      • packages/angular-query-devtools/src/production/index.ts
      • packages/angular-query-devtools/src/stub.ts
      • packages/angular-query-devtools/src/types.ts
      • packages/angular-query-devtools/src/with-devtools.ts
      • packages/angular-query-devtools/test-setup.ts
      • packages/angular-query-devtools/tsconfig.json
      • packages/angular-query-devtools/tsconfig.prod.json
      • packages/angular-query-devtools/tsconfig.spec.json
      • packages/angular-query-devtools/vite.config.ts
      • packages/angular-query-devtools/vitest.config.ts
      • packages/angular-query-experimental/package.json
      • packages/angular-query-experimental/src/__tests__/inject-devtools-panel.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.ts
      • packages/angular-query-experimental/src/__tests__/inject-infinite-query.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-is-fetching.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-is-mutating.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-is-restoring.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-mutation-state.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-mutation.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-queries.test-d.ts
      • packages/angular-query-experimental/src/__tests__/inject-queries.test.ts
      • packages/angular-query-experimental/src/__tests__/inject-query.test-d.ts
      • packages/angular-query-experimental/src/__tests__/inject-query.test.ts
      • packages/angular-query-experimental/src/__tests__/mutation-options.test.ts
      • packages/angular-query-experimental/src/__tests__/pending-tasks.test.ts
      • packages/angular-query-experimental/src/__tests__/provide-query-client.test.ts
      • packages/angular-query-experimental/src/__tests__/provide-tanstack-query.test.ts
      • packages/angular-query-experimental/src/__tests__/signal-proxy.test.ts
      • packages/angular-query-experimental/src/__tests__/test-utils.ts
      • packages/angular-query-experimental/src/__tests__/with-devtools.test.ts
      • packages/angular-query-experimental/src/__tests__/with-hydration.test.ts
      • packages/angular-query-experimental/src/create-base-query.ts
      • packages/angular-query-experimental/src/hydration-state-key.ts
      • packages/angular-query-experimental/src/index.ts
      • packages/angular-query-experimental/src/inject-infinite-query.ts
      • packages/angular-query-experimental/src/inject-mutation.ts
      • packages/angular-query-experimental/src/inject-queries-experimental/index.ts
      • packages/angular-query-experimental/src/inject-queries.ts
      • packages/angular-query-experimental/src/inject-query.ts
      • packages/angular-query-experimental/src/pending-tasks-compat.ts
      • packages/angular-query-experimental/src/providers.ts
      • packages/angular-query-experimental/src/query-options.ts
      • packages/angular-query-experimental/src/signal-proxy.ts
      • packages/angular-query-experimental/src/types.ts
      • packages/angular-query-experimental/test-setup.ts
      • packages/angular-query-experimental/tsconfig.spec.json
      • packages/angular-query-experimental/vite.config.ts
      • packages/angular-query-experimental/vitest.config.ts
      • packages/angular-query-persist-client/package.json
      • packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts
      • packages/angular-query-persist-client/src/with-persist-query-client.ts
      • packages/angular-query-persist-client/src/with-persist-query-client.types.ts

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation

    3. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: angular-query-experimental

    4. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: angular-query-persist-client

    5. Actually huge :)

      I hope we can get this merged

    6. thanks for all the work you're putting on this. hope this will get merged and the angular query package will get out of experimental

    7. Review the following changes in direct dependencies. Learn more about Socket for GitHub.

      Diff Package Supply Chain
      Security
      Vulnerability Quality Maintenance License
      Added@​types/​express@​5.0.61001007184100
      Addedzone.js@​0.16.010010010088100
      Addedzone.js@​0.16.110010010088100
      Added@​analogjs/​vite-plugin-angular@​2.5.39810010096100

      View full report

    8. Warning

      Review the following alerts detected in dependencies.

      According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

      Action Severity Alert  (click "▶" to expand/collapse)
      Warn High
      Obfuscated code: npm @angular/ssr is 91.0% likely obfuscated

      Confidence: 0.91

      Location: Package overview

      From: pnpm-lock.yaml → npm/@angular/build@20.3.22 → npm/@angular/ssr@20.3.26

      ℹ Read more on: This package | This alert | What is obfuscated code?

      Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

      Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

      Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@angular/ssr@20.3.26. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

      View full report

Sign in to join this conversation.