Skip to content

Conversation

@koistya
Copy link
Member

@koistya koistya commented Dec 4, 2025

Summary

Major dependency updates with breaking changes to tRPC client configuration and passkey authentication flow.

Runtime & Build

  • Bun 1.2.21 → 1.3.3 (minimum requirement now >=1.3.0)
  • TypeScript 5.9.2 → 5.9.3
  • React/React-DOM 19.x → 19.2.1

tRPC v11 Migration

  • Migrate to createTRPCOptionsProxy pattern (replaces createTRPCReact)
  • Remove api.Provider wrapper (no longer needed in v11)
  • Move auth error handling to global mutations.onError

Better Auth 1.4+ Passkey

  • Import passkey from @better-auth/passkey (now separate package)
  • Simplify WebAuthn flow—no email required for passkey sign-in
  • Gate conditional UI behind authConfig.passkey.enableConditionalUI
  • Add passkey audit fields: lastUsedAt, deviceName, platform

Database Schema

  • Add indexes on all FK columns for query performance
  • Add composite unique constraints (member, team_member, identity, invitation)
  • Add invitation_status enum with lifecycle timestamps
  • Add updatedAt to all tables for consistent audit trails
  • Rename WRANGLER_HYPERDRIVE_*CLOUDFLARE_HYPERDRIVE_*

Other Improvements

  • WebSocket protocol: use ws-kit canonical imports, add Ping/Pong timestamps
  • UI scripts: replace execa/globby with Bun native APIs (Bun.spawn, Bun.Glob)
  • ESLint: extend TS parser to .tsx, fix React config

Breaking Changes

tRPC v11 Client

// Before (v10)
import { createTRPCReact } from "@trpc/react-query";
const api = createTRPCReact<AppRouter>();

<api.Provider client={trpcClient} queryClient={queryClient}>
  <App />
</api.Provider>

// After (v11)
import { createTRPCClient } from "@trpc/client";
import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";

const trpcClient = createTRPCClient<AppRouter>({ links });
const api = createTRPCOptionsProxy<AppRouter>({ client: trpcClient, queryClient });

<QueryClientProvider client={queryClient}>
  <App />  {/* No api.Provider needed */}
</QueryClientProvider>

Passkey Authentication

// Before (pre-1.4)
import { passkey } from "better-auth/plugins/passkey";
await auth.signIn.passkey({ email });  // Email required

// After (1.4+)
import { passkey } from "@better-auth/passkey";
await auth.signIn.passkey();  // WebAuthn handles user discovery

Environment Variables

# Before
WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_API

# After
CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_API

Migration Guide

  1. Update Bun to 1.3.0 or later
  2. tRPC v11: Remove api.Provider wrapper, update client creation pattern
  3. Better Auth: Install @better-auth/passkey, remove email from passkey sign-in
  4. Environment: Rename WRANGLER_HYPERDRIVE_* to CLOUDFLARE_HYPERDRIVE_*
  5. Database: Run migrations for new indexes and constraints

Ref #2108 #2114

- TypeScript 5.9.2 → 5.9.3
- @types/node 24.3.1 → 24.10.1
- ESLint plugins and related tooling
- ESLint config: extend TS parser to tsx, fix React config
- React, react-dom 19.2.1
- @types/react 19.2.7, @types/react-dom 19.2.3
- @vitejs/plugin-react 5.1.1, plugin-react-swc 4.2.2
- @eslint-react/eslint-plugin 2.3.12
- Migrate tRPC client to v11 API (createTRPCOptionsProxy)
- Remove api.Provider wrapper (no longer needed in v11)
- Update passkey import to @better-auth/passkey/client
- Bump dependencies across packages
- Use canonical imports (withPubSub from @ws-kit/pubsub)
- Add timestamp payload to Ping/Pong messages
- Simplify AppData interface with Record<string, unknown>
- Remove sendError helper with complex typing
- Add explicit Router<AppData> return type
- Update README examples to match implementation
- Import passkey from @better-auth/passkey (now separate package)
- Simplify passkey-login component to match WebAuthn API (no email needed)
- Gate conditional UI behind authConfig.passkey.enableConditionalUI
- Fix error handling to use result.error.code instead of unreachable catch
- Add try/catch/finally for network-level failures
- Remove composite mode from app tsconfig to avoid TS2742 errors
…th compatibility

- Add indexes on all FK columns for query performance
- Add composite unique constraints (member, team_member, identity, invitation)
- Add invitation_status enum with lifecycle timestamps (acceptedAt, rejectedAt)
- Add passkey audit fields (lastUsedAt, deviceName, platform)
- Add updatedAt to all tables for consistent audit trails
- Rename DbSchema to DatabaseSchema for clarity
- Rename WRANGLER_HYPERDRIVE_* env vars to CLOUDFLARE_HYPERDRIVE_*
- Streamline db/CLAUDE.md and db/README.md documentation
- Use import.meta.env.DEV consistently in loggerLink (Vite pattern)
- Move auth error handling to global mutation onError (actually works)
- Remove ineffective setQueryDefaults/setMutationDefaults (key mismatch)
- Replace execa/globby with Bun.spawn and Bun.Glob
- Rename scripts to remove redundant ui- prefix
- Use import.meta.dirname instead of fileURLToPath
- Switch root scripts from --filter to --cwd for cleaner output
@koistya koistya changed the title chore: update Bun to 1.3.x Update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 Dec 5, 2025
@koistya koistya changed the title Update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 chore: Update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 Dec 5, 2025
@koistya koistya changed the title chore: Update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 chore: update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 Dec 5, 2025
@koistya koistya marked this pull request as ready for review December 5, 2025 21:58
@koistya koistya changed the title chore: update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 chore(deps): update Bun 1.3, tRPC v11, React 19.2, Better Auth 1.4 Dec 5, 2025
@koistya koistya merged commit 2d2e0f4 into main Dec 5, 2025
11 of 12 checks passed
@koistya koistya deleted the dev branch December 5, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants