-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Gated Resource API changes #61441
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
Closed
Closed
Gated Resource API changes #61441
Conversation
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
Caretaker: this needs an update to the g3 patch & a single client application: cl/760838126 |
pkozlowski-opensource
approved these changes
May 20, 2025
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.
LGTM
Reviewed-for: fw-general
Reviewed-for: public-api
c60422e
to
301e5ba
Compare
It was set to es2022 for build tsconfig in https://github.com/angular/angular/pull/60066/files#diff-7ec658aedc62a693cc513accc8f360938d90bcbdb09aa79c1401e56fe84f5fd3, but was missed for the main one.
301e5ba
to
99b2641
Compare
Now only mutable resources can be reloaded.
`Resource.error` used to return `unknown`. Now it's `Error | undefined`. For non-`Error` types they are encapsulated with the `Error` type.
…g undefined When there is an underlying error state it would not be possible to swallow the error with: `computed(() => res.value()?.inner);`
When the resource is loading after reloading from the error state reading `Resource.value()` would return the default value instead of throwing an error. This change prevents `Resource.hasValue()` from throwing an error in such a case.
99b2641
to
ad0346c
Compare
This PR was merged into the repository by commit 905194f. The changes were merged into the following branches: main, 20.0.x |
atscott
pushed a commit
that referenced
this pull request
May 21, 2025
Now only mutable resources can be reloaded. PR Close #61441
atscott
pushed a commit
that referenced
this pull request
May 21, 2025
`Resource.error` used to return `unknown`. Now it's `Error | undefined`. For non-`Error` types they are encapsulated with the `Error` type. PR Close #61441
atscott
pushed a commit
that referenced
this pull request
May 21, 2025
It was set to es2022 for build tsconfig in https://github.com/angular/angular/pull/60066/files#diff-7ec658aedc62a693cc513accc8f360938d90bcbdb09aa79c1401e56fe84f5fd3, but was missed for the main one. PR Close #61441
atscott
pushed a commit
that referenced
this pull request
May 21, 2025
Now only mutable resources can be reloaded. PR Close #61441
atscott
pushed a commit
that referenced
this pull request
May 21, 2025
`Resource.error` used to return `unknown`. Now it's `Error | undefined`. For non-`Error` types they are encapsulated with the `Error` type. PR Close #61441
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action: merge
The PR is ready for merge by the caretaker
area: build & ci
Related the build and CI infrastructure of the project
area: core
Issues related to the framework runtime
merge: caretaker note
Alert the caretaker performing the merge to check the PR for an out of normal action needed or note
target: rc
This PR is targeted for the next release-candidate
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.
A copy of #60610 with a flag to allow the behavior to be patched out.