Skip to content
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

feat(promise): add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache, PromiseCacheProvider, usePromiseCache #1074

Merged
merged 8 commits into from
Jul 13, 2024

Conversation

SEOKKAMONI
Copy link
Contributor

@SEOKKAMONI SEOKKAMONI commented Jul 13, 2024

related with #1076
close #1069

Overview

  • add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache, PromiseCacheProvider, usePromiseCache

PR Checklist

  • I did below actions if need
  1. I read the Contributing Guide
  2. I added documents and tests.

@SEOKKAMONI SEOKKAMONI requested a review from manudeli as a code owner July 13, 2024 13:09
Copy link

changeset-bot bot commented Jul 13, 2024

🦋 Changeset detected

Latest commit: 39babc9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@suspensive/promise Minor

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

Copy link

vercel bot commented Jul 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2024 2:56pm
v1.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2024 2:56pm
visualization.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2024 2:56pm

Copy link

vercel bot commented Jul 13, 2024

@SEOKKAMONI is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor Author

@SEOKKAMONI SEOKKAMONI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would be better to review document additions in separate issues, so I did not handle them all at once. I plan to add the documents in a future issue.

Comment on lines +1 to +12
import { type PropsWithChildren } from 'react'
import { PromiseCacheContext } from './contexts'
import type { PromiseCache } from './PromiseCache'

type PromiseCacheProviderProps = PropsWithChildren<{ cache: PromiseCache }>

/**
* @experimental This is experimental feature.
*/
export const PromiseCacheProvider = ({ cache, children }: PromiseCacheProviderProps) => (
<PromiseCacheContext.Provider value={cache}>{children}</PromiseCacheContext.Provider>
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the implementation reflecting the review from #1066 (comment)

Copy link

codspeed-hq bot commented Jul 13, 2024

CodSpeed Performance Report

Merging #1074 will create unknown performance changes

Comparing SEOKKAMONI:feat/promise (39babc9) with main (7eb9e9b)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.

@codecov-commenter
Copy link

codecov-commenter commented Jul 13, 2024

Codecov Report

Attention: Patch coverage is 94.17476% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.77%. Comparing base (7eb9e9b) to head (39babc9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1074      +/-   ##
==========================================
+ Coverage   84.23%   85.77%   +1.54%     
==========================================
  Files          54       63       +9     
  Lines         552      654     +102     
  Branches      117      141      +24     
==========================================
+ Hits          465      561      +96     
- Misses         82       87       +5     
- Partials        5        6       +1     
Components Coverage Δ
@suspensive/react 97.05% <ø> (ø)
@suspensive/react-query 75.28% <ø> (ø)
@suspensive/react-query-4 0.00% <ø> (ø)
@suspensive/react-query-5 0.00% <ø> (ø)
@suspensive/jotai 0.00% <ø> (ø)
@suspensive/promise 94.17% <94.17%> (-5.83%) ⬇️
@suspensive/react-await 100.00% <ø> (ø)
@suspensive/react-image 80.39% <ø> (ø)

@SEOKKAMONI SEOKKAMONI marked this pull request as ready for review July 13, 2024 13:27
@SEOKKAMONI SEOKKAMONI changed the title (WIP) feat(promise): add @suspensive/promise package feat(promise): add @suspensive/promise package Jul 13, 2024
@SEOKKAMONI SEOKKAMONI marked this pull request as draft July 13, 2024 13:28
@SEOKKAMONI SEOKKAMONI marked this pull request as ready for review July 13, 2024 13:32
Co-authored-by: Jonghyeon Ko <61593290+manudeli@users.noreply.github.com>
packages/promise/src/index.ts Outdated Show resolved Hide resolved
@manudeli manudeli changed the title feat(promise): add @suspensive/promise package feat(promise): add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache, PromiseCacheProvider, usePromiseCache Jul 13, 2024
@manudeli
Copy link
Member

@SEOKKAMONI Could you resolve eslint error

@manudeli manudeli merged commit 32bd5ab into toss:main Jul 13, 2024
14 checks passed
manudeli pushed a commit that referenced this pull request Jul 13, 2024
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 main, this PR will
be updated.


# Releases
## @suspensive/promise@0.1.0

### Minor Changes

- [#1074](#1074)
[`32bd5ab`](32bd5ab)
Thanks [@SEOKKAMONI](https://github.com/SEOKKAMONI)! - feat(promise):
add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
manudeli added a commit that referenced this pull request Aug 3, 2024
…s, PromiseCache, PromiseCacheProvider, usePromiseCache (#1074)

related with #1076
close #1069

# Overview

- add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
<!--
    A clear and concise description of what this pr is about.
 -->

## 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>
manudeli added a commit that referenced this pull request Aug 3, 2024
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 main, this PR will
be updated.


# Releases
## @suspensive/promise@0.1.0

### Minor Changes

- [#1074](#1074)
[`32bd5ab`](32bd5ab)
Thanks [@SEOKKAMONI](https://github.com/SEOKKAMONI)! - feat(promise):
add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
manudeli pushed a commit that referenced this pull request Aug 3, 2024
…s, PromiseCache, PromiseCacheProvider, usePromiseCache (#1074)

related with #1076
close #1069

# Overview

- add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
<!--
    A clear and concise description of what this pr is about.
 -->

## 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.

---------
manudeli added a commit that referenced this pull request Aug 3, 2024
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 main, this PR will
be updated.


# Releases
## @suspensive/promise@0.1.0

### Minor Changes

- [#1074](#1074)
[`32bd5ab`](32bd5ab)
Thanks [@SEOKKAMONI](https://github.com/SEOKKAMONI)! - feat(promise):
add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
manudeli added a commit that referenced this pull request Aug 3, 2024
…s, PromiseCache, PromiseCacheProvider, usePromiseCache (#1074)

related with #1076
close #1069

# Overview

- add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
<!--
    A clear and concise description of what this pr is about.
 -->

## 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>
manudeli added a commit that referenced this pull request Aug 3, 2024
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 main, this PR will
be updated.


# Releases
## @suspensive/promise@0.1.0

### Minor Changes

- [#1074](#1074)
[`32bd5ab`](32bd5ab)
Thanks [@SEOKKAMONI](https://github.com/SEOKKAMONI)! - feat(promise):
add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
manudeli added a commit that referenced this pull request Aug 3, 2024
…s, PromiseCache, PromiseCacheProvider, usePromiseCache (#1074)

related with #1076
close #1069

# Overview

- add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
<!--
    A clear and concise description of what this pr is about.
 -->

## 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>
manudeli added a commit that referenced this pull request Aug 3, 2024
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 main, this PR will
be updated.


# Releases
## @suspensive/promise@0.1.0

### Minor Changes

- [#1074](#1074)
[`32bd5ab`](32bd5ab)
Thanks [@SEOKKAMONI](https://github.com/SEOKKAMONI)! - feat(promise):
add SuspensePromise, useSuspensePromise, promiseOptions, PromiseCache,
PromiseCacheProvider, usePromiseCache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants