Repository navigation
feat(angular): derive .observable() options from the installed HttpClient - #10
Merged
Merged
Conversation
…ient `ObservableOptions` was a hand-kept list, so it lagged Angular: on 22 it rejected `integrity`, `referrer`, `referrerPolicy`, `reportUploadProgress` and `reportDownloadProgress`, and dropped the `@deprecated` tag on `reportProgress`. It is now the catch-all `HttpClient.request` options of the consumer's Angular minus body/params/headers/responseType, plus `injector`, so options a later Angular adds pass through without a release or a regeneration. The service proof checks the option keys against HttpClient's, since a non-literal argument skips excess-property checks, and still rejects the four keys the operation supplies. Verified by hand on Angular 20.3 and 21.2; the suite gates 22.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ObservableOptionsintemplates/angular/rest.model.tswas a hand-kept list, so it fell behind Angular. On Angular 22.observable()rejectedintegrity,referrer,referrerPolicy,reportUploadProgressandreportDownloadProgress, andreportProgresslost its@deprecatedmarker.It is now derived from the consumer's own
HttpClient:Parametersreadsrequest()'s last overload, its catch-all. Options a later Angular adds therefore pass through without a release or a regeneration. The runtime already spread every option intoHttpClient.request, so only the type changes.service-proof.ts): compares the option keys againstHttpClient's, because a non-literal argument skips excess-property checks. It also calls.observable()with the five new options, and keeps@ts-expect-errorchecks for the four keys the operation supplies. Before the fix, the key check failed and named exactly the five missing options.reportUploadProgress/reportDownloadProgressinstead of the deprecatedreportProgress.Test plan
bun run test: 400 passedcargo test: 325 passedbun run typecheck,bun run lintbun run regen-snapshots: onlystatic-template/rest.model.tschangedreportProgressdeprecated on.observable(), the same as onHttpClient.requestAfter release: regenerate
stackblitz/src/generated, which still carries the hand-kept list from 0.7.0.🤖 Generated with Claude Code