-
Notifications
You must be signed in to change notification settings - Fork 55
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
v3 #1423
base: main
Are you sure you want to change the base?
Conversation
People can be co-author:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: -8.32 kB (-12.04%) 👏 Total Size: 60.7 kB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1423 +/- ##
=========================================
+ Coverage 0 77.73% +77.73%
=========================================
Files 0 66 +66
Lines 0 548 +548
Branches 0 121 +121
=========================================
+ Hits 0 426 +426
- Misses 0 117 +117
- Partials 0 5 +5
|
🦋 Changeset detectedLatest commit: f00fbe0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Poco <23068523+pocojang@users.noreply.github.com> Co-authored-by: Juhyeok Kang <23312485+kangju2000@users.noreply.github.com>
…error (#1409) 🚧 This PR could make a huge difference, so please help us make sure this change gets a very thorough review. 🚧 ```tsx const Throw = { Error: ({ message, after = 0, children }: PropsWithChildren<{ message: string; after?: number }>) => { const [isNeedThrow, setIsNeedThrow] = useState(after === 0) if (isNeedThrow) { throw new Error(message) } useTimeout(() => setIsNeedThrow(true), after) return <>{children}</> } } const Example = () => ( <ErrorBoundary fallback={() => <>This is expected</>}> <ErrorBoundary fallback={() => ( <Throw.Error message={ERROR_MESSAGE} after={100}> ErrorBoundary's fallback before error </Throw.Error> )} > <Throw.Error message={ERROR_MESSAGE} after={100}> ErrorBoundary's children before error </Throw.Error> </ErrorBoundary> </ErrorBoundary> ) ``` ## Problem: ErrorBoundary's fallback can't be treated by parent ErrorBoundary <!-- A clear and concise description of what this pr is about. --> Thrown Error in fallback will be caught by ErrorBoundary self and then expose fallback recursively 🥲 1. ErrorBoundary's children before error 2. ErrorBoundary's fallback before error 3. ErrorBoundary's fallback before error 4. ErrorBoundary's fallback before error 5. ... expose fallback self recursively ... ## Solution: When we meet thrown error in fallback of ErrorBoundary wrap it as InternalFallbackError, re-throw InternalFallbackError.fallbackError, if it is InternalFallbackError Thrown Error in fallback will be caught by parent ErrorBoundary 👍 1. ErrorBoundary's children before error 2. ErrorBoundary's fallback before error 3. This is expected ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 5. I added documents and tests. --------- Co-authored-by: Lee HyunJae (whale) <71202076+2-NOW@users.noreply.github.com> Co-authored-by: lucas0530 <23375098+lucas0530@users.noreply.github.com> Co-authored-by: HYUNGU KANG <69349293+linegu@users.noreply.github.com> Co-authored-by: Brian Vaughn <29597+bvaughn@users.noreply.github.com>
close #1451 # with as method <!-- A clear and concise description of what this pr is about. --> There were two reasons why withXXX was inconvenient ( #270 ) 1. It was inconvenient to read in the case of nested hoc by receiving xxxProps as the second argument 2. I thought it was difficult to read in the case of nested Suspense, ErrorBoundary, etc. ## v1 withXXX ```tsx export default withErrorBoundary( withSuspense( () => { /** * * * * Many implementation will be here * * * */ return 'success' }, { fallback: 'loading…' } // far position with name of withSuspense ), { fallback: () => 'error' } // far position with name of withErrorBoundary ) ``` ## v2 wrap.XXX ```tsx export default wrap .ErrorBoundary({ fallback: () => 'error' }) // Good to read .Suspense({ fallback: 'loading…' }) // Good to read .on(() => { // But users need to know builder pattern /** * * * * Many implementation will be here * * * */ return 'success' }) ``` Because of these two points, I thought that the code would be readable if I made it with wrap builder, but when library users actually used v2 wrap, they didn't understand how to use it nestedly or how to use wrap well. So I want to change it to a with method for each component like below code so that it receives props first, although it's simple. 1. I want to make props are received first. 2. I don't want it to be a builder. ## v3 XXX.with ```tsx export default ErrorBoundary.with({ fallback: () => 'error' }, // Good to read Susepnse.with({ fallback: 'loading…' }, () => { // Good to read /** * * * * Many implementation will be here * * * */ return 'success' }) ) ``` ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `next` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `next`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @suspensive/react@3.0.0-next.3 ### Major Changes - [#1452](#1452) [`79cfd61`](79cfd61) Thanks [@manudeli](https://github.com/manudeli)! - feat(react): with as method ## @suspensive/react-query@3.0.0-next.3 ### Patch Changes - Updated dependencies \[]: - @suspensive/react-query-4@3.0.0-next.3 - @suspensive/react-query-5@3.0.0-next.3 ## @suspensive/jotai@3.0.0-next.3 ## @suspensive/react-query-4@3.0.0-next.3 ## @suspensive/react-query-5@3.0.0-next.3
# Overview <!-- A clear and concise description of what this pr is about. --> ## PR Checklist - [ ] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `next` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `next`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @suspensive/react@3.0.0-next.4 ### Patch Changes - [#1455](#1455) [`05a9759`](05a9759) Thanks [@manudeli](https://github.com/manudeli)! - fix(react): fix wrong interface of with method ## @suspensive/react-query@3.0.0-next.4 ### Patch Changes - Updated dependencies \[]: - @suspensive/react-query-4@3.0.0-next.4 - @suspensive/react-query-5@3.0.0-next.4 ## @suspensive/jotai@3.0.0-next.4 ## @suspensive/react-query-4@3.0.0-next.4 ## @suspensive/react-query-5@3.0.0-next.4
# Overview closed: #1442 In React Query v4, the `OnlineManager` checks the client's network status using `navigator.onLine`. However, this can sometimes cause bugs in Chrome (Chromium-based browsers), where the network is incorrectly detected as offline even when it is online. To minimize this issue, React Query v5 no longer relies on `navigator.onLine`. In React Query v4, to minimize this issue, **networkMode is set to always in Suspense Hooks**. This change ensures that TData in Suspense remains guaranteed. ref: - https://github.com/TanStack/query/blob/v4/packages/query-core/src/onlineManager.ts#L92 - TanStack/query#4753 - https://issues.chromium.org/issues/338514113 ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --------- Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `next` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `next`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @suspensive/react-query-4@3.0.0-next.5 ### Major Changes - [#1458](#1458) [`c78cbfd`](c78cbfd) Thanks [@gwansikk](https://github.com/gwansikk)! - feat(react-query-4): set network mode to always ## @suspensive/react-query@3.0.0-next.5 ### Patch Changes - Updated dependencies \[[`c78cbfd`](c78cbfd)]: - @suspensive/react-query-4@3.0.0-next.5 - @suspensive/react-query-5@3.0.0-next.5 ## @suspensive/jotai@3.0.0-next.5 ## @suspensive/react@3.0.0-next.5 ## @suspensive/react-query-5@3.0.0-next.5
# Overview <!-- A clear and concise description of what this pr is about. --> #1387 (comment) ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --------- Co-authored-by: Gwansik Kim <39869096+gwansikk@users.noreply.github.com>
close #1108 close #1349 close #1325
Suspensive v3
PR Checklist