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

v3 #1423

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

v3 #1423

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/fresh-comics-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@suspensive/react-query-4": major
"@suspensive/react-query-5": major
"@suspensive/react-query": major
"@suspensive/react": major
---

feat(v3): remove deprecated interfaces
23 changes: 23 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@suspensive/eslint-config": "0.0.0",
"@suspensive/tsconfig": "0.0.0-development",
"@suspensive/tsup": "0.0.0",
"@suspensive/suspensive.org": "0.0.0",
"@suspensive/next-streaming-react-query": "0.0.0",
"@suspensive/react-native-playground": "0.0.0",
"@suspensive/visualization": "0.0.0",
"@suspensive/vite-react-18-suspense-prerender-siblings-problem": "0.0.0",
"@suspensive/codemods": "0.2.0",
"@suspensive/jotai": "2.18.12",
"@suspensive/react": "2.18.12",
"@suspensive/react-dom": "0.2.1",
"@suspensive/react-native": "0.0.17",
"@suspensive/react-query": "2.18.12",
"@suspensive/react-query-4": "2.18.12",
"@suspensive/react-query-5": "2.18.12"
},
"changesets": []
}
5 changes: 5 additions & 0 deletions .changeset/pretty-brooms-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suspensive/react": minor
---

feat(react): prevent recursive expose fallback when fallback throw error
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main, beta, v1, v2]
branches: [main, beta, next, v1, v2, v3]
pull_request:
types: [opened, synchronize, reopened]
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Changesets PR or Publish

on:
push:
branches: [main, beta]
branches: [main, beta, next, v1, v2, v3]

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions examples/visualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"next": "catalog:",
"react": "catalog:react19",
"react-dom": "catalog:react19",
"react-error-boundary": "^5.0.0",
"sharp": "catalog:",
"zod": "^3.24.1"
},
Expand Down
3 changes: 3 additions & 0 deletions examples/visualization/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<li>
<Link href="/react/ErrorBoundary/shouldCatch">{`<ErrorBoundary/>`} shouldCatch prop</Link>
</li>
<li>
<Link href="/react/ErrorBoundary/ErrorInFallback">{`<ErrorBoundary/>`}'s fallback Error</Link>
</li>
<li>
<Link href="/react/ErrorBoundary/shouldCatch/renderPhase">
{`<ErrorBoundary/>`} shouldCatch prop render phase
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
'use client'

import { ErrorBoundary as SuspensiveErrorBoundary } from '@suspensive/react'
import { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react'
import { ErrorBoundary as ReactErrorBoundary } from 'react-error-boundary'
import { Area } from '~/components/uis'

export const useTimeout = (fn: () => void, ms: number) => {
const fnRef = useRef(fn)
fnRef.current = fn
const fnPreserved = useCallback(() => fnRef.current(), [])
useEffect(() => {
const id = setTimeout(fnPreserved, ms)
return () => clearTimeout(id)
}, [fnPreserved, ms])
}

export 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}</>
},
}

export default function Page() {
return (
<div>
<Area title="@suspensive/react">
<SuspensiveErrorBoundary fallback={() => <>This is expected</>}>
<SuspensiveErrorBoundary
fallback={() => {
console.log("@suspensive/react's ErrorBoundary fallback")
return (
<Throw.Error message={'error message in fallback'} after={1000}>
SuspensiveErrorBoundary's fallback before error
</Throw.Error>
)
}}
>
<Throw.Error message={'error message in children'} after={1000}>
SuspensiveErrorBoundary's children before error
</Throw.Error>
</SuspensiveErrorBoundary>
</SuspensiveErrorBoundary>
</Area>

<Area title="react-error-boundary">
<ReactErrorBoundary fallbackRender={() => <>This is expected</>}>
<ReactErrorBoundary
fallbackRender={() => {
console.log("react-error-boundary's ErrorBoundary fallback")
return (
<Throw.Error message={'error message in fallback'} after={1000}>
ReactErrorBoundary's fallback before error
</Throw.Error>
)
}}
>
<Throw.Error message={'error message in children'} after={1000}>
ReactErrorBoundary's children before error
</Throw.Error>
</ReactErrorBoundary>
</ReactErrorBoundary>
</Area>
</div>
)
}
4 changes: 2 additions & 2 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"entry": ["src/**/*.{ts,tsx,mdx}"]
},
"packages/react-query-4": {
"ignoreDependencies": ["@suspensive/react", "@tanstack/react-query"]
"ignoreDependencies": ["@tanstack/react-query"]
},
"packages/react-query-5": {
"ignoreDependencies": ["@suspensive/react", "@tanstack/react-query"]
"ignoreDependencies": ["@tanstack/react-query"]
},
"packages/react-native": {
"ignoreDependencies": ["ts-node"],
Expand Down
5 changes: 0 additions & 5 deletions packages/react-query-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,17 @@
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@suspensive/react": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@tanstack/react-query": "catalog:react-query4",
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.12",
"@tanstack/react-query": "^4",
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
"optional": true
},
"@tanstack/react-query": {
"optional": true
}
Expand Down
36 changes: 0 additions & 36 deletions packages/react-query-4/src/QueryErrorBoundary.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-query-4/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ export { PrefetchQuery } from './PrefetchQuery'
export { PrefetchInfiniteQuery } from './PrefetchInfiniteQuery'
export { Mutation } from './Mutation'
export { QueryClientConsumer } from './QueryClientConsumer'
export { QueryErrorBoundary } from './QueryErrorBoundary'
5 changes: 0 additions & 5 deletions packages/react-query-5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,17 @@
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@suspensive/react": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@tanstack/react-query": "catalog:react-query5",
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.12",
"@tanstack/react-query": "^5",
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
"optional": true
},
"@tanstack/react-query": {
"optional": true
}
Expand Down
36 changes: 0 additions & 36 deletions packages/react-query-5/src/QueryErrorBoundary.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-query-5/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ export { PrefetchQuery } from './PrefetchQuery'
export { PrefetchInfiniteQuery } from './PrefetchInfiniteQuery'
export { Mutation } from './Mutation'
export { QueryClientConsumer } from './QueryClientConsumer'
export { QueryErrorBoundary } from './QueryErrorBoundary'
7 changes: 0 additions & 7 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,15 @@
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@suspensive/react": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.12",
"@tanstack/react-query": "^4 || ^5",
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
"optional": true
}
},
"publishConfig": {
"access": "public"
}
Expand Down
1 change: 0 additions & 1 deletion packages/react-query/src/bin/utils/package.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const version4APIs = [
'SuspenseQuery',
'SuspenseQueries',
'SuspenseInfiniteQuery',
'QueryErrorBoundary',
'QueryClientConsumer',
'PrefetchQuery',
'PrefetchInfiniteQuery',
Expand Down
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react19",
"react": "catalog:react19"
"react": "catalog:react19",
"react-error-boundary": "^5.0.0"
},
"peerDependencies": {
"react": "^18 || ^19"
Expand Down
23 changes: 0 additions & 23 deletions packages/react/src/DevMode.spec.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions packages/react/src/DevMode.tsx

This file was deleted.

Loading
Loading