Skip to content

Commit

Permalink
docs(suspensive.org): update switch section
Browse files Browse the repository at this point in the history
  • Loading branch information
gwansikk committed Jul 22, 2024
1 parent af02d32 commit 81c5fdc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,30 @@ For instance, if using @suspensive/react-query@2.9.0 and @tanstack/react-query@5
├─────────────────────────┼─────────────────────────────────┼────────┼────────────────────────────────────────────────────────┤
│ peerDependency │ @tanstack/react-query@5 │ 🟢 │ The versions are compatible. │
├─────────────────────────┼─────────────────────────────────┼────────┼────────────────────────────────────────────────────────┤
│ You can use │ <SuspenseQuery/> │ 🟢 │ For more detailed information about the provided APIs, │
│ │ <SuspenseQueries/> │ │ please visit the official documentation: │
│ │ <SuspenseInfiniteQuery/> │ │ https://suspensive.org/docs/react-query/motivation │
│ │ <Mutation/> │ │ │
│ │ <QueryErrorBoundary/> │ │ │
│ You can use │ SuspenseQuery │ 🟢 │ For more detailed information about the provided APIs, │
│ │ SuspenseQueries │ │ please visit the official documentation: │
│ │ SuspenseInfiniteQuery │ │ https://suspensive.org/docs/react-query/motivation │
│ │ Mutation │ │ │
│ │ QueryErrorBoundary │ │ │
└─────────────────────────┴─────────────────────────────────┴────────┴────────────────────────────────────────────────────────┘
```

### switch

Switches to a different version of the @suspensive/react-query interface based on the @tanstack/react-query version. Use caution as this can force a change that may not be compatible with your current setup.
Updating the entry file (dist/index.js) of @suspensive/react-query. This will switch to the specified version of the @suspensive/react-query interface.

For example, to switch to the interface compatible with @tanstack/react-query v5.
```typescript
// dist/index.js of @suspensive/react-query

// When you use "npx suspensive-react-query switch 4"
// @suspensive/react-query's dist/index.js
export * from '@suspensive/react-query-4' // Suspensive interfaces for @tanstack/react-query@4
// When you use "npx suspensive-react-query switch 5"
// @suspensive/react-query's dist/index.js
export * from '@suspensive/react-query-5' // Suspensive interfaces for @tanstack/react-query@5
```

If you are using @tanstack/react-query v5 and encounter errors, you can update the entry file (dist/index.js) and switch to the compatible interface by using the following command:

```bash
npx suspensive-react-query switch 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,30 @@ status로 호환 상태를 확인할 수 있으며, You can use 항목에서 현
├─────────────────────────┼─────────────────────────────────┼────────┼────────────────────────────────────────────────────────┤
│ peerDependency │ @tanstack/react-query@5 │ 🟢 │ The versions are compatible. │
├─────────────────────────┼─────────────────────────────────┼────────┼────────────────────────────────────────────────────────┤
│ You can use │ <SuspenseQuery/> │ 🟢 │ For more detailed information about the provided APIs, │
│ │ <SuspenseQueries/> │ │ please visit the official documentation: │
│ │ <SuspenseInfiniteQuery/> │ │ https://suspensive.org/docs/react-query/motivation │
│ │ <Mutation/> │ │ │
│ │ <QueryErrorBoundary/> │ │ │
│ You can use │ SuspenseQuery │ 🟢 │ For more detailed information about the provided APIs, │
│ │ SuspenseQueries │ │ please visit the official documentation: │
│ │ SuspenseInfiniteQuery │ │ https://suspensive.org/docs/react-query/motivation │
│ │ Mutation │ │ │
│ │ QueryErrorBoundary │ │ │
└─────────────────────────┴─────────────────────────────────┴────────┴────────────────────────────────────────────────────────┘
```

### switch

@tanstack/react-query 버전에 따라 사용할 수 있는 @susepensive/react-query의 인터페이스를 다른 버전의 인터페이스로 전환할 수 있습니다. 이는 현재 설치된 환경의 호환과 맞지 않게 강제로 변경될 수 있으며 주의가 필요합니다.
@suspensive/react-query의 엔트리 파일(dist/index.js)을 업데이트합니다. 이는 지정한 버전의 @suspensive/react-query 인터페이스로 전환됩니다.

예를 들어, @tanstack/react-query v5를 사용하고 있는데 오류가 발생하면, 다음 명령어를 사용하여 호환되는 인터페이스로 전환할 수 있습니다.
```typescript
// dist/index.js of @suspensive/react-query

// "npx suspensive-react-query switch 4"를 사용할 때
// @suspensive/react-query의 dist/index.js
export * from '@suspensive/react-query-4' // @tanstack/react-query@4용 Suspensive 인터페이스
// "npx suspensive-react-query switch 5"를 사용할 때
// @suspensive/react-query의 dist/index.js
export * from '@suspensive/react-query-5' // @tanstack/react-query@5용 Suspensive 인터페이스
```

@tanstack/react-query v5를 사용하고 있는데 오류가 발생하면, 다음 명령어를 사용하여 엔트리 파일(dist/index.js)을 업데이트하여 호환되는 인터페이스로 전환할 수 있습니다.

```bash
npx suspensive-react-query switch 5
Expand Down

0 comments on commit 81c5fdc

Please sign in to comment.