@uiwwsw/react-query-helper 1.3.0 โ 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +110 -360
- package/README_EN.md +168 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +681 -2081
- package/dist/config-loader.d.ts +10 -6
- package/dist/config-loader.js +201 -0
- package/dist/config.d.ts +2 -3
- package/dist/core/analyzer.d.ts +3 -1
- package/dist/core/analyzer.js +109 -55
- package/dist/core/generator.d.ts +4 -3
- package/dist/core/generator.js +97 -85
- package/dist/index.d.ts +2 -3
- package/dist/index.js +98 -91
- package/dist/utils/query.d.ts +59 -50
- package/package.json +29 -21
- package/dist/cli.d.ts.map +0 -1
- package/dist/config-loader.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/core/analyzer.d.ts.map +0 -1
- package/dist/core/generator.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/query.d.ts.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
The v2.0.0 tag was not published to npm. This release includes all of the 2.0.0
|
|
6
|
+
changes below, including the breaking changes for applications upgrading from 1.x.
|
|
7
|
+
|
|
8
|
+
- Simplify Korean/English onboarding and move detailed configuration and recipes into reference guides.
|
|
9
|
+
- Introduce the Q symbol, light/dark README banners, and documented brand assets.
|
|
10
|
+
- Add regression tests for documentation links, SVG assets, and generated/typechecked README examples.
|
|
11
|
+
- Refresh release guidance and source-install examples for 2.0.1.
|
|
12
|
+
|
|
13
|
+
## 2.0.0
|
|
14
|
+
|
|
15
|
+
### Breaking Changes
|
|
16
|
+
|
|
17
|
+
- Require TanStack Query >=5.102.8 <6. Node 22 remains the minimum CLI runtime.
|
|
18
|
+
- Generated path keys now include filenames. Query/infinite keys use separate kind segments and nested argument tuples. Invalidate persisted 1.x caches and update manually constructed keys.
|
|
19
|
+
- Remove forced infinite cache/stale times and disabled focus refetching. QueryClient defaults now apply.
|
|
20
|
+
- Single-array mutation payloads are passed intact. Direct multi-argument helpers require an explicit mapper or tuple mode.
|
|
21
|
+
- Refuse to overwrite output without this generator's ownership marker. Move legacy generated files aside and regenerate.
|
|
22
|
+
- Built-in generation rejects private imports, invalid identifiers, duplicate names and invalid configuration.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Starter configs no longer reference missing plugins or assume an application alias.
|
|
27
|
+
- Correct InfiniteData, pageParam, select, default error, cache data-tag and optimistic rollback inference.
|
|
28
|
+
- Forward query/mutation context, including QueryClient and AbortSignal, to custom callbacks.
|
|
29
|
+
- Convert synchronous callback failures to rejected promises.
|
|
30
|
+
- Support default/local alias exports, skip ambient declarations and duplicate overload signatures.
|
|
31
|
+
- Preserve optional multi-argument mutation fields and handle rest/destructured parameters using tuples.
|
|
32
|
+
- Include source filenames in cache prefixes and avoid unused/colliding helper imports.
|
|
33
|
+
- Honor empty artifact lists and provide per-function artifact selection.
|
|
34
|
+
- Load TypeScript/CommonJS configs and plugins with relative imports through Jiti; validate options and plugin contracts.
|
|
35
|
+
- Exclude output directories from source scans; support standard ignore globs; detect symlink and output collisions.
|
|
36
|
+
- Reconcile only owned stale files after a successful analysis, avoid unchanged writes, serialize watch passes and recover after errors.
|
|
37
|
+
- Wait for watcher readiness and reconcile startup edits before announcing that watch is active.
|
|
38
|
+
- Report generation failures with nonzero exit codes; add explicit config selection and read-only output checks.
|
|
39
|
+
|
|
40
|
+
### Maintenance
|
|
41
|
+
|
|
42
|
+
- Replace the Bun-only build with a Node/esbuild build; preserve a browser-safe runtime and NodeNext-compatible declarations.
|
|
43
|
+
- Use one npm lockfile; remove obsolete scripts, the fs placeholder dependency and Bun ambient types.
|
|
44
|
+
- Add runtime, CLI, emitted-code, type-inference and installed-package tests.
|
|
45
|
+
- Add Node 22/24 CI and pre-publish tests, consumer checks, tag/version validation and provenance.
|
|
46
|
+
- Rewrite Korean/English documentation with usage, limitations and migration steps.
|
package/README.md
CHANGED
|
@@ -1,418 +1,168 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/uiwwsw/react-query-helper/main/assets/readme-hero-dark.svg" />
|
|
4
|
+
<img src="https://raw.githubusercontent.com/uiwwsw/react-query-helper/main/assets/readme-hero.svg" alt="React Query Helper: Your API. Query-ready. TypeScript in, reusable options out." width="1120" />
|
|
5
|
+
</picture>
|
|
3
6
|
</p>
|
|
4
7
|
|
|
5
8
|
<h1 align="center">React Query Helper</h1>
|
|
6
9
|
|
|
7
10
|
<p align="center">
|
|
8
|
-
|
|
11
|
+
API ํจ์๋ ๊ทธ๋๋ก. ๋ฐ๋ณต๋๋ ์ฟผ๋ฆฌ ์ค์ ์ ์์ฑํ์ธ์.<br />
|
|
12
|
+
TypeScript ํจ์์์ TanStack Query v5์ ํ์
์์ ํ ์ต์
ํฉํ ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค.
|
|
9
13
|
</p>
|
|
10
14
|
|
|
11
15
|
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@uiwwsw/react-query-helper"><img src="https://img.shields.io/npm/v
|
|
13
|
-
<a href="https://
|
|
14
|
-
<a href="https://
|
|
15
|
-
<a href="https://github.com/uiwwsw/react-query-helper/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-10b981.svg" alt="license" /></a>
|
|
16
|
-
<a href="https://www.npmjs.com/package/@uiwwsw/react-query-helper"><img src="https://img.shields.io/npm/types/@uiwwsw/react-query-helper.svg?color=3178c6" alt="types" /></a>
|
|
17
|
-
</p>
|
|
18
|
-
<p align="center">
|
|
19
|
-
<a href="https://github.com/uiwwsw/react-query-helper"><img src="https://img.shields.io/github/stars/uiwwsw/react-query-helper?style=social" alt="github stars" /></a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@uiwwsw/react-query-helper"><img src="https://img.shields.io/npm/v/%40uiwwsw%2Freact-query-helper?style=flat-square&label=npm&color=133c35" alt="Published npm version" /></a>
|
|
17
|
+
<a href="https://github.com/uiwwsw/react-query-helper/actions/workflows/ci.yml"><img src="https://github.com/uiwwsw/react-query-helper/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI status on main" /></a>
|
|
18
|
+
<a href="https://github.com/uiwwsw/react-query-helper/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-f38466?style=flat-square" alt="MIT license" /></a>
|
|
20
19
|
</p>
|
|
20
|
+
|
|
21
21
|
<p align="center">
|
|
22
|
-
<
|
|
23
|
-
<
|
|
22
|
+
<a href="#quick-start">๋น ๋ฅธ ์์</a> ยท
|
|
23
|
+
<a href="https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md">์ค์ ๊ณผ ์์ </a> ยท
|
|
24
|
+
<a href="https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#1x์์-์ด์ ">1.x์์ ์ด์ </a> ยท
|
|
25
|
+
<a href="https://github.com/uiwwsw/react-query-helper/blob/main/README_EN.md">English</a>
|
|
24
26
|
</p>
|
|
25
27
|
|
|
26
|
-
>
|
|
27
|
-
|
|
28
|
-
๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ ํ์ผ์ `export`๋ ํจ์๋ง ์์ฑ ๋์์ผ๋ก ๋ถ์ํฉ๋๋ค.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## ๋ชฉ์ฐจ
|
|
33
|
-
|
|
34
|
-
- [์ฃผ์ ํน์ง](#์ฃผ์-ํน์ง)
|
|
35
|
-
- [๋น ๋ฅธ ์์](#๋น ๋ฅธ-์์)
|
|
36
|
-
- [์ค์น](#์ค์น)
|
|
37
|
-
- [์ด๊ธฐ ์ค์ ํ์ผ ์์ฑ](#์ด๊ธฐ-์ค์ -ํ์ผ-์์ฑ)
|
|
38
|
-
- [์ฝ๋ ์์ฑ ์คํ](#์ฝ๋-์์ฑ-์คํ)
|
|
39
|
-
- [CLI ๋ช
๋ น์ด](#cli-๋ช
๋ น์ด)
|
|
40
|
-
- [์ค์ ์ต์
](#์ค์ -์ต์
)
|
|
41
|
-
- [์์ฑ ๊ฒฐ๊ณผ ์์](#์์ฑ-๊ฒฐ๊ณผ-์์)
|
|
42
|
-
- [ํฌํผ ๊ฒฝ๋ก ์ปค์คํฐ๋ง์ด์ง](#ํฌํผ-๊ฒฝ๋ก-์ปค์คํฐ๋ง์ด์ง)
|
|
43
|
-
- [๋ฒ ์คํธ ํ๋ํฐ์ค](#๋ฒ ์คํธ-ํ๋ํฐ์ค)
|
|
44
|
-
- [์คํ ํ์คํ ๋ฆฌ](#์คํ-ํ์คํ ๋ฆฌ)
|
|
45
|
-
- [๊ธฐ์ฌ](#๊ธฐ์ฌ)
|
|
46
|
-
- [๋ผ์ด์ ์ค](#๋ผ์ด์ ์ค)
|
|
47
|
-
|
|
48
|
-
## ์ฃผ์ ํน์ง
|
|
49
|
-
|
|
50
|
-
- **์ค์ ๊ธฐ๋ฐ ์๋ํ**: `rqh.config.ts`๋ง ๊ตฌ์ฑํ๋ฉด API ๋๋ ํ ๋ฆฌ ๊ฐ์ง๋ถํฐ ์ถ๋ ฅ ๋๋ ํ ๋ฆฌ ์ง์ ๊น์ง ๋ชจ๋ ์๋ํ๋ฉ๋๋ค.
|
|
51
|
-
- **์ด๊ธฐํ ์ง์**: `react-query-helper --init`์ผ๋ก ๊ธฐ๋ณธ ์ค์ ํ์ผ์ ๋ฐ๋ก ์์ฑํ ์ ์์ต๋๋ค.
|
|
52
|
-
- **๋ฐํ์/๊ฐ๋ฐ ๋ถ๋ฆฌ**: generate/watch/config ๋ก๋ฉ์ ๊ฐ๋ฐ ์์ ์ ์ฉ์ด๊ณ , ์์ฑ๋ ๊ฒฐ๊ณผ๊ฐ ์ฐธ์กฐํ๋ ๋ฐํ์ helper ์ํธ๋ฆฌ์๋ `fs` ๊ฐ์ Node ์ ์ฉ ์ฝ๋๊ฐ ํฌํจ๋์ง ์๋๋ก ๋ถ๋ฆฌ๋์ด ์์ต๋๋ค.
|
|
53
|
-
- **Watch & Generate ๋ชจ๋**: ๊ฐ๋ฐ ์ค ์ค์๊ฐ ๊ฐ์(`--watch`), ์ด๊ธฐ ์ธํ
์ด๋ ์ฌ์์ฑ ์ ์ผ๊ด ์์ฑ(`--generate`)์ ๋ชจ๋ ์ง์ํฉ๋๋ค.
|
|
54
|
-
- **์ผ๊ด๋ ์ต์
๊ด๋ฆฌ**: `queryOption`, `mutationOption`, `infiniteOption` ์ ํธ๋ฆฌํฐ๋ก ์ ์ญ ์บ์ฑ ์ ๋ต๊ณผ ์๋ฌ ํธ๋ค๋ง์ ํต์ผํ ์ ์์ต๋๋ค.
|
|
55
|
-
- **๋ฐํ์ override ์ง์**: ์์ฑ๋ ์ต์
ํฉํ ๋ฆฌ์ `.withOptions(...)`๋ก ํค๋, queryKey, pageParam ๋งคํ, mutation ๋ณ์ ๋ณํ ๋ฑ์ ํธ์ถ๋ถ์์ ์์ ํ๊ฒ ์กฐ์ ํ ์ ์์ต๋๋ค.
|
|
56
|
-
- **Prettier ํตํฉ**: ์์ฑ๋ ํ์ผ์ ์๋์ผ๋ก ํฌ๋งทํ
๋์ด ์ฝ๋ ๋ฆฌ๋ทฐ ์ ๋ถํ์ํ ๋ณ๊ฒฝ์ ์ค์
๋๋ค.
|
|
57
|
-
- **ํฌํผ import ๊ฒฝ๋ก ์ปค์คํฐ๋ง์ด์ง**: `templateDir`๋ก ์์ฑ ์ฝ๋๊ฐ ์ฐธ์กฐํ ํฌํผ ๋ชจ๋ ๊ฒฝ๋ก๋ฅผ ๋ฐ๊ฟ ์ ์์ต๋๋ค.
|
|
58
|
-
- **์ค๋งํธ ์ํฐํฉํธ ์ถ๋ก **: ๊ธฐ๋ณธ๊ฐ์ผ๋ก ํจ์ ์ด๋ฆ์ ๋ณด๊ณ query / mutation / infinite ์์ฑ์ ๊ตฌ๋ถํด `createUserQueryOption` ๊ฐ์ ์ด์ํ ๊ฒฐ๊ณผ๋ฅผ ์ค์
๋๋ค.
|
|
59
|
-
- **๋ณด์์ ์ธ infinite ๊ธฐ๋ณธ๊ฐ**: `infiniteOption`์ ์์ ํ ๊ธฐ๋ณธ ์ต์
๋ง ์ ๊ณตํ๊ณ , ์ค์ `pageParam` ์ฒ๋ฆฌ ๊ท์น์ ํธ์ถ๋ถ์์ override ํ๋๋ก ์ค๊ณ๋์ด ์์ต๋๋ค.
|
|
60
|
-
|
|
61
|
-
## ๋น ๋ฅธ ์์
|
|
62
|
-
|
|
63
|
-
### ์ค์น
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
bun add @uiwwsw/react-query-helper
|
|
67
|
-
# ๋๋
|
|
68
|
-
npm install --save-dev @uiwwsw/react-query-helper
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### ์ด๊ธฐ ์ค์ ํ์ผ ์์ฑ
|
|
72
|
-
|
|
73
|
-
์ค์น ํ ์๋ ๋ช
๋ น์ผ๋ก ๋ฃจํธ์ `rqh.config.ts`๋ฅผ ์๋ ์์ฑํ ์ ์์ต๋๋ค.
|
|
28
|
+
> **๋ฒ์ ์๋ด:** ์ด ๋ฌธ์๋ **2.x** ๊ธฐ์ค์
๋๋ค. ์ค์ ๊ฒ์ ๋ฒ์ ์ ์ npm ๋ฐฐ์ง์์ ํ์ธํ์ธ์. 1.x๋ฅผ ์ฌ์ฉ ์ค์ด๋ผ๋ฉด [1.3.0 ๋ฌธ์](https://github.com/uiwwsw/react-query-helper/blob/v1.3.0/README.md)์ [๋ง์ด๊ทธ๋ ์ด์
๊ฐ์ด๋](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#1x์์-์ด์ )๋ฅผ ์ฐธ๊ณ ํ์ธ์. ์์ง ๊ฒ์๋์ง ์์ ๋ณ๊ฒฝ์ [์์ค์์ ์ค์น](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#npm-๊ฒ์-์ -์์ค์์-์ค์นํ๊ธฐ)ํ ์ ์์ต๋๋ค.
|
|
74
29
|
|
|
75
|
-
|
|
76
|
-
npx @uiwwsw/react-query-helper --init
|
|
77
|
-
# ๋๋
|
|
78
|
-
bunx @uiwwsw/react-query-helper --init
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
์ด๋ฏธ ํ๋ก์ ํธ์ ์ค์นํ ๋ค๋ผ๋ฉด ์๋์ฒ๋ผ ์คํํด๋ ๋ฉ๋๋ค.
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npx react-query-helper --init
|
|
85
|
-
# ๋๋
|
|
86
|
-
npm exec react-query-helper -- --init
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
์์ฑ๋๋ ํ์ผ ์์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
|
|
30
|
+
## ๋ฌด์์ ์ค์ฌ์ฃผ๋์?
|
|
90
31
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
import type { AutoQueryConfig } from "@uiwwsw/react-query-helper/config";
|
|
32
|
+
๊ฐ์ API๋ฅผ ์ปดํฌ๋ํธ, prefetch, ์บ์ ์กฐํ์์ ์ฌ์ฉํ ๋ ๋ฐ๋ณต๋๋ ํค์ ์ต์
๊ตฌ์ฑ์ ์ค์
๋๋ค.
|
|
33
|
+
**ํ
์ด๋ HTTP ํด๋ผ์ด์ธํธ๋ฅผ ์๋ก ๋ง๋ค์ง ์์ต๋๋ค.** ๊ธฐ์กด API ํจ์์ TanStack Query๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํฉ๋๋ค.
|
|
94
34
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
analyzer: {
|
|
102
|
-
exportFilter: "exported-only",
|
|
103
|
-
functionMatchMode: "all",
|
|
104
|
-
includeNames: [],
|
|
105
|
-
excludeNames: [],
|
|
106
|
-
},
|
|
107
|
-
template: {
|
|
108
|
-
enabledArtifacts: ["query", "mutation", "infinite"],
|
|
109
|
-
artifactStrategy: "smart",
|
|
110
|
-
keyStyle: "path",
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export default config;
|
|
115
|
-
```
|
|
35
|
+
| ์ง์ ๊ด๋ฆฌํ๋ ๊ฒ | ์์ฑ ํ |
|
|
36
|
+
| -------------------------- | --------------------------------------------------------- |
|
|
37
|
+
| ๊ณณ๊ณณ์ ํฉ์ด์ง ์ฟผ๋ฆฌ ํค | ํ์ผ ๊ฒฝ๋กยทํจ์๋ช
ยท์ธ์๋ฅผ ๋ฐ์ํ ํค |
|
|
38
|
+
| ๊ฐ์ ์์ฒญ์ ์ํ ๋ฐ๋ณต ์ต์
| `useQuery`, `useSuspenseQuery`, fetch/prefetch์์ ์ฌ์ฌ์ฉ |
|
|
39
|
+
| API์ ๋ณ๋๋ก ์ ์งํ๋ ํ์
| ์ธ์ยท์๋ตยท`select`ยท์บ์ ๋ฐ์ดํฐ ํ์
์ถ๋ก |
|
|
40
|
+
| API ๋ณ๊ฒฝ ํ ์์ฑ ํ์ผ ์ ๋ฆฌ | watch ์ฌ์์ฑ, ์ค๋๋ ์์ ํ์ผ ์ ๋ฆฌ, CI์ `--check` |
|
|
116
41
|
|
|
117
|
-
|
|
42
|
+
๊ธฐ๋ณธ ์บ์ฑ ์ ์ฑ
๊ณผ ์ฌ์๋๋ TanStack Query/`QueryClient`๋ฅผ ๋ฐ๋ฆ
๋๋ค.
|
|
43
|
+
์ด๋ฆ ๊ธฐ๋ฐ ์์ฑ ๊ท์น์ [์ค์ ์ผ๋ก ์ฌ์ ์](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#์์ฑ-๊ท์น)ํ ์ ์์ต๋๋ค.
|
|
118
44
|
|
|
119
|
-
|
|
45
|
+
<a id="quick-start"></a>
|
|
120
46
|
|
|
121
|
-
|
|
122
|
-
// package.json
|
|
123
|
-
{
|
|
124
|
-
"scripts": {
|
|
125
|
-
"init:rqh": "react-query-helper --init",
|
|
126
|
-
"watch": "react-query-helper --watch",
|
|
127
|
-
"generate": "react-query-helper --generate"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
bun run watch # ์ค์๊ฐ ๋ณ๊ฒฝ ๊ฐ์ง
|
|
134
|
-
bun run generate # ์ ์ฒด ํ์ผ ์ผ๊ด ์์ฑ
|
|
135
|
-
# ๋๋
|
|
136
|
-
npm exec react-query-helper -- --generate
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## CLI ๋ช
๋ น์ด
|
|
140
|
-
|
|
141
|
-
| ๋ช
๋ น์ด | ์ค๋ช
|
|
|
142
|
-
| --- | --- |
|
|
143
|
-
| `react-query-helper --init` | ๋ฃจํธ์ ๊ธฐ๋ณธ `rqh.config.ts` ํ์ผ์ ์์ฑํฉ๋๋ค. ์ด๋ฏธ ์์ผ๋ฉด ๋ฎ์ด์ฐ์ง ์์ต๋๋ค. |
|
|
144
|
-
| `react-query-helper --watch` | `sourceDir`๋ฅผ ๊ฐ์ํ์ฌ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ์ฝ๋๋ฅผ ๊ฐฑ์ ํฉ๋๋ค. |
|
|
145
|
-
| `react-query-helper --generate` | `sourceDir` ๋ด ๋ชจ๋ API ํ์ผ์ ๋ถ์ํ๊ณ ํ ๋ฒ์ ์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค. |
|
|
146
|
-
| `react-query-helper --help` | ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ ์ต์
์ ํ์ธํฉ๋๋ค. |
|
|
147
|
-
|
|
148
|
-
## ์ค์ ์ต์
|
|
149
|
-
|
|
150
|
-
| ์ต์
| ํ์ | ์ค๋ช
|
|
|
151
|
-
| --- | --- | --- |
|
|
152
|
-
| `sourceDir` | โ
| API ํจ์๊ฐ ํฌํจ๋ TypeScript ๋๋ ํ ๋ฆฌ (๋ฃจํธ ๊ธฐ์ค ๊ฒฝ๋ก) |
|
|
153
|
-
| `outputDir` | โ
| ์์ฑ๋ ํ
๊ณผ ์ต์
ํ์ผ์ด ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ |
|
|
154
|
-
| `ignoredFiles` | โ | ์ฝ๋ ์์ฑ์์ ์ ์ธํ ํ์ผ/๊ฒฝ๋ก ํจํด ๋ฐฐ์ด (`domain.ts`, `**/*.spec.ts`, `admin/internal/**`) |
|
|
155
|
-
| `templateDir` | โ | ์์ฑ๋ ์ฝ๋์์ `queryOption` ๊ณ์ด์ import ํ ๋ชจ๋ ๊ฒฝ๋ก ๋๋ ์๋ ๋๋ ํ ๋ฆฌ |
|
|
156
|
-
| `sourceImportAlias` | โ | API ํจ์ import๋ฅผ ์๋๊ฒฝ๋ก ๋์ alias๋ก ์์ฑํ ๋ ์ฌ์ฉํ prefix (`@/apis` ๋ฑ) |
|
|
157
|
-
| `analyzer` | โ | ์ด๋ค ํจ์๋ฅผ ์ฝ์์ง ํํฐ๋งํ๋ ์ค์ (`exported-only`, `async-only`, include/exclude ๋ฑ) |
|
|
158
|
-
| `template` | โ | ์ด๋ค ์ํฐํฉํธ๋ฅผ ์์ฑํ ์ง์ ์ด๋ฆ ๊ท์น์ ์ ์ดํ๋ ์ค์ |
|
|
159
|
-
|
|
160
|
-
### ์ค๋งํธ ์์ฑ ๊ท์น
|
|
161
|
-
|
|
162
|
-
๊ธฐ๋ณธ `artifactStrategy: "smart"`๋ ํจ์ ์ด๋ฆ์ ๋ณด๊ณ ์์ฑ ๋์์ ์ถ๋ก ํฉ๋๋ค.
|
|
163
|
-
|
|
164
|
-
- `getUsers`, `fetchPost`, `listComments` โ `query` + `infinite`
|
|
165
|
-
- `createUser`, `updateProfile`, `deleteComment` โ `mutation`
|
|
166
|
-
- ๊ทธ ์ธ ์ ๋งคํ ์ด๋ฆ โ `query` + `mutation` (`infinite` ์ ์ธ)
|
|
167
|
-
|
|
168
|
-
์ํ๋ค๋ฉด `artifactStrategy: "all"`๋ก ์์ ์ฒ๋ผ ๋ชจ๋ ์ํฐํฉํธ๋ฅผ ๊ฐ์ ๋ก ์์ฑํ ์ ์์ต๋๋ค.
|
|
169
|
-
|
|
170
|
-
## Infinite Query ๊ธฐ๋ณธ๊ฐ
|
|
171
|
-
|
|
172
|
-
`infiniteOption`์ API๋ง๋ค ํ์ด์ง๋ค์ด์
๊ท์น์ด ๋ค๋ฅด๊ธฐ ๋๋ฌธ์, ๊ธฐ๋ณธ ๊ตฌํ์์๋ `pageParam`์ ์๋ ๋ณํฉํ์ง ์์ต๋๋ค.
|
|
173
|
-
|
|
174
|
-
ํ์ํ ๊ฒฝ์ฐ ์์ฑ๋ ์ต์
์ ํผ์น ๋ค `queryFn`, `getNextPageParam`, `initialPageParam`์ ์ง์ override ํด์ ์ฌ์ฉํ์ธ์.
|
|
175
|
-
|
|
176
|
-
```ts
|
|
177
|
-
const usersInfinite = {
|
|
178
|
-
...getUsersInfiniteQueryOption({ page: 1 }),
|
|
179
|
-
initialPageParam: 1,
|
|
180
|
-
queryFn: ({ pageParam }) => getUsers({ page: pageParam }),
|
|
181
|
-
getNextPageParam: (lastPage) => lastPage.nextPage,
|
|
182
|
-
};
|
|
183
|
-
```
|
|
47
|
+
## ๋น ๋ฅธ ์์
|
|
184
48
|
|
|
185
|
-
|
|
49
|
+
### 1. ์ค์นํ๊ณ ์ด๊ธฐํ
|
|
186
50
|
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
initialPageParam: 1,
|
|
191
|
-
pageParamToArgs: (pageParam, [params]) => [{
|
|
192
|
-
...params,
|
|
193
|
-
page: pageParam,
|
|
194
|
-
headers: {
|
|
195
|
-
...params.headers,
|
|
196
|
-
Authorization: `Bearer ${token}`,
|
|
197
|
-
},
|
|
198
|
-
}],
|
|
199
|
-
getNextPageParam: (lastPage) => lastPage.nextPage,
|
|
200
|
-
},
|
|
201
|
-
{ page: 1, headers: {} }
|
|
202
|
-
);
|
|
51
|
+
```sh
|
|
52
|
+
npm install @uiwwsw/react-query-helper@^2 @tanstack/react-query react
|
|
53
|
+
npx @uiwwsw/react-query-helper init
|
|
203
54
|
```
|
|
204
55
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- API ํจ์๊ฐ ์ธ์ 1๊ฐ๋ฉด ๊ธฐ์กด์ฒ๋ผ `mutate(body)` / `mutateAsync(body)`
|
|
208
|
-
- API ํจ์๊ฐ ์ธ์ ์ฌ๋ฌ ๊ฐ๋ฉด ์์ฑ ์ฝ๋๊ฐ object payload ํ์
์ ๋ง๋ค์ด `mutate({ body, headers })` / `mutateAsync({ body, headers })`
|
|
209
|
-
|
|
210
|
-
๊ฐ๋จํ ์ปค์คํ
๋งคํ์ด ํ์ํ๋ฉด `withOptions(...)`๋ก๋ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.
|
|
56
|
+
์์ฑ ์ฝ๋๊ฐ ์ด ํจํค์ง๋ฅผ importํ๋ฏ๋ก `-D`๊ฐ ์๋ ์ผ๋ฐ dependency๋ก ์ค์นํฉ๋๋ค.
|
|
57
|
+
React์ TanStack Query๊ฐ ์ด๋ฏธ ์ค์น๋์ด ์๋ค๋ฉด ํ์ํ ์์กด์ฑ๋ง ์ถ๊ฐํ์ธ์.
|
|
211
58
|
|
|
212
|
-
|
|
213
|
-
const updateUserMutation = updateUserMutationOption.withOptions({
|
|
214
|
-
mapVariablesToArgs: ({ id, body }) => [
|
|
215
|
-
id,
|
|
216
|
-
body,
|
|
217
|
-
{ Authorization: `Bearer ${token}` },
|
|
218
|
-
],
|
|
219
|
-
});
|
|
220
|
-
```
|
|
59
|
+
### 2. API ๊ฒฝ๋ก ์ง์
|
|
221
60
|
|
|
222
|
-
|
|
61
|
+
`init`์ด ๋ง๋ `rqh.config.ts`์ ๊ฒฝ๋ก๋ฅผ ์ฑ ๊ตฌ์กฐ์ ๋ง์ถฅ๋๋ค.
|
|
62
|
+
๋ณ๋ ํ๋ฌ๊ทธ์ธ์ด๋ alias ์ค์ ์์ด ์์ํ ์ ์์ต๋๋ค.
|
|
223
63
|
|
|
224
64
|
```ts
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
headers: Parameters<typeof createUser>[1];
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export const createUserMutationOption = mutationOption<
|
|
231
|
-
Parameters<typeof createUser>,
|
|
232
|
-
Awaited<ReturnType<typeof createUser>>,
|
|
233
|
-
createUserMutationVariables
|
|
234
|
-
>(createUserKey, createUser, {
|
|
235
|
-
mapVariablesToArgs: (variables) => [variables.body, variables.headers],
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
mutate({
|
|
239
|
-
body: { name: "matthew" },
|
|
240
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
await mutateAsync({
|
|
244
|
-
body: { name: "matthew" },
|
|
245
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
246
|
-
});
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## ๋ฐฐํฌ ๋ฐฉ์
|
|
250
|
-
|
|
251
|
-
GitHub Actions์ npm ๋ฐฐํฌ๋ ์ด์ `main` ํธ์๊ฐ ์๋๋ผ `v*` ํ๊ทธ ํธ์ ๋๋ ์๋ ์คํ์์๋ง ๋์ํฉ๋๋ค.
|
|
252
|
-
|
|
253
|
-
์์:
|
|
65
|
+
// rqh.config.ts
|
|
66
|
+
import type { AutoQueryConfig } from "@uiwwsw/react-query-helper/config";
|
|
254
67
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
68
|
+
export default {
|
|
69
|
+
sourceDir: "./libs",
|
|
70
|
+
outputDir: "./src/options",
|
|
71
|
+
ignoredFiles: ["domain.ts", "adaptor.ts", "**/*.test.ts", "**/*.spec.ts"],
|
|
72
|
+
template: { artifactStrategy: "smart" },
|
|
73
|
+
} satisfies AutoQueryConfig;
|
|
258
74
|
```
|
|
259
75
|
|
|
260
|
-
|
|
76
|
+
์ค์ API ํจ์๋ฅผ ํด๋น ๋๋ ํ ๋ฆฌ์ ๋์ธ์. ์๋๋ ํ๋ฆ์ ํ์ธํ๊ธฐ ์ํ ๊ฐ๋จํ ์์์
๋๋ค.
|
|
261
77
|
|
|
262
78
|
```ts
|
|
263
79
|
// libs/users/api.ts
|
|
264
|
-
export const getUser = async (id: string) => {
|
|
265
|
-
return { id, name: `User ${id}` };
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
export const createUser = async (
|
|
269
|
-
body: { name: string },
|
|
270
|
-
headers?: Record<string, string>
|
|
271
|
-
) => {
|
|
272
|
-
return { id: Date.now().toString(), name: body.name, headers };
|
|
273
|
-
};
|
|
80
|
+
export const getUser = async (id: string) => ({ id, name: "Ada" });
|
|
274
81
|
```
|
|
275
82
|
|
|
276
|
-
|
|
277
|
-
// src/options/users/apiOptions.ts (์๋ ์์ฑ)
|
|
278
|
-
import { createUser, getUser } from "../../../libs/users/api";
|
|
279
|
-
import {
|
|
280
|
-
infiniteOption,
|
|
281
|
-
mutationOption,
|
|
282
|
-
queryOption,
|
|
283
|
-
} from "@uiwwsw/react-query-helper";
|
|
284
|
-
|
|
285
|
-
export const getUserKey = ["users", "getUser"] as const;
|
|
286
|
-
export const getUserQueryOption = queryOption(getUserKey, getUser);
|
|
287
|
-
export const getUserInfiniteQueryOption = infiniteOption(getUserKey, getUser);
|
|
288
|
-
|
|
289
|
-
export const createUserKey = ["users", "createUser"] as const;
|
|
290
|
-
export type createUserMutationVariables = {
|
|
291
|
-
body: Parameters<typeof createUser>[0];
|
|
292
|
-
headers: Parameters<typeof createUser>[1];
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
export const createUserMutationOption = mutationOption<
|
|
296
|
-
Parameters<typeof createUser>,
|
|
297
|
-
Awaited<ReturnType<typeof createUser>>,
|
|
298
|
-
createUserMutationVariables
|
|
299
|
-
>(
|
|
300
|
-
createUserKey,
|
|
301
|
-
createUser,
|
|
302
|
-
{
|
|
303
|
-
mapVariablesToArgs: (variables) => [variables.body, variables.headers],
|
|
304
|
-
}
|
|
305
|
-
);
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## ํฌํผ ๊ฒฝ๋ก ์ปค์คํฐ๋ง์ด์ง
|
|
309
|
-
|
|
310
|
-
์กฐ์ง ๊ณต์ฉ ํฌํผ๋ฅผ ๋ฐ๋ก ๋๊ณ ์๋ค๋ฉด `templateDir`๋ก ์์ฑ ์ฝ๋์ import ๊ฒฝ๋ก๋ฅผ ๋ฐ๊ฟ ์ ์์ต๋๋ค.
|
|
83
|
+
### 3. ์์ฑํ๊ณ ์ฌ์ฉ
|
|
311
84
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
```ts
|
|
315
|
-
const config: AutoQueryConfig = {
|
|
316
|
-
sourceDir: "./libs",
|
|
317
|
-
outputDir: "./src/options",
|
|
318
|
-
analyzer: {
|
|
319
|
-
functionMatchMode: "async-only",
|
|
320
|
-
excludeNames: ["debugHelper"],
|
|
321
|
-
},
|
|
322
|
-
template: {
|
|
323
|
-
enabledArtifacts: ["query"],
|
|
324
|
-
keyStyle: "function-only",
|
|
325
|
-
outputNames: {
|
|
326
|
-
query: "CustomQueryOption",
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
};
|
|
85
|
+
```sh
|
|
86
|
+
npx @uiwwsw/react-query-helper generate
|
|
330
87
|
```
|
|
331
88
|
|
|
332
|
-
|
|
89
|
+
`src/options/users/apiOptions.ts`์ `getUserKey`, `getUserQueryOption`,
|
|
90
|
+
`getUserInfiniteQueryOption`์ด ์์ฑ๋ฉ๋๋ค. **์์ฑ ํ์ผ ๋์ ์๋ณธ API๋ฅผ ์์ ํ์ธ์.**
|
|
91
|
+
๋ฌดํ ์ฟผ๋ฆฌ ํฉํ ๋ฆฌ๋ ์์ฑ๋์ง๋ง ์ค์ ํ์ด์ง๋ค์ด์
์ค์ ์ API์ ๋ง๊ฒ ๋ณ๋๋ก ์ง์ ํฉ๋๋ค.
|
|
333
92
|
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
customAnalyzerPath: "./rqh.analyzer.mjs",
|
|
339
|
-
customTemplatePath: "./rqh.template.mjs",
|
|
340
|
-
};
|
|
341
|
-
```
|
|
93
|
+
```tsx
|
|
94
|
+
// src/UserName.tsx
|
|
95
|
+
import { useQuery } from "@tanstack/react-query";
|
|
96
|
+
import { getUserQueryOption } from "./options/users/apiOptions";
|
|
342
97
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
// ์ฌ๊ธฐ์ AST๋ฅผ ์ง์ ํ์ฑํ๊ฑฐ๋,
|
|
351
|
-
// ํ์ผ๋ช
๊ท์น / ํจ์๋ช
๊ท์น์ ์์ ๋กญ๊ฒ ์ ์ฉํ ์ ์์ต๋๋ค.
|
|
352
|
-
return [
|
|
353
|
-
{
|
|
354
|
-
name: "getUser",
|
|
355
|
-
parameters: ["params"],
|
|
356
|
-
isAsync: true,
|
|
357
|
-
isExported: true,
|
|
358
|
-
},
|
|
359
|
-
];
|
|
360
|
-
}
|
|
361
|
-
```
|
|
98
|
+
export function UserName({ id }: { id: string }) {
|
|
99
|
+
const user = useQuery(
|
|
100
|
+
getUserQueryOption.withOptions(
|
|
101
|
+
{ staleTime: 60_000, select: (data) => data.name },
|
|
102
|
+
id,
|
|
103
|
+
),
|
|
104
|
+
);
|
|
362
105
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
export function generateOptionsCode({ functionInfos, importPath }) {
|
|
367
|
-
const names = functionInfos.map((info) => info.name).join(", ");
|
|
368
|
-
return `import { ${names} } from "${importPath}";\nexport const customGenerated = true;\n`;
|
|
106
|
+
if (user.isPending) return <p>Loading...</p>;
|
|
107
|
+
if (user.isError) return <p>{user.error.message}</p>;
|
|
108
|
+
return <p>{user.data}</p>;
|
|
369
109
|
}
|
|
370
110
|
```
|
|
371
111
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
- `exported-only`, `async-only`, ์ด๋ฆ include/exclude, ์ํฐํฉํธ on/off ์ ๋
|
|
375
|
-
- custom analyzer๊ฐ ํ์ํ ๊ฒฝ์ฐ
|
|
376
|
-
- ํจ์ ์ ์ธ์ด ๋ํ๋์ด ์๊ฑฐ๋
|
|
377
|
-
- factory/higher-order ๊ตฌ์กฐ๋ฅผ ์ฐ๊ฑฐ๋
|
|
378
|
-
- ํ ์ ์ฉ ๊ท์น์ผ๋ก ํจ์ ํ๋ณด๋ฅผ ๋ฝ์์ผ ํ๊ฑฐ๋
|
|
379
|
-
- ๊ธฐ๋ณธ AST ๊ท์น๋ณด๋ค ๋ ๋ณต์กํ generic ํจํด์ ๊ฐ์ ํ๊ณ ์ถ์ ๋
|
|
380
|
-
|
|
381
|
-
์ฆ ์ด์ ๋ ๊ธฐ๋ณธ ๊ท์น์ ์กฐ๊ธ ๋ฐ๊พธ๋ ์์ค์ด ์๋๋ผ, ํ ์ ์ฉ ์์ฑ๊ธฐ์ฒ๋ผ ํ์ฅํ ์ ์์ต๋๋ค.
|
|
112
|
+
์ฑ ์์์ `QueryClientProvider`๊ฐ ํ์ํฉ๋๋ค. ์์ `user.data`๋ `select`์ ๋ฐ๋ผ
|
|
113
|
+
`string`์ผ๋ก ์ถ๋ก ๋ฉ๋๋ค. ์ต์
์ ํ
๋ฐ๊นฅ์์๋ ์ฌ์ฌ์ฉํ ์ ์์ต๋๋ค.
|
|
382
114
|
|
|
383
115
|
```ts
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
};
|
|
116
|
+
// ๊ธฐ์กด QueryClient ์ธ์คํด์ค client์์
|
|
117
|
+
await client.prefetchQuery(getUserQueryOption("u1"));
|
|
118
|
+
const cached = client.getQueryData(getUserQueryOption("u1").queryKey);
|
|
119
|
+
// { id: string; name: string } | undefined
|
|
389
120
|
```
|
|
390
121
|
|
|
391
|
-
|
|
122
|
+
### 4. ๊ฐ๋ฐ ํ๋ฆ์ ์ฐ๊ฒฐ
|
|
392
123
|
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"scripts": {
|
|
127
|
+
"query:generate": "react-query-helper generate",
|
|
128
|
+
"query:watch": "react-query-helper watch",
|
|
129
|
+
"query:check": "react-query-helper generate --check"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
399
132
|
```
|
|
400
133
|
|
|
401
|
-
|
|
134
|
+
๊ฐ๋ฐํ ๋๋ `npm run query:watch`, ์ฑ CI์์๋ `npm run query:check`๋ฅผ ์คํํ์ธ์.
|
|
135
|
+
check๋ ํ์ผ์ ์์ ํ์ง ์๊ณ ๋๋ฝยท๋ณ๊ฒฝยท์ค๋๋ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ๊ฒฌํ๋ฉด ์ข
๋ฃ ์ฝ๋ 1์ ๋ฐํํฉ๋๋ค.
|
|
136
|
+
์์ฑ๋ฌผ์ ์ปค๋ฐํ์ง ์๋ ํ๋ก์ ํธ๋ผ๋ฉด CI์์ `query:generate` ํ ์ฑ ํ์
๊ฒ์ฌ๋ฅผ ์คํํ์ธ์.
|
|
402
137
|
|
|
403
|
-
|
|
404
|
-
- ์์ฑ๋ ํ์ผ์ ๋ฒ์ ๊ด๋ฆฌ ์์คํ
(Git)์ ์ปค๋ฐํ์ฌ ๋ฐฐํฌ ์ ์๋ ์์ฑ ๊ณผ์ ์ ํผํ์ธ์.
|
|
405
|
-
- `queryOption` ์ ํธ ํจ์์์ ๊ธ๋ก๋ฒ ์ต์
(`staleTime`, `retry`, `refetchOnWindowFocus`)์ ์ ์ํ๋ฉด ํ ์ ์ฒด ๊ท์น์ ์์ฝ๊ฒ ํต์ผํ ์ ์์ต๋๋ค.
|
|
406
|
-
- Watch ๋ชจ๋ ์ฌ์ฉ ์ IDE ์ ์ฅ ํฌ๋งทํฐ์ ์ถฉ๋์ด ์๋๋ก ์ ์ฅ ์์ ํฌ๋งทํ
์ ๋ง์ถฐ ์ฃผ์ธ์.
|
|
138
|
+
## ํ์ํ ์์ ์ฐพ๊ธฐ
|
|
407
139
|
|
|
408
|
-
|
|
140
|
+
| ํ๊ณ ์ถ์ ์ผ | ๊ฐ์ด๋ |
|
|
141
|
+
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| ์ค์ ํ์ผ, ๊ฒฝ๋ก, ignore glob ๋ณ๊ฒฝ | [์ค์ ](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#์ค์ ) |
|
|
143
|
+
| ํจ์๋ณ query/mutation ์์ฑ ์ ์ด | [์์ฑ ๊ท์น๊ณผ ์บ์ ํค](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#์์ฑ-๊ท์น) |
|
|
144
|
+
| mutation ์ธ์, ์ทจ์, ์ต์
ํ์ฅ | [๋ฐํ์ ์ต์
](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#๋ฐํ์-์ต์
) |
|
|
145
|
+
| ์ปค์ ํ์ด์ง๋ค์ด์
๊ณผ `maxPages` | [๋ฌดํ ์ฟผ๋ฆฌ](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#๋ฌดํ-์ฟผ๋ฆฌ) |
|
|
146
|
+
| ๊ธฐ์กด 1.x ํ๋ก์ ํธ ์
๊ทธ๋ ์ด๋ | [๋ง์ด๊ทธ๋ ์ด์
์ฒดํฌ๋ฆฌ์คํธ](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#1x์์-์ด์ ) |
|
|
147
|
+
| ์ง์ํ์ง ์๋ ๋ฌธ๋ฒ, ์ปค์คํ
ํ๋ฌ๊ทธ์ธ | [์ง์ ๋ฒ์์ ํ์ฅ](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#๋ฒ์์-ํ์ฅ) |
|
|
148
|
+
| ํ
์คํธ, ๋ก์ปฌ ์ค์น, npm ๋ฐฐํฌ ์ค์ | [๊ฐ๋ฐ๊ณผ ๋ฐฐํฌ](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REFERENCE.md#๊ฐ๋ฐ๊ณผ-๋ฐฐํฌ) |
|
|
149
|
+
| ์ด๋ฒ ๊ฐ์ ์ ๊ทผ๊ฑฐ์ ๋จ์ ํ๊ณ | [์ ์ฅ์ ๊ฒํ ๊ธฐ๋ก](https://github.com/uiwwsw/react-query-helper/blob/main/docs/REVIEW.md) |
|
|
409
150
|
|
|
410
|
-
|
|
151
|
+
## ์ง์ ํ๊ฒฝ๊ณผ ์ฃผ์์
|
|
411
152
|
|
|
412
|
-
|
|
153
|
+
| ๊ตฌ๋ถ | ์ง์ ๊ธฐ์ค |
|
|
154
|
+
| -------------- | -------------------------------------------------- |
|
|
155
|
+
| Node.js | CLI/๋น๋์ 22 ์ด์, CI๋ 22/24 |
|
|
156
|
+
| React | 18/19 |
|
|
157
|
+
| TanStack Query | `>=5.102.8 <6` |
|
|
158
|
+
| TypeScript | 5.8 ์ด์, ์์ฑ ์ฝ๋๋ TS ๋ฒ๋ค๋ฌ์ฉ |
|
|
159
|
+
| ๋ธ๋ผ์ฐ์ | ๋ฃจํธ import๋ ๋ธ๋ผ์ฐ์ ์ฉ, Node ๋๊ตฌ๋ ๋ณ๋ subpath |
|
|
413
160
|
|
|
414
|
-
|
|
161
|
+
- **2.x๋ ํธํ์ฑ์ ๊นจ๋ ๋ณ๊ฒฝ์
๋๋ค.** ๊ธฐ์กด ์์ฑ ํ์ผ์ ์ฎ๊ธด ๋ค ์ฌ์์ฑํ๊ณ , ์๋ ํค์ persisted cache๋ฅผ ๋ง์ด๊ทธ๋ ์ด์
ํ์ธ์.
|
|
162
|
+
- API ์ธ์๋ ์บ์ ํค์ ํฌํจ๋ฉ๋๋ค. ์ง๋ ฌํ ๊ฐ๋ฅํ ๊ฐ๋ง ์ ๋ฌํ๊ณ ํ ํฐยท์ธ์ฆ ํค๋๋ ๋ฃ์ง ๋ง์ธ์.
|
|
163
|
+
- ํ์ด์ง๋ค์ด์
๊ณผ ์์ฒญ ์ทจ์๋ ์๋ ์ถ์ธกํ์ง ์์ต๋๋ค. ์ปค์ ๋งคํ๊ณผ `AbortSignal` ์ ๋ฌ์ API์ ๋ง์ถฐ ์ค์ ํ์ธ์.
|
|
164
|
+
- ์ต์์ ํจ์๊ฐ ๊ธฐ๋ณธ ๋์์
๋๋ค. re-export barrel, ๋ฉ์๋, ๋ชจ๋ generic/overload ๊ด๊ณ๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฒ์ฉ TypeScript ๋ณํ๊ธฐ๋ ์๋๋๋ค.
|
|
415
165
|
|
|
416
|
-
|
|
166
|
+
[๋ณ๊ฒฝ ์ด๋ ฅ](https://github.com/uiwwsw/react-query-helper/blob/main/CHANGELOG.md) ยท [๋ก๊ณ ์ ๋ธ๋๋ ์์ฐ](https://github.com/uiwwsw/react-query-helper/blob/main/assets/README.md) ยท [MIT License](https://github.com/uiwwsw/react-query-helper/blob/main/LICENSE)
|
|
417
167
|
|
|
418
|
-
|
|
168
|
+
๋
๋ฆฝ์ ์ธ ์ปค๋ฎค๋ํฐ ๋๊ตฌ์ด๋ฉฐ React ๋๋ TanStack์ ๊ณต์ ํ๋ก์ ํธ๊ฐ ์๋๋๋ค.
|