Upgrade to PowerSync JS SDK v2 with checkpoint-request refresh - #66
Merged
Merged
Conversation
- Upgrade @powersync/web to 2.3.0 and @powersync/react to 2.0.1 - Simplify System.ts: v2 open options, SDK-managed multi-tab, OPFS probe only - Add a Refresh button backed by requestCheckpoint() with checkpointMode "requests" - Replace the legacy sync-rules.yaml with a Sync Streams sync-config.yaml - Standardize on pnpm: CI workflow, README, packageManager pin, drop npm lockfile - Install the PowerSync agent skill under .agents/skills/powersync - Add CLAUDE.md repo guidance Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Runs the skill's own trim script (scripts/trim.mjs --apply) to drop the Dart, Kotlin, Swift, .NET, and Terraform reference files this repo does not use. The decision is recorded in .trim-state.json; reinstalling the skill restores the full copy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kobiebotha
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Upgrades the template from
@powersync/web1.34 /@powersync/react1.9 to the v2 SDK line and adds a data refresh flow built on checkpoint requests, the new v2.3.0 API. Also migrates the cloud configuration path to Sync Streams and standardizes the repo on pnpm.Work Done
SDK v2 upgrade
@powersync/webto 2.3.0 and@powersync/reactto 2.0.1.src/powersync/System.tsfor the v2 constructor: open options move underdatabase: {...}, soWASQLiteOpenFactoryand theflagswrapper are gone. The logger moves tocreateConsoleLogger.OPFSCoopSyncVFSis stable on Safari. Only the runtime OPFS probe remains, because Safari Private Browsing exposes the OPFS API but rejectsgetDirectory().SupabaseConnectorfor v2 types:CommonPowerSyncDatabasereplacesAbstractPowerSyncDatabase, andfetchCredentials()now returns anexpiresAthint.status.dataFlowStatusreads withstatus.uploadingandstatus.downloading.@journeyapps/wa-sqlitedependency. It's now a regular dependency of@powersync/web.Checkpoint requests (alpha API, requires PowerSync Service 1.24.0 or later)
checkpointMode: "requests".App.tsxthat callspowerSync.requestCheckpoint()and thencheckpoint.waitForSync()with a 30 second abort signal. When the wait resolves, the local database reflects server state from the time of the request, and the existing watch query re-renders on its own.Sync Streams for the cloud path
sync-rules.yamlwithsync-config.yaml(edition 3), matching thesync_configblock indocker/powersync.yaml.powersync login,powersync init cloud,powersync link cloud --create,powersync deploy.Tooling
pnpm/action-setupwith the Node version from.nvmrc,packageManageris pinned inpackage.json, andpackage-lock.jsonis removed..agents/skills/powersync(with a.claude/skillssymlink andskills-lock.json), so coding agents in this repo pick up PowerSync best practices. ESLint ignores.agents/.vite-plugin-wasmtodevDependencies. Intentionally does not addvite-plugin-top-level-await: it breaks the v2 worker bundle under Vite 7 with Rollup 4, and Vite 7's default build target supports top-level await natively.CLAUDE.mdwith repo guidance for Claude Code.How to Test
pnpm install.pnpm lint,pnpm type-check, andpnpm build.pnpm dev:supabase, thendocker compose -f docker/compose.yaml pull(the service must be 1.24.0 or later for checkpoint requests), thenpnpm dev:powersyncandpnpm dev:ui.connected: trueand the console logsusing VFS: OPFSCoopSyncVFSin Chrome.countdirectly in Supabase Studio, click Refresh in the app, and confirm the new value appears once the button returns from its refreshing state.Lint, type-check, and build pass locally. The live end-to-end steps above have not been run against this branch yet, so please run them during review.
AI Disclosure
This PR was researched, written, and prepared by Claude Code (model: Claude Fable 5), directed and reviewed by @michaelbarnes. API usage was verified against the installed v2 package type definitions, the PowerSync docs, and the package changelogs rather than model memory. Please review with the usual scrutiny for AI-assisted changes, in particular the VFS selection in
System.tsand the README cloud CLI flow.🤖 Generated with Claude Code