Skip to content

Remove JavaScript sync client#938

Merged
simolus3 merged 10 commits into
mainfrom
remove-js-sync-client
May 4, 2026
Merged

Remove JavaScript sync client#938
simolus3 merged 10 commits into
mainfrom
remove-js-sync-client

Conversation

@simolus3

@simolus3 simolus3 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This removes the JavaScript client implementation, leaving the existing default (Rust) as the only option. That removes about 2k lines we no longer have to maintain, and should slightly decrease the bundle size for our users.

The changes to AbstractStreamingSyncImplementation.ts should be uncontroversial, they just involve deleting the old client. The rest of this PRs applies simplifications to build scripts and reduces our dependency footprint. That deserves some explanations:

  • To delete unused code from @powersync/common, I've removed TypeScript definitions for sync protocol lines and bucket storage methods used to implement the old sync client. We still want to be able to use those types in tests though. So I've added a types-only export to @powersync/common for that purpose.
  • This also removes the bson dependency from our SDKs. There's nothing really wrong with that package anymore (as in, it doesn't require top-level async or polyfills since version 6), but it's evectively unused and fewer dependencies are always better. The only remaining place involving BSON was to encode the sync request body for RSocket. Old versions (1.11.3 and older) of the PowerSync service didn't accept JSON payloads there, so this drops compatibility with them. Due to an oversight on my part, the Rust client never passed a BSON encoder to that method though. So adding the Rust client implicitly dropped support for those old versions, and I'm not aware of any complaints since we've made it the default. At this point, I think the simplification of not having the BSON dependency around anymore outweighs backwards-compatibility.

@changeset-bot

changeset-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7e12be0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@powersync/react-native Minor
@powersync/common Minor
@powersync/web Minor
@powersync/diagnostics-app Patch
@powersync/node Patch
@powersync/nuxt Patch
@powersync/adapter-sql-js Patch
@powersync/op-sqlite Patch
@powersync/tanstack-react-query Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simolus3 simolus3 marked this pull request as ready for review April 29, 2026 13:54
@simolus3 simolus3 requested a review from stevensJourney April 29, 2026 13:54
stevensJourney
stevensJourney previously approved these changes May 4, 2026

@stevensJourney stevensJourney left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with these changes :)

Comment thread packages/common/package.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product Visibility This requires documentation changes and or announcing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants