query icon indicating copy to clipboard operation
query copied to clipboard

refactor: rename useErrorBoundar option to throwError

Open Moshyfawn opened this issue 2 years ago • 3 comments

throwError name makes the most sense as it's a common name within request packages like ky (ex: throwHttpErrors)

Closes: #4677

Moshyfawn avatar Dec 23 '22 20:12 Moshyfawn

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 47acfc507653a0185de0f539e2e38ddcb97dbaa4:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

codesandbox-ci[bot] avatar Dec 23 '22 20:12 codesandbox-ci[bot]

throwHttpErrors

good point about that. Do you thin throwErrors would be better than throwError ?

Also, can you please add a paragraph to the migration guide:

https://github.com/TanStack/query/blob/cfb15ef582e080c82c149cdcba998d3d5e570ae7/docs/react/guides/migrating-to-react-query-5.md#L6-L9

Oh, and the PR needs to go to the v5 branch please, not main 😅

TkDodo avatar Dec 25 '22 12:12 TkDodo

Codecov Report

:exclamation: No coverage uploaded for pull request base (v5@67ed215). Click here to learn what that means. Patch has no changes to coverable lines.

Additional details and impacted files
@@          Coverage Diff          @@
##             v5    #4697   +/-   ##
=====================================
  Coverage      ?   92.39%           
=====================================
  Files         ?       89           
  Lines         ?     3748           
  Branches      ?      985           
=====================================
  Hits          ?     3463           
  Misses        ?      269           
  Partials      ?       16           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Dec 25 '22 12:12 codecov-commenter

throwHttpErrors

good point about that. Do you thin throwErrors would be better than throwError ?

I'm not sure about the plural version as it might imply that there are multiple errors being thrown, which is not the case, I believe. I'm happy to change it to the plural version if you think it is more fitting.

Although, you're able to reset the error boundary, at which point there can be another error thrown, which makes it multiple..

Moshyfawn avatar Dec 28 '22 20:12 Moshyfawn

Also, can you please add a paragraph to the migration guide:

https://github.com/TanStack/query/blob/cfb15ef582e080c82c149cdcba998d3d5e570ae7/docs/react/guides/migrating-to-react-query-5.md#L6-L9

Is it fine that the id is "migrating-to-react-query-5" and the guide title is "Migrating to TanStack Query v5"?

Moshyfawn avatar Dec 28 '22 21:12 Moshyfawn

Also, can you please add a paragraph to the migration guide:

https://github.com/TanStack/query/blob/cfb15ef582e080c82c149cdcba998d3d5e570ae7/docs/react/guides/migrating-to-react-query-5.md#L6-L9

Here you go 04b033bfe872cab747cb2d78bfad595ac3064cea

Moshyfawn avatar Dec 28 '22 23:12 Moshyfawn

Is it fine that the id is "migrating-to-react-query-5" and the guide title is "Migrating to TanStack Query v5"?

hm, the id is the slug in the url. So maybe it should just be migrate-to-v5. I can do this directly on the v5 branch though.

I'm not sure about the plural version as it might imply that there are multiple errors being thrown, which is not the case, I believe. I'm happy to change it to the plural version if you think it is more fitting.

Although, you're able to reset the error boundary, at which point there can be another error thrown, which makes it multiple..

yeah let'a go with throwErrors please. It can be different kind of errors, like an error from the queryFn or an error from the selectFn. It can also be different errors at different times as you mentioned. I would read it as: "throw all errors that could potentially occur"

TkDodo avatar Dec 29 '22 09:12 TkDodo

yeah let'a go with throwErrors please. It can be different kind of errors, like an error from the queryFn or an error from the selectFn. It can also be different errors at different times as you mentioned. I would read it as: "throw all errors that could potentially occur"

Makes sense! Will do

Moshyfawn avatar Dec 30 '22 17:12 Moshyfawn

@allcontributors add @Moshyfawn for code

TkDodo avatar Dec 30 '22 21:12 TkDodo

@TkDodo

I've put up a pull request to add @Moshyfawn! :tada:

allcontributors[bot] avatar Dec 30 '22 21:12 allcontributors[bot]