@checkstack/frontend 0.2.20 → 0.2.21

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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @checkstack/frontend
2
2
 
3
+ ## 0.2.21
4
+
5
+ ### Patch Changes
6
+
7
+ - e01945b: Reduce excessive /api/auth/get-session requests
8
+
9
+ - Enable better-auth's `cookieCache` on the server (5-minute TTL) so repeated session
10
+ checks verify a signed cookie instead of querying the database. Compatible with
11
+ horizontal scaling since validation uses the shared `BETTER_AUTH_SECRET`.
12
+
13
+ - Introduce a `SessionProvider` React context that fetches the session exactly once
14
+ at the top of the component tree. All 7+ components that previously called
15
+ `useSession()` independently now read from this shared context — eliminating
16
+ duplicate HTTP requests on every page load.
17
+
18
+ - Remove the `useAuthClient()` hook which created per-component better-auth client
19
+ instances via `useMemo`, causing separate nanostore atoms and independent fetches.
20
+ All imperative usages (signIn, signUp, resetPassword, etc.) now use the singleton
21
+ `getAuthClientLazy()` instead.
22
+
23
+ - Updated dependencies [e01945b]
24
+ - @checkstack/auth-frontend@0.5.16
25
+ - @checkstack/catalog-frontend@0.5.5
26
+
3
27
  ## 0.2.20
4
28
 
5
29
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/frontend",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "checkstack": {
5
5
  "type": "frontend"
6
6
  },
package/src/App.tsx CHANGED
@@ -38,6 +38,7 @@ import {
38
38
  AmbientBackground,
39
39
  } from "@checkstack/ui";
40
40
  import { SignalProvider } from "@checkstack/signal-frontend";
41
+ import { SessionProvider } from "@checkstack/auth-frontend";
41
42
  import { usePluginLifecycle } from "./hooks/usePluginLifecycle";
42
43
  import { useCommands, useGlobalShortcuts } from "@checkstack/command-frontend";
43
44
 
@@ -278,11 +279,13 @@ function AppWithApis() {
278
279
  <QueryClientProvider client={queryClient}>
279
280
  <ApiProvider registry={apiRegistry}>
280
281
  <OrpcQueryProvider>
281
- <SignalProvider backendUrl={baseUrl}>
282
- <ToastProvider>
283
- <AppContent />
284
- </ToastProvider>
285
- </SignalProvider>
282
+ <SessionProvider>
283
+ <SignalProvider backendUrl={baseUrl}>
284
+ <ToastProvider>
285
+ <AppContent />
286
+ </ToastProvider>
287
+ </SignalProvider>
288
+ </SessionProvider>
286
289
  </OrpcQueryProvider>
287
290
  </ApiProvider>
288
291
  {/* DevTools only in development - toggle with keyboard or floating button */}