Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
…d GET resources Opt-in, Angular 20+. Every GET operation without a request body gets a <operation>Resource method next to its Observable method, returning an Angular httpResource (httpResource.text or httpResource.blob when the response is text or binary). Writes keep only their Observable method. The query, header and credential code moves into a partial shared by both paths, so the output of every existing configuration is unchanged. Adds a sample build inside typescript-angular-v22-provided-in-root with an HttpTestingController spec.
thekhegay
force-pushed
the
typescript-angular-http-resource
branch
from
September 19, 2026 12:14
5124c05 to
a344b41
Compare
Author
|
About cubic review:
|
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.
Adds an opt-in
withHttpResourceoption totypescript-angular(Angular 20+; a lowerngVersionis refused).Every GET operation without a request body gets a
<operationId>Resourcemethod next to its Observable method, returning an AngularHttpResourceRef:undefined, or leaving a required parameter null/undefined, keeps the resource idle.httpResource, texthttpResource.text, binaryhttpResource.blob, chosen at generation time the same wayselectHeaderAcceptdoes.withCredentials,contextandtransferCachebehave exactly like the Observable methods.defaultValue,injector,equal,debugName,context,transferCache.observe,httpHeaderAccept,parse, and resource signatures in the*Interfacefiles.With the option off the output is unchanged: regenerating every
bin/configsfile gives zero diff. Tested with Java unit tests and a new sample build (typescript-angular-v22-provided-in-root/builds/with-http-resource) with anHttpTestingControllerspec; the generated code was also compiled and run against Angular 20, 21 and 22.Closes #21263. Related: #22537 — this keeps the Observable methods and doesn't touch existing samples.
PR checklist
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov @davidgamero @mkusaka @joscha @KannaKim
Summary by cubic
Adds an opt-in
withHttpResourceoption totypescript-angularthat generates signal-based<operationId>Resourcemethods next to the existing Observable methods. With the option off, generated output is unchanged; enabling it requires Angular 20+ and rejects lowerngVersionvalues.New Features
<operationId>Resourcemethod returning an AngularHttpResourceRef; JSON, text, and binary responses usehttpResource,httpResource.text, andhttpResource.blob.undefinedor a required parameter isnull/undefined.withCredentials,context, andtransferCachebehavior matches the Observable methods.defaultValue,injector,equal,debugName,context, andtransferCache.observe,httpHeaderAccept, andparseremain Observable-only.Closes #21263.
Written for commit a344b41. Summary will update on new commits.