@basictech/react 0.9.0-beta.1 → 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/package.json CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "name": "@basictech/react",
3
- "version": "0.9.0-beta.1",
4
- "description": "",
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
- "prepublishOnly": "npm run build",
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
- "semver": "^7.7.2",
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
- "@repo/typescript-config": "*",
47
- "@types/react": "^19.0.0",
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": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
59
+ "react": ">=18"
57
60
  }
58
61
  }
package/changelog.md DELETED
@@ -1,442 +0,0 @@
1
- # 1.3.4
2
-
3
- ## 0.9.0-beta.1
4
-
5
- ### Minor Changes
6
-
7
- Local-first startup, anonymous mode, and multiple users.
8
-
9
- - **Anonymous mode (default on):** the local database works without a
10
- session — writes queue as ordinary ops in a local-only workspace (sync
11
- status `local`) and merge into the account automatically on sign-in via
12
- the normal bootstrap+flush path (deferred identity — no copy step). Set
13
- `anonymous={false}` on the provider for classic sign-in-required behavior.
14
- - **Offline cold start fixed:** the engine opens the local keyspace with no
15
- token and no network (`openLocal()`), so reloading offline serves all data
16
- from the replica; the connection acquires tokens with retry on its own.
17
- `reauth_required` now *pauses* the connection instead of stopping the
18
- engine — local reads/writes keep working while the user re-authenticates.
19
- - **Multiple users:** several local users (anonymous or signed-in) side by
20
- side with per-tab switching. New `useUsers()` hook
21
- (`users`, `activeUser`, `switchUser`, `addUser`, `removeUser`), profile
22
- registry in localStorage, per-user auth storage namespacing and isolated
23
- sync keyspaces (`basic-sync:{project}:{userId}`). Existing single-user
24
- sessions are adopted as the first profile automatically.
25
- - **Owner guard:** keyspaces are stamped with the account DID at bootstrap;
26
- local data from one account can never merge into another (a mismatched
27
- keyspace is wiped before bootstrap). Also fixes a latent leak where
28
- unpushed ops could survive an account change.
29
- - **User-aware `useQuery`:** the active user id is appended to query deps
30
- automatically so live queries re-attach on user switches; in-flight
31
- queries hitting a closing store during the switch return undefined and
32
- re-run.
33
- - `signOut()` now wipes the active user's data and falls through to the next
34
- local user (or a fresh anonymous workspace); `useAuth()` exposes
35
- `isAnonymous`; sync status gains `local`.
36
-
37
- ## 0.9.0-beta.0
38
-
39
- ### Major Changes (breaking)
40
-
41
- Ground-up rewrite for the server's Sync/2 sync engine and Step 2 auth upgrade.
42
- The legacy dexie-syncable `/ws` protocol was removed server-side (clean
43
- break), so 0.8.x sync no longer works against production.
44
-
45
- - **New sync engine** (`core/sync/`): implements the Sync/2 client contract
46
- (SYNC_V2.md) — snapshot bootstrap, multiplexed WebSocket subscriptions,
47
- client-minted idempotent ops (`put`/`patch`/`delete`), persisted pending
48
- queue with optimistic rebase, ordered apply with echo confirmation,
49
- poison-op handling for terminal rejections, and re-bootstrap recovery
50
- (`SNAPSHOT_REQUIRED`/`RESET_REQUIRED`). Local persistence is plain Dexie
51
- (dexie-syncable/dexie-observable removed).
52
- - **New public API**: `db.table(name)` with `create/put/patch/delete/get/
53
- getAll/find`; `useAuth`, `useDb`, `useSyncStatus`, `useShares`, `useShare`;
54
- `useBasic` remains the umbrella hook. `useQuery` still provides live reads.
55
- - **Shares v1**: list shares and mount shared data via `useShare(shareId)` —
56
- separate local keyspace per mount, guest writes when permitted, revocation
57
- handling.
58
- - **Auth updates**: `signOut()` revokes server-side via `POST /auth/logout`;
59
- sign-out (incl. cross-tab) tears down local data without page reloads;
60
- token-endpoint 429s are treated as transient; `CONNECTION_REVOKED` from
61
- sync triggers session reconciliation.
62
- - **REST mode**: `mode="rest"` replaces `dbMode="remote"`, backed by the
63
- REST v2 surface (`/account/:project_id/db/...`), including
64
- snapshot/changes endpoints.
65
- - Tests: vitest unit suite + integration suite against the Sync/2 reference
66
- server (`basic-server/sync-playground`).
67
-
68
- ## 0.8.0-beta.4
69
-
70
- ### Patch Changes
71
-
72
- - 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()`
73
-
74
- ## 0.8.0-beta.3
75
-
76
- ### Patch Changes
77
-
78
- - 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
79
-
80
- ## 0.8.0-beta.2
81
-
82
- ### Minor Changes
83
-
84
- - added debug bar
85
-
86
- ## 0.8.0-beta.1
87
-
88
- ### Minor Changes
89
-
90
- - uth updates
91
-
92
- ## 0.8.0-beta.0
93
-
94
- ### Minor Changes
95
-
96
- - Overhaul auth system: extract AuthManager, add PKCE, cross-tab sync, proactive token refresh, enriched error handling, and fix DELETE Content-Type issue
97
-
98
- ## Unreleased
99
-
100
- ### Patch Changes
101
-
102
- - **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.
103
-
104
- ## 0.7.0
105
-
106
- ### Minor Changes
107
-
108
- - 6a506e9: api improvements, react refactor, nextjs update
109
- - e45744e: localstorage update
110
- - e45744e: storage adapater update
111
- - update apis, add remote db + sync db
112
-
113
- ### Patch Changes
114
-
115
- - cdf7123: refresh token patch
116
- - 7e68aa3: add oauth settings
117
- - 841839f: fix: provider props
118
- - 7e68aa3: update token endpoint
119
- - 4f11b3e: config server url & token patch
120
-
121
- ## 0.7.0-beta.7
122
-
123
- ### Minor Changes
124
-
125
- - api improvements, react refactor, nextjs update
126
-
127
- ## 0.7.0-beta.6
128
-
129
- ### Patch Changes
130
-
131
- - refresh token patch
132
-
133
- ## 0.7.0-beta.5
134
-
135
- ### Patch Changes
136
-
137
- - config server url & token patch
138
-
139
- ## 0.7.0-beta.4
140
-
141
- ### Patch Changes
142
-
143
- - fix: provider props
144
-
145
- ## 0.7.0-beta.3
146
-
147
- ### Patch Changes
148
-
149
- - add oauth settings
150
-
151
- ## 0.7.0-beta.2
152
-
153
- ### Patch Changes
154
-
155
- - update token endpoint
156
-
157
- ## 0.7.0-beta.1
158
-
159
- ### Minor Changes
160
-
161
- - storage adapater update
162
-
163
- ## 0.7.0-beta.0
164
-
165
- ### Minor Changes
166
-
167
- - localstorage update
168
-
169
- ## 0.6.0
170
-
171
- ### Minor Changes
172
-
173
- - d241ffa: suerver url patch
174
-
175
- ### Patch Changes
176
-
177
- - Updated dependencies
178
- - @basictech/schema@0.6.0
179
-
180
- ## 0.6.0-beta.0
181
-
182
- ### Minor Changes
183
-
184
- - suerver url patch
185
-
186
- ## 0.5.0
187
-
188
- ### Minor Changes
189
-
190
- - 6765047: fix server url
191
- - af26a15: include schema to sync
192
- - 783ecad: reset db on signout
193
- - 6dd6ad9: add react 19
194
- - f9c25a3: fix update notif
195
- - 7f42c2a: react - initdb and version check
196
- - weee
197
-
198
- ## 0.5.0-beta.5
199
-
200
- ### Minor Changes
201
-
202
- - fix update notif
203
-
204
- ## 0.5.0-beta.4
205
-
206
- ### Minor Changes
207
-
208
- - react - initdb and version check
209
-
210
- ## 0.5.0-beta.3
211
-
212
- ### Minor Changes
213
-
214
- - add react 19
215
-
216
- ## 0.5.0-beta.2
217
-
218
- ### Minor Changes
219
-
220
- - fix server url
221
-
222
- ## 0.5.0-beta.1
223
-
224
- ### Minor Changes
225
-
226
- - include schema to sync
227
-
228
- ## 0.5.0-beta.0
229
-
230
- ### Minor Changes
231
-
232
- - reset db on signout
233
-
234
- ## 0.4.0
235
-
236
- ### Minor Changes
237
-
238
- - a41eb20: schema validation to react client
239
- - b572027: patch - occasional sync disconnect
240
-
241
- ### Patch Changes
242
-
243
- - Updated dependencies
244
- - Updated dependencies [a41eb20]
245
- - Updated dependencies [c76951e]
246
- - @basictech/schema@0.5.0
247
-
248
- ## 0.4.0-beta.1
249
-
250
- ### Patch Changes
251
-
252
- - Updated dependencies
253
- - @basictech/schema@0.5.0-beta.1
254
-
255
- ## 0.4.0-beta.0
256
-
257
- ### Minor Changes
258
-
259
- - a41eb20: schema validation to react client
260
- - patch - occasional sync disconnect
261
-
262
- ### Patch Changes
263
-
264
- - Updated dependencies [a41eb20]
265
- - @basictech/schema@0.5.0-beta.0
266
-
267
- ## 0.3.0
268
-
269
- ### Minor Changes
270
-
271
- - schema validation in react client
272
-
273
- ### Patch Changes
274
-
275
- - Updated dependencies
276
- - @basictech/schema@0.4.0
277
-
278
- ## 0.2.2
279
-
280
- ### Patch Changes
281
-
282
- - Updated dependencies [f9ad8d1]
283
- - @basictech/schema@0.3.0
284
-
285
- ## 0.2.1
286
-
287
- ### Patch Changes
288
-
289
- - Updated dependencies
290
- - @basictech/schema@0.2.0
291
-
292
- ## 0.2.0
293
-
294
- ### Minor Changes
295
-
296
- - 5890f4c: changed isLoaded to isAuthReady and fixed dbStatus hooks for useBasic
297
- - ba294c5: dependency updates
298
- - cd827af: add schema validation
299
- - 1a3fe80: schema validation bugfix
300
- - 13594a9: added basic-sync
301
- - ba294c5: dependency update
302
- - f035281: remove sync lib
303
- - 4841960: rebuild tsup
304
- - 96e0156: update schema validation
305
- - cda3d16: add schema validation
306
- - 2c898ae: update useQuery hook
307
- - no need to pass param as a function, can now enter query directly
308
- - defaults to empty array when loading
309
-
310
- - 90ccdd7: add debug option
311
- - 4841960: test build
312
- - f035281: remove sync library
313
- - ef528e9: added schema package - test
314
-
315
- ### Patch Changes
316
-
317
- - 3c7b34e: version changes mostly
318
- - c085672: reset versions
319
- - Updated dependencies [96e0156]
320
- - Updated dependencies [ef528e9]
321
- - @basictech/schema@0.1.0
322
-
323
- ## 0.2.0-beta.11
324
-
325
- ### Minor Changes
326
-
327
- - update schema validation
328
-
329
- ### Patch Changes
330
-
331
- - Updated dependencies
332
- - @basictech/schema@0.1.0-beta.1
333
-
334
- ## 0.2.0-beta.10
335
-
336
- ### Minor Changes
337
-
338
- - added schema package - test
339
-
340
- ### Patch Changes
341
-
342
- - Updated dependencies
343
- - @basictech/schema@0.1.0-beta.0
344
-
345
- ## 0.2.0-beta.9
346
-
347
- ### Minor Changes
348
-
349
- - add schema validation
350
-
351
- ## 0.2.0-beta.8
352
-
353
- ### Minor Changes
354
-
355
- - changed isLoaded to isAuthReady and fixed dbStatus hooks for useBasic
356
-
357
- ## 0.2.0-beta.7
358
-
359
- ### Minor Changes
360
-
361
- - update useQuery hook
362
- - no need to pass param as a function, can now enter query directly
363
- - defaults to empty array when loading
364
-
365
- ## 0.2.0-beta.6
366
-
367
- ### Minor Changes
368
-
369
- - add debug option
370
-
371
- ## 0.2.0-beta.5
372
-
373
- ### Minor Changes
374
-
375
- - schema validation bugfix
376
-
377
- ## 0.2.0-beta.4
378
-
379
- ### Minor Changes
380
-
381
- - add schema validation
382
-
383
- ## 0.2.0-beta.3
384
-
385
- ### Minor Changes
386
-
387
- - remove sync lib
388
- - 4841960: test build
389
- - remove sync library
390
-
391
- ## 0.2.0-beta.2
392
-
393
- ### Minor Changes
394
-
395
- - rebuild tsup
396
-
397
- ## 0.2.0-beta.1
398
-
399
- ### Minor Changes
400
-
401
- - dependency updates
402
- - 13594a9: added basic-sync
403
- - dependency update
404
-
405
- ### Patch Changes
406
-
407
- - 3c7b34e: version changes mostly
408
- - Updated dependencies [3c7b34e]
409
- - Updated dependencies
410
- - @repo/sync@0.1.0-beta.0
411
-
412
- ## 0.1.1-beta.0
413
-
414
- ### Patch Changes
415
-
416
- - c085672: reset versions
417
-
418
- ## 1.1.0
419
-
420
- ### Minor Changes
421
-
422
- - testing
423
-
424
- ## 1.1.0
425
-
426
- ### Minor Changes
427
-
428
- - 9da7748: hello :)
429
- - fixes auth token on refresh
430
-
431
- # 1.3.3
432
-
433
- - fixed db.get()
434
- - fixed auth endpoint
435
-
436
- # 1.3.2
437
-
438
- # added database apis (expirimental)
439
-
440
- # 1.3.1
441
-
442
- - addded auth