Skip to content

Commit

Permalink
chore: version packages (#235)
Browse files Browse the repository at this point in the history
* chore(docs): banner

* feat(react): add all props type of all components (#196)

* feat(react): add all props type

* Create quiet-squids-shop.md

* chore(.vscode): update organizeImports

* docs(react): update

* chore(.vscode): update settings.json

* chore: version packages

Co-authored-by: Jonghyeon Ko <[email protected]>
Co-authored-by: Chanhyuk Park <[email protected]>
Co-authored-by: Minsoo Kim <[email protected]>

---------

Co-authored-by: Jonghyeon Ko <[email protected]>
Co-authored-by: Chanhyuk Park <[email protected]>
Co-authored-by: Minsoo Kim <[email protected]>
  • Loading branch information
4 people committed Oct 18, 2023
1 parent 028d233 commit 824165f
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/docs/react/ErrorBoundary.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Example = () => {

return (
<>
<button onClick={() => setResetKey((prev) => prev + 1)} />
<button onClick={() => setResetKey((prev) => prev + 1)}>Try again</button>
<ErrorBoundary resetKeys={[resetKey]}>
<ErrorAfter4s />
</ErrorBoundary>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/react/ErrorBoundary.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Example = () => {

return (
<>
<button onClick={() => setResetKey((prev) => prev + 1)} />
<button onClick={() => setResetKey((prev) => prev + 1)}>Try again</button>
<ErrorBoundary resetKeys={[resetKey]}>
<ErrorAfter4s />
</ErrorBoundary>
Expand Down
7 changes: 7 additions & 0 deletions packages/react-query/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @suspensive/react-query

## 1.17.0

### Patch Changes

- Updated dependencies [8ded1b2]
- @suspensive/react@1.17.0

## 1.16.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@suspensive/react-query",
"version": "1.16.1",
"version": "1.17.0",
"description": "Useful helpers for @tanstack/react-query with suspense",
"keywords": [
"suspensive",
Expand Down Expand Up @@ -69,7 +69,7 @@
"tsd": "^0.28.1"
},
"peerDependencies": {
"@suspensive/react": "workspace:^1.16.1",
"@suspensive/react": "workspace:^1.17.0",
"@tanstack/react-query": "^4",
"react": "^16.8 || ^17 || ^18"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @suspensive/react

## 1.17.0

### Minor Changes

- 8ded1b2: feat(react): add all props type of all components

## 1.16.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@suspensive/react",
"version": "1.16.1",
"version": "1.17.0",
"description": "Useful interfaces for React Suspense",
"keywords": [
"suspensive",
Expand Down
5 changes: 2 additions & 3 deletions packages/react/src/AsyncBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ComponentProps, ComponentRef, ComponentType, SuspenseProps } from 'react'
import { forwardRef } from 'react'
import { ErrorBoundary } from './ErrorBoundary'
import type { ErrorBoundaryProps } from './ErrorBoundary'
import { Suspense } from './Suspense'
import type { PropsWithoutChildren } from './types'

type ErrorBoundaryProps = ComponentProps<typeof ErrorBoundary>
type AsyncBoundaryProps = Omit<SuspenseProps, 'fallback'> &
export type AsyncBoundaryProps = Omit<SuspenseProps, 'fallback'> &
Omit<ErrorBoundaryProps, 'fallback'> & {
pendingFallback?: SuspenseProps['fallback']
rejectedFallback: ErrorBoundaryProps['fallback']
Expand Down Expand Up @@ -45,7 +45,6 @@ export const AsyncBoundary = BaseAsyncBoundary as typeof BaseAsyncBoundary & {
}
AsyncBoundary.CSROnly = CSROnlyAsyncBoundary

// HOC
export const withAsyncBoundary = <TProps extends ComponentProps<ComponentType> = Record<string, never>>(
Component: ComponentType<TProps>,
asyncBoundaryProps: PropsWithoutChildren<AsyncBoundaryProps>
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Delay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { createContext, useContext, useState } from 'react'
import { useSetTimeout } from './hooks'
import type { PropsWithoutChildren } from './types'

type DelayProps = PropsWithChildren<{
export type DelayProps = PropsWithChildren<{
ms?: number
}>

export const Delay = ({ ms, children }: DelayProps) => {
const delayContextValue = useContext(DelayContext)
const delayMs = ms ?? delayContextValue.ms ?? 0
Expand All @@ -16,7 +17,6 @@ export const Delay = ({ ms, children }: DelayProps) => {

export const DelayContext = createContext<PropsWithoutChildren<DelayProps>>({ ms: 0 })

// HOC
export const withDelay = <TProps extends ComponentProps<ComponentType> = Record<string, never>>(
Component: ComponentType<TProps>,
delayProps?: PropsWithoutChildren<DelayProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type ErrorBoundaryFallbackProps<TError extends Error = Error> = {
reset: () => void
}

type ErrorBoundaryProps = PropsWithChildren<{
export type ErrorBoundaryProps = PropsWithChildren<{
/**
* an array of elements for the ErrorBoundary to check each render. If any of those elements change between renders, then the ErrorBoundary will reset the state which will re-render the children
*/
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/ErrorBoundaryGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (process.env.NODE_ENV !== 'production') {
ErrorBoundaryGroupContext.displayName = 'ErrorBoundaryGroupContext'
}

type ErrorBoundaryGroupProps = PropsWithChildren<{
export type ErrorBoundaryGroupProps = PropsWithChildren<{
/**
* If you use blockOutside as true, ErrorBoundaryGroup will protect multiple ErrorBoundaries as its children from external ErrorBoundaryGroup's resetKey
* @default false
Expand Down Expand Up @@ -67,7 +67,6 @@ export const useErrorBoundaryGroup = () => {
)
}

// HOC
export const withErrorBoundaryGroup = <TProps extends ComponentProps<ComponentType> = Record<string, never>>(
Component: ComponentType<TProps>,
errorBoundaryGroupProps?: PropsWithoutChildren<ErrorBoundaryGroupProps>
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/Suspense.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { ComponentProps, ComponentType, ReactNode, SuspenseProps } from 'react'
import type { ComponentProps, ComponentType, ReactNode, SuspenseProps as ReactSuspenseProps } from 'react'
import { Suspense as ReactSuspense, createContext, useContext } from 'react'
import { useIsMounted } from './hooks'
import type { PropsWithoutChildren } from './types'

export type SuspenseProps = ReactSuspenseProps

export const SuspenseContext = createContext<PropsWithoutChildren<SuspenseProps>>({ fallback: undefined })
const useFallbackWithContext = (fallback: ReactNode) => {
const contextFallback = useContext(SuspenseContext).fallback
Expand Down Expand Up @@ -41,7 +43,6 @@ export const Suspense = DefaultSuspense as typeof DefaultSuspense & {
}
Suspense.CSROnly = CSROnlySuspense

// HOC
export function withSuspense<TProps extends ComponentProps<ComponentType> = Record<string, never>>(
Component: ComponentType<TProps>,
suspenseProps?: PropsWithoutChildren<SuspenseProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/experimental/Await.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const useAwait = <TData, TKey extends Key>(options: AwaitOptions<TData, T
)
}

type AwaitProps<TData, TKey extends Key> = {
export type AwaitProps<TData, TKey extends Key> = {
options: AwaitOptions<TData, TKey>
children: FunctionComponent<Awaited<TData>>
}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/experimental/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { Await, useAwait, awaitClient } from './Await'

export type { AwaitProps } from './Await'
6 changes: 5 additions & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ export { ErrorBoundaryGroup, withErrorBoundaryGroup, useErrorBoundaryGroup } fro
export { AsyncBoundary, withAsyncBoundary } from './AsyncBoundary'
export { Delay, withDelay } from './Delay'

export type { ErrorBoundaryFallbackProps } from './ErrorBoundary'
export type { SuspenseProps } from './Suspense'
export type { ErrorBoundaryProps, ErrorBoundaryFallbackProps } from './ErrorBoundary'
export type { ErrorBoundaryGroupProps } from './ErrorBoundaryGroup'
export type { AsyncBoundaryProps } from './AsyncBoundary'
export type { DelayProps } from './Delay'
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions websites/visualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"@emotion/react": "^11.10.8",
"@emotion/styled": "^11.10.8",
"@jsxcss/emotion": "^1.3.9",
"@suspensive/react": "workspace:1.16.1",
"@suspensive/react-query": "workspace:1.16.1",
"@suspensive/react": "workspace:1.17.0",
"@suspensive/react-query": "workspace:1.17.0",
"@tanstack/react-query": "^4.29.5",
"@tanstack/react-query-devtools": "^4.29.5",
"axios": "^1.4.0",
Expand Down

0 comments on commit 824165f

Please sign in to comment.