Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
wants to merge 5 commits into from
Closed

Conversation

alxhub
Copy link
Member

@alxhub alxhub commented May 16, 2025

A copy of #60610 with a flag to allow the behavior to be patched out.

@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change area: build & ci Related the build and CI infrastructure of the project area: core Issues related to the framework runtime labels May 16, 2025
@ngbot ngbot bot added this to the Backlog milestone May 16, 2025
@alxhub alxhub changed the title DNS: Gated Resource API changes Gated Resource API changes May 20, 2025
@alxhub alxhub added target: rc This PR is targeted for the next release-candidate merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels May 20, 2025
@alxhub
Copy link
Member Author

alxhub commented May 20, 2025

Caretaker: this needs an update to the g3 patch & a single client application: cl/760838126

Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a 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

@pkozlowski-opensource pkozlowski-opensource marked this pull request as ready for review May 20, 2025 10:39
@pullapprove pullapprove bot requested a review from josephperrott May 20, 2025 10:39
@pkozlowski-opensource pkozlowski-opensource added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 20, 2025
@alxhub alxhub force-pushed the resource-api-gated branch 2 times, most recently from c60422e to 301e5ba Compare May 21, 2025 16:51
@alxhub alxhub force-pushed the resource-api-gated branch from 301e5ba to 99b2641 Compare May 21, 2025 17:29
@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer detected: breaking change PR contains a commit with a breaking change labels May 21, 2025
Humberd added 4 commits May 21, 2025 12:02
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.
@alxhub alxhub force-pushed the resource-api-gated branch from 99b2641 to ad0346c Compare May 21, 2025 19:04
@atscott atscott closed this in 5762c23 May 21, 2025
@atscott
Copy link
Contributor

atscott commented May 21, 2025

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
…g undefined (#61441)

When there is an underlying error state it would not be possible to swallow the error with:
`computed(() => res.value()?.inner);`

PR Close #61441
atscott pushed a commit that referenced this pull request May 21, 2025
…1441)

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.

PR Close #61441
atscott pushed a commit that referenced this pull request May 21, 2025
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
…g undefined (#61441)

When there is an underlying error state it would not be possible to swallow the error with:
`computed(() => res.value()?.inner);`

PR Close #61441
atscott pushed a commit that referenced this pull request May 21, 2025
…1441)

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.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants