From 824165fd463efc1874db3851708b8c586387f225 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Thu, 19 Oct 2023 01:45:57 +0900 Subject: [PATCH] chore: version packages (#235) * 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 Co-authored-by: Chanhyuk Park Co-authored-by: Minsoo Kim --------- Co-authored-by: Jonghyeon Ko Co-authored-by: Chanhyuk Park Co-authored-by: Minsoo Kim --- docs/src/pages/docs/react/ErrorBoundary.en.mdx | 2 +- docs/src/pages/docs/react/ErrorBoundary.ko.mdx | 2 +- packages/react-query/CHANGELOG.md | 7 +++++++ packages/react-query/package.json | 4 ++-- packages/react/CHANGELOG.md | 6 ++++++ packages/react/package.json | 2 +- packages/react/src/AsyncBoundary.tsx | 5 ++--- packages/react/src/Delay.tsx | 4 ++-- packages/react/src/ErrorBoundary.tsx | 2 +- packages/react/src/ErrorBoundaryGroup.tsx | 3 +-- packages/react/src/Suspense.tsx | 5 +++-- packages/react/src/experimental/Await.tsx | 2 +- packages/react/src/experimental/index.ts | 2 ++ packages/react/src/index.ts | 6 +++++- pnpm-lock.yaml | 4 ++-- websites/visualization/package.json | 4 ++-- 16 files changed, 39 insertions(+), 21 deletions(-) diff --git a/docs/src/pages/docs/react/ErrorBoundary.en.mdx b/docs/src/pages/docs/react/ErrorBoundary.en.mdx index 4cda1f523..0ec525c9b 100644 --- a/docs/src/pages/docs/react/ErrorBoundary.en.mdx +++ b/docs/src/pages/docs/react/ErrorBoundary.en.mdx @@ -122,7 +122,7 @@ const Example = () => { return ( <> - diff --git a/docs/src/pages/docs/react/ErrorBoundary.ko.mdx b/docs/src/pages/docs/react/ErrorBoundary.ko.mdx index 3505ae2e9..33a4835af 100644 --- a/docs/src/pages/docs/react/ErrorBoundary.ko.mdx +++ b/docs/src/pages/docs/react/ErrorBoundary.ko.mdx @@ -122,7 +122,7 @@ const Example = () => { return ( <> - diff --git a/packages/react-query/CHANGELOG.md b/packages/react-query/CHANGELOG.md index afb9e1624..ee53553aa 100644 --- a/packages/react-query/CHANGELOG.md +++ b/packages/react-query/CHANGELOG.md @@ -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 diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 5ba2a8537..9d553cac7 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -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", @@ -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" }, diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 27a94b183..23ad285a3 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -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 diff --git a/packages/react/package.json b/packages/react/package.json index da882e277..8983577da 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/react", - "version": "1.16.1", + "version": "1.17.0", "description": "Useful interfaces for React Suspense", "keywords": [ "suspensive", diff --git a/packages/react/src/AsyncBoundary.tsx b/packages/react/src/AsyncBoundary.tsx index cb8a73b45..afb656797 100644 --- a/packages/react/src/AsyncBoundary.tsx +++ b/packages/react/src/AsyncBoundary.tsx @@ -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 -type AsyncBoundaryProps = Omit & +export type AsyncBoundaryProps = Omit & Omit & { pendingFallback?: SuspenseProps['fallback'] rejectedFallback: ErrorBoundaryProps['fallback'] @@ -45,7 +45,6 @@ export const AsyncBoundary = BaseAsyncBoundary as typeof BaseAsyncBoundary & { } AsyncBoundary.CSROnly = CSROnlyAsyncBoundary -// HOC export const withAsyncBoundary = = Record>( Component: ComponentType, asyncBoundaryProps: PropsWithoutChildren diff --git a/packages/react/src/Delay.tsx b/packages/react/src/Delay.tsx index 3acf3c8f5..12158de14 100644 --- a/packages/react/src/Delay.tsx +++ b/packages/react/src/Delay.tsx @@ -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 @@ -16,7 +17,6 @@ export const Delay = ({ ms, children }: DelayProps) => { export const DelayContext = createContext>({ ms: 0 }) -// HOC export const withDelay = = Record>( Component: ComponentType, delayProps?: PropsWithoutChildren diff --git a/packages/react/src/ErrorBoundary.tsx b/packages/react/src/ErrorBoundary.tsx index 26a5aff8f..ddcaa6db7 100644 --- a/packages/react/src/ErrorBoundary.tsx +++ b/packages/react/src/ErrorBoundary.tsx @@ -25,7 +25,7 @@ export type ErrorBoundaryFallbackProps = { 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 */ diff --git a/packages/react/src/ErrorBoundaryGroup.tsx b/packages/react/src/ErrorBoundaryGroup.tsx index a93d279d4..7ed83c57b 100644 --- a/packages/react/src/ErrorBoundaryGroup.tsx +++ b/packages/react/src/ErrorBoundaryGroup.tsx @@ -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 @@ -67,7 +67,6 @@ export const useErrorBoundaryGroup = () => { ) } -// HOC export const withErrorBoundaryGroup = = Record>( Component: ComponentType, errorBoundaryGroupProps?: PropsWithoutChildren diff --git a/packages/react/src/Suspense.tsx b/packages/react/src/Suspense.tsx index 42894b202..81dda5649 100644 --- a/packages/react/src/Suspense.tsx +++ b/packages/react/src/Suspense.tsx @@ -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>({ fallback: undefined }) const useFallbackWithContext = (fallback: ReactNode) => { const contextFallback = useContext(SuspenseContext).fallback @@ -41,7 +43,6 @@ export const Suspense = DefaultSuspense as typeof DefaultSuspense & { } Suspense.CSROnly = CSROnlySuspense -// HOC export function withSuspense = Record>( Component: ComponentType, suspenseProps?: PropsWithoutChildren diff --git a/packages/react/src/experimental/Await.tsx b/packages/react/src/experimental/Await.tsx index 949a8a71d..b3cb238cb 100644 --- a/packages/react/src/experimental/Await.tsx +++ b/packages/react/src/experimental/Await.tsx @@ -47,7 +47,7 @@ export const useAwait = (options: AwaitOptions = { +export type AwaitProps = { options: AwaitOptions children: FunctionComponent> } diff --git a/packages/react/src/experimental/index.ts b/packages/react/src/experimental/index.ts index 165ff7e4e..733cc5fcd 100644 --- a/packages/react/src/experimental/index.ts +++ b/packages/react/src/experimental/index.ts @@ -1 +1,3 @@ export { Await, useAwait, awaitClient } from './Await' + +export type { AwaitProps } from './Await' diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 15b11505d..dfe975c9f 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -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' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59d042143..457f14574 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,10 +289,10 @@ importers: specifier: ^1.3.9 version: 1.3.9(@emotion/react@11.11.0)(react@18.2.0) '@suspensive/react': - specifier: workspace:1.16.1 + specifier: workspace:1.17.0 version: link:../../packages/react '@suspensive/react-query': - specifier: workspace:1.16.1 + specifier: workspace:1.17.0 version: link:../../packages/react-query '@tanstack/react-query': specifier: ^4.29.5 diff --git a/websites/visualization/package.json b/websites/visualization/package.json index 48d897a83..4a09d6b2b 100644 --- a/websites/visualization/package.json +++ b/websites/visualization/package.json @@ -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",