@basictech/react 0.9.0-beta.0 → 0.11.0-beta.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/LICENSE +21 -0
- package/README.md +1101 -0
- package/dist/index.d.mts +236 -1119
- package/dist/index.d.ts +236 -1119
- package/dist/index.js +1010 -4117
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +980 -4070
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -20
- package/changelog.md +0 -408
- package/readme.md +0 -413
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basictech/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.11.0-beta.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "React integration for the Basic repo-era SDK",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=24.0.0"
|
|
9
|
+
},
|
|
10
|
+
"type": "commonjs",
|
|
5
11
|
"main": "dist/index.js",
|
|
6
12
|
"module": "dist/index.mjs",
|
|
7
13
|
"types": "dist/index.d.ts",
|
|
@@ -18,41 +24,38 @@
|
|
|
18
24
|
}
|
|
19
25
|
},
|
|
20
26
|
"files": [
|
|
21
|
-
"dist"
|
|
22
|
-
"readme.md",
|
|
23
|
-
"changelog.md"
|
|
27
|
+
"dist"
|
|
24
28
|
],
|
|
25
|
-
"sideEffects": false,
|
|
26
|
-
"private": false,
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
},
|
|
30
29
|
"scripts": {
|
|
31
30
|
"build": "tsup",
|
|
32
31
|
"dev": "tsup --watch",
|
|
33
|
-
"
|
|
32
|
+
"prepack": "npm run build",
|
|
34
33
|
"test": "vitest run"
|
|
35
34
|
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
36
39
|
"author": "",
|
|
37
|
-
"license": "ISC",
|
|
38
40
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"dexie": "^4.2.1"
|
|
41
|
-
"dexie-react-hooks": "^4.2.0",
|
|
42
|
-
"jwt-decode": "^4.0.0",
|
|
43
|
-
"@basictech/schema": "^0.7.0"
|
|
41
|
+
"@basictech/core": "0.11.0-beta.1",
|
|
42
|
+
"dexie": "^4.2.1"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@types/react": "^
|
|
45
|
+
"@testing-library/react": "^16.3.2",
|
|
46
|
+
"@types/react": "^18.3.3",
|
|
47
|
+
"@types/react-dom": "^18.3.0",
|
|
48
48
|
"@types/ws": "^8.5.0",
|
|
49
49
|
"fake-indexeddb": "^6.0.0",
|
|
50
|
+
"jsdom": "^30.0.1",
|
|
51
|
+
"react": "^19.2.0",
|
|
52
|
+
"react-dom": "^19.2.0",
|
|
50
53
|
"tsup": "^8.0.0",
|
|
51
54
|
"typescript": "^5.0.0",
|
|
52
55
|
"vitest": "^3.0.0",
|
|
53
56
|
"ws": "^8.18.0"
|
|
54
57
|
},
|
|
55
58
|
"peerDependencies": {
|
|
56
|
-
"react": "
|
|
59
|
+
"react": ">=18"
|
|
57
60
|
}
|
|
58
61
|
}
|
package/changelog.md
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
# 1.3.4
|
|
2
|
-
|
|
3
|
-
## 0.9.0-beta.0
|
|
4
|
-
|
|
5
|
-
### Major Changes (breaking)
|
|
6
|
-
|
|
7
|
-
Ground-up rewrite for the server's Sync/2 sync engine and Step 2 auth upgrade.
|
|
8
|
-
The legacy dexie-syncable `/ws` protocol was removed server-side (clean
|
|
9
|
-
break), so 0.8.x sync no longer works against production.
|
|
10
|
-
|
|
11
|
-
- **New sync engine** (`core/sync/`): implements the Sync/2 client contract
|
|
12
|
-
(SYNC_V2.md) — snapshot bootstrap, multiplexed WebSocket subscriptions,
|
|
13
|
-
client-minted idempotent ops (`put`/`patch`/`delete`), persisted pending
|
|
14
|
-
queue with optimistic rebase, ordered apply with echo confirmation,
|
|
15
|
-
poison-op handling for terminal rejections, and re-bootstrap recovery
|
|
16
|
-
(`SNAPSHOT_REQUIRED`/`RESET_REQUIRED`). Local persistence is plain Dexie
|
|
17
|
-
(dexie-syncable/dexie-observable removed).
|
|
18
|
-
- **New public API**: `db.table(name)` with `create/put/patch/delete/get/
|
|
19
|
-
getAll/find`; `useAuth`, `useDb`, `useSyncStatus`, `useShares`, `useShare`;
|
|
20
|
-
`useBasic` remains the umbrella hook. `useQuery` still provides live reads.
|
|
21
|
-
- **Shares v1**: list shares and mount shared data via `useShare(shareId)` —
|
|
22
|
-
separate local keyspace per mount, guest writes when permitted, revocation
|
|
23
|
-
handling.
|
|
24
|
-
- **Auth updates**: `signOut()` revokes server-side via `POST /auth/logout`;
|
|
25
|
-
sign-out (incl. cross-tab) tears down local data without page reloads;
|
|
26
|
-
token-endpoint 429s are treated as transient; `CONNECTION_REVOKED` from
|
|
27
|
-
sync triggers session reconciliation.
|
|
28
|
-
- **REST mode**: `mode="rest"` replaces `dbMode="remote"`, backed by the
|
|
29
|
-
REST v2 surface (`/account/:project_id/db/...`), including
|
|
30
|
-
snapshot/changes endpoints.
|
|
31
|
-
- Tests: vitest unit suite + integration suite against the Sync/2 reference
|
|
32
|
-
server (`basic-server/sync-playground`).
|
|
33
|
-
|
|
34
|
-
## 0.8.0-beta.4
|
|
35
|
-
|
|
36
|
-
### Patch Changes
|
|
37
|
-
|
|
38
|
-
- Auth status state machine and session reconciliation: add `AuthStatus` type (`bootstrapping`, `authenticated`, `recovering`, `reauth_required`, `signed_out`), replace `window.location.reload()` cross-tab handlers with in-place state updates, add `reconcileSession` for sync/visibility/online recovery, handle `tokenUpdateAck` in sync protocol, and expose `authStatus` + `authErrorCode` from `useBasic()`
|
|
39
|
-
|
|
40
|
-
## 0.8.0-beta.3
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- Fix PWA/mobile logout issues: harden auth for offline resilience, prevent spurious logouts on transient server errors, proactive token refresh on app resume, and fix potential deadlock in token refresh flow
|
|
45
|
-
|
|
46
|
-
## 0.8.0-beta.2
|
|
47
|
-
|
|
48
|
-
### Minor Changes
|
|
49
|
-
|
|
50
|
-
- added debug bar
|
|
51
|
-
|
|
52
|
-
## 0.8.0-beta.1
|
|
53
|
-
|
|
54
|
-
### Minor Changes
|
|
55
|
-
|
|
56
|
-
- uth updates
|
|
57
|
-
|
|
58
|
-
## 0.8.0-beta.0
|
|
59
|
-
|
|
60
|
-
### Minor Changes
|
|
61
|
-
|
|
62
|
-
- Overhaul auth system: extract AuthManager, add PKCE, cross-tab sync, proactive token refresh, enriched error handling, and fix DELETE Content-Type issue
|
|
63
|
-
|
|
64
|
-
## Unreleased
|
|
65
|
-
|
|
66
|
-
### Patch Changes
|
|
67
|
-
|
|
68
|
-
- **DBStatus:** Add `ERROR_WILL_RETRY` to align with dexie-syncable status code 4 (error but will retry). Export `DBStatus` enum from the package. Document all `DBStatus` values in readme, including when `ERROR_WILL_RETRY` occurs (e.g. expired token). Enables UI to show "Reconnecting…" or future token refresh on this state.
|
|
69
|
-
|
|
70
|
-
## 0.7.0
|
|
71
|
-
|
|
72
|
-
### Minor Changes
|
|
73
|
-
|
|
74
|
-
- 6a506e9: api improvements, react refactor, nextjs update
|
|
75
|
-
- e45744e: localstorage update
|
|
76
|
-
- e45744e: storage adapater update
|
|
77
|
-
- update apis, add remote db + sync db
|
|
78
|
-
|
|
79
|
-
### Patch Changes
|
|
80
|
-
|
|
81
|
-
- cdf7123: refresh token patch
|
|
82
|
-
- 7e68aa3: add oauth settings
|
|
83
|
-
- 841839f: fix: provider props
|
|
84
|
-
- 7e68aa3: update token endpoint
|
|
85
|
-
- 4f11b3e: config server url & token patch
|
|
86
|
-
|
|
87
|
-
## 0.7.0-beta.7
|
|
88
|
-
|
|
89
|
-
### Minor Changes
|
|
90
|
-
|
|
91
|
-
- api improvements, react refactor, nextjs update
|
|
92
|
-
|
|
93
|
-
## 0.7.0-beta.6
|
|
94
|
-
|
|
95
|
-
### Patch Changes
|
|
96
|
-
|
|
97
|
-
- refresh token patch
|
|
98
|
-
|
|
99
|
-
## 0.7.0-beta.5
|
|
100
|
-
|
|
101
|
-
### Patch Changes
|
|
102
|
-
|
|
103
|
-
- config server url & token patch
|
|
104
|
-
|
|
105
|
-
## 0.7.0-beta.4
|
|
106
|
-
|
|
107
|
-
### Patch Changes
|
|
108
|
-
|
|
109
|
-
- fix: provider props
|
|
110
|
-
|
|
111
|
-
## 0.7.0-beta.3
|
|
112
|
-
|
|
113
|
-
### Patch Changes
|
|
114
|
-
|
|
115
|
-
- add oauth settings
|
|
116
|
-
|
|
117
|
-
## 0.7.0-beta.2
|
|
118
|
-
|
|
119
|
-
### Patch Changes
|
|
120
|
-
|
|
121
|
-
- update token endpoint
|
|
122
|
-
|
|
123
|
-
## 0.7.0-beta.1
|
|
124
|
-
|
|
125
|
-
### Minor Changes
|
|
126
|
-
|
|
127
|
-
- storage adapater update
|
|
128
|
-
|
|
129
|
-
## 0.7.0-beta.0
|
|
130
|
-
|
|
131
|
-
### Minor Changes
|
|
132
|
-
|
|
133
|
-
- localstorage update
|
|
134
|
-
|
|
135
|
-
## 0.6.0
|
|
136
|
-
|
|
137
|
-
### Minor Changes
|
|
138
|
-
|
|
139
|
-
- d241ffa: suerver url patch
|
|
140
|
-
|
|
141
|
-
### Patch Changes
|
|
142
|
-
|
|
143
|
-
- Updated dependencies
|
|
144
|
-
- @basictech/schema@0.6.0
|
|
145
|
-
|
|
146
|
-
## 0.6.0-beta.0
|
|
147
|
-
|
|
148
|
-
### Minor Changes
|
|
149
|
-
|
|
150
|
-
- suerver url patch
|
|
151
|
-
|
|
152
|
-
## 0.5.0
|
|
153
|
-
|
|
154
|
-
### Minor Changes
|
|
155
|
-
|
|
156
|
-
- 6765047: fix server url
|
|
157
|
-
- af26a15: include schema to sync
|
|
158
|
-
- 783ecad: reset db on signout
|
|
159
|
-
- 6dd6ad9: add react 19
|
|
160
|
-
- f9c25a3: fix update notif
|
|
161
|
-
- 7f42c2a: react - initdb and version check
|
|
162
|
-
- weee
|
|
163
|
-
|
|
164
|
-
## 0.5.0-beta.5
|
|
165
|
-
|
|
166
|
-
### Minor Changes
|
|
167
|
-
|
|
168
|
-
- fix update notif
|
|
169
|
-
|
|
170
|
-
## 0.5.0-beta.4
|
|
171
|
-
|
|
172
|
-
### Minor Changes
|
|
173
|
-
|
|
174
|
-
- react - initdb and version check
|
|
175
|
-
|
|
176
|
-
## 0.5.0-beta.3
|
|
177
|
-
|
|
178
|
-
### Minor Changes
|
|
179
|
-
|
|
180
|
-
- add react 19
|
|
181
|
-
|
|
182
|
-
## 0.5.0-beta.2
|
|
183
|
-
|
|
184
|
-
### Minor Changes
|
|
185
|
-
|
|
186
|
-
- fix server url
|
|
187
|
-
|
|
188
|
-
## 0.5.0-beta.1
|
|
189
|
-
|
|
190
|
-
### Minor Changes
|
|
191
|
-
|
|
192
|
-
- include schema to sync
|
|
193
|
-
|
|
194
|
-
## 0.5.0-beta.0
|
|
195
|
-
|
|
196
|
-
### Minor Changes
|
|
197
|
-
|
|
198
|
-
- reset db on signout
|
|
199
|
-
|
|
200
|
-
## 0.4.0
|
|
201
|
-
|
|
202
|
-
### Minor Changes
|
|
203
|
-
|
|
204
|
-
- a41eb20: schema validation to react client
|
|
205
|
-
- b572027: patch - occasional sync disconnect
|
|
206
|
-
|
|
207
|
-
### Patch Changes
|
|
208
|
-
|
|
209
|
-
- Updated dependencies
|
|
210
|
-
- Updated dependencies [a41eb20]
|
|
211
|
-
- Updated dependencies [c76951e]
|
|
212
|
-
- @basictech/schema@0.5.0
|
|
213
|
-
|
|
214
|
-
## 0.4.0-beta.1
|
|
215
|
-
|
|
216
|
-
### Patch Changes
|
|
217
|
-
|
|
218
|
-
- Updated dependencies
|
|
219
|
-
- @basictech/schema@0.5.0-beta.1
|
|
220
|
-
|
|
221
|
-
## 0.4.0-beta.0
|
|
222
|
-
|
|
223
|
-
### Minor Changes
|
|
224
|
-
|
|
225
|
-
- a41eb20: schema validation to react client
|
|
226
|
-
- patch - occasional sync disconnect
|
|
227
|
-
|
|
228
|
-
### Patch Changes
|
|
229
|
-
|
|
230
|
-
- Updated dependencies [a41eb20]
|
|
231
|
-
- @basictech/schema@0.5.0-beta.0
|
|
232
|
-
|
|
233
|
-
## 0.3.0
|
|
234
|
-
|
|
235
|
-
### Minor Changes
|
|
236
|
-
|
|
237
|
-
- schema validation in react client
|
|
238
|
-
|
|
239
|
-
### Patch Changes
|
|
240
|
-
|
|
241
|
-
- Updated dependencies
|
|
242
|
-
- @basictech/schema@0.4.0
|
|
243
|
-
|
|
244
|
-
## 0.2.2
|
|
245
|
-
|
|
246
|
-
### Patch Changes
|
|
247
|
-
|
|
248
|
-
- Updated dependencies [f9ad8d1]
|
|
249
|
-
- @basictech/schema@0.3.0
|
|
250
|
-
|
|
251
|
-
## 0.2.1
|
|
252
|
-
|
|
253
|
-
### Patch Changes
|
|
254
|
-
|
|
255
|
-
- Updated dependencies
|
|
256
|
-
- @basictech/schema@0.2.0
|
|
257
|
-
|
|
258
|
-
## 0.2.0
|
|
259
|
-
|
|
260
|
-
### Minor Changes
|
|
261
|
-
|
|
262
|
-
- 5890f4c: changed isLoaded to isAuthReady and fixed dbStatus hooks for useBasic
|
|
263
|
-
- ba294c5: dependency updates
|
|
264
|
-
- cd827af: add schema validation
|
|
265
|
-
- 1a3fe80: schema validation bugfix
|
|
266
|
-
- 13594a9: added basic-sync
|
|
267
|
-
- ba294c5: dependency update
|
|
268
|
-
- f035281: remove sync lib
|
|
269
|
-
- 4841960: rebuild tsup
|
|
270
|
-
- 96e0156: update schema validation
|
|
271
|
-
- cda3d16: add schema validation
|
|
272
|
-
- 2c898ae: update useQuery hook
|
|
273
|
-
- no need to pass param as a function, can now enter query directly
|
|
274
|
-
- defaults to empty array when loading
|
|
275
|
-
|
|
276
|
-
- 90ccdd7: add debug option
|
|
277
|
-
- 4841960: test build
|
|
278
|
-
- f035281: remove sync library
|
|
279
|
-
- ef528e9: added schema package - test
|
|
280
|
-
|
|
281
|
-
### Patch Changes
|
|
282
|
-
|
|
283
|
-
- 3c7b34e: version changes mostly
|
|
284
|
-
- c085672: reset versions
|
|
285
|
-
- Updated dependencies [96e0156]
|
|
286
|
-
- Updated dependencies [ef528e9]
|
|
287
|
-
- @basictech/schema@0.1.0
|
|
288
|
-
|
|
289
|
-
## 0.2.0-beta.11
|
|
290
|
-
|
|
291
|
-
### Minor Changes
|
|
292
|
-
|
|
293
|
-
- update schema validation
|
|
294
|
-
|
|
295
|
-
### Patch Changes
|
|
296
|
-
|
|
297
|
-
- Updated dependencies
|
|
298
|
-
- @basictech/schema@0.1.0-beta.1
|
|
299
|
-
|
|
300
|
-
## 0.2.0-beta.10
|
|
301
|
-
|
|
302
|
-
### Minor Changes
|
|
303
|
-
|
|
304
|
-
- added schema package - test
|
|
305
|
-
|
|
306
|
-
### Patch Changes
|
|
307
|
-
|
|
308
|
-
- Updated dependencies
|
|
309
|
-
- @basictech/schema@0.1.0-beta.0
|
|
310
|
-
|
|
311
|
-
## 0.2.0-beta.9
|
|
312
|
-
|
|
313
|
-
### Minor Changes
|
|
314
|
-
|
|
315
|
-
- add schema validation
|
|
316
|
-
|
|
317
|
-
## 0.2.0-beta.8
|
|
318
|
-
|
|
319
|
-
### Minor Changes
|
|
320
|
-
|
|
321
|
-
- changed isLoaded to isAuthReady and fixed dbStatus hooks for useBasic
|
|
322
|
-
|
|
323
|
-
## 0.2.0-beta.7
|
|
324
|
-
|
|
325
|
-
### Minor Changes
|
|
326
|
-
|
|
327
|
-
- update useQuery hook
|
|
328
|
-
- no need to pass param as a function, can now enter query directly
|
|
329
|
-
- defaults to empty array when loading
|
|
330
|
-
|
|
331
|
-
## 0.2.0-beta.6
|
|
332
|
-
|
|
333
|
-
### Minor Changes
|
|
334
|
-
|
|
335
|
-
- add debug option
|
|
336
|
-
|
|
337
|
-
## 0.2.0-beta.5
|
|
338
|
-
|
|
339
|
-
### Minor Changes
|
|
340
|
-
|
|
341
|
-
- schema validation bugfix
|
|
342
|
-
|
|
343
|
-
## 0.2.0-beta.4
|
|
344
|
-
|
|
345
|
-
### Minor Changes
|
|
346
|
-
|
|
347
|
-
- add schema validation
|
|
348
|
-
|
|
349
|
-
## 0.2.0-beta.3
|
|
350
|
-
|
|
351
|
-
### Minor Changes
|
|
352
|
-
|
|
353
|
-
- remove sync lib
|
|
354
|
-
- 4841960: test build
|
|
355
|
-
- remove sync library
|
|
356
|
-
|
|
357
|
-
## 0.2.0-beta.2
|
|
358
|
-
|
|
359
|
-
### Minor Changes
|
|
360
|
-
|
|
361
|
-
- rebuild tsup
|
|
362
|
-
|
|
363
|
-
## 0.2.0-beta.1
|
|
364
|
-
|
|
365
|
-
### Minor Changes
|
|
366
|
-
|
|
367
|
-
- dependency updates
|
|
368
|
-
- 13594a9: added basic-sync
|
|
369
|
-
- dependency update
|
|
370
|
-
|
|
371
|
-
### Patch Changes
|
|
372
|
-
|
|
373
|
-
- 3c7b34e: version changes mostly
|
|
374
|
-
- Updated dependencies [3c7b34e]
|
|
375
|
-
- Updated dependencies
|
|
376
|
-
- @repo/sync@0.1.0-beta.0
|
|
377
|
-
|
|
378
|
-
## 0.1.1-beta.0
|
|
379
|
-
|
|
380
|
-
### Patch Changes
|
|
381
|
-
|
|
382
|
-
- c085672: reset versions
|
|
383
|
-
|
|
384
|
-
## 1.1.0
|
|
385
|
-
|
|
386
|
-
### Minor Changes
|
|
387
|
-
|
|
388
|
-
- testing
|
|
389
|
-
|
|
390
|
-
## 1.1.0
|
|
391
|
-
|
|
392
|
-
### Minor Changes
|
|
393
|
-
|
|
394
|
-
- 9da7748: hello :)
|
|
395
|
-
- fixes auth token on refresh
|
|
396
|
-
|
|
397
|
-
# 1.3.3
|
|
398
|
-
|
|
399
|
-
- fixed db.get()
|
|
400
|
-
- fixed auth endpoint
|
|
401
|
-
|
|
402
|
-
# 1.3.2
|
|
403
|
-
|
|
404
|
-
# added database apis (expirimental)
|
|
405
|
-
|
|
406
|
-
# 1.3.1
|
|
407
|
-
|
|
408
|
-
- addded auth
|