diff --git a/CHANGELOG.md b/CHANGELOG.md index 9937c109..e76e3a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,78 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2025-10-06 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`powersync` - `v1.16.1`](#powersync---v1161) + - [`powersync_core` - `v1.6.1`](#powersync_core---v161) + - [`powersync_sqlcipher` - `v0.1.13`](#powersync_sqlcipher---v0113) + +--- + +#### `powersync` - `v1.16.1` + + - Web: Fix decoding sync streams on status. + +#### `powersync_core` - `v1.6.1` + + - Web: Fix decoding sync streams on status. + + - **DOCS**: Point to uses in example. ([4f4da24e](https://github.com/powersync-ja/powersync.dart/commit/4f4da24e580dec6b1d29a5e0907b83ba7c55e3d8)) + +#### `powersync_sqlcipher` - `v0.1.13` + + - Web: Fix decoding sync streams on status. + + +## 2025-10-02 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`powersync_attachments_helper` - `v0.6.20`](#powersync_attachments_helper---v0620) + - [`powersync` - `v1.16.0`](#powersync---v1160) + - [`powersync_core` - `v1.6.0`](#powersync_core---v160) + - [`powersync_flutter_libs` - `v0.4.12`](#powersync_flutter_libs---v0412) + - [`powersync_sqlcipher` - `v0.1.12`](#powersync_sqlcipher---v0112) + +--- + +#### `powersync_attachments_helper` - `v0.6.20` + + - Add note about new attachment queue system in core package. + +#### `powersync` - `v1.16.0` +#### `powersync_core` - `v1.6.0` +#### `powersync_sqlcipher` - `v0.1.12` + +- Add `getCrudTransactions()` returning a stream of completed transactions for uploads. +- Add experimental support for [sync streams](https://docs.powersync.com/usage/sync-streams). +- Add new attachments helper implementation in `package:powersync_core/attachments/attachments.dart`. +- Add SwiftPM support. +- Add support for compiling `powersync_core` with `build_web_compilers`. + +#### `powersync_flutter_libs` - `v0.4.12` + + - Update core extension. + - Add support for SwiftPM. + ## 2025-08-18 ### Changes diff --git a/demos/benchmarks/pubspec.yaml b/demos/benchmarks/pubspec.yaml index b2e1f55a..aea63c20 100644 --- a/demos/benchmarks/pubspec.yaml +++ b/demos/benchmarks/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 path: ^1.8.3 logging: ^1.2.0 diff --git a/demos/django-todolist/pubspec.yaml b/demos/django-todolist/pubspec.yaml index 9b187637..4c1cacff 100644 --- a/demos/django-todolist/pubspec.yaml +++ b/demos/django-todolist/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 path: ^1.8.3 logging: ^1.2.0 diff --git a/demos/firebase-nodejs-todolist/pubspec.yaml b/demos/firebase-nodejs-todolist/pubspec.yaml index 46436e8f..de6ea1fe 100644 --- a/demos/firebase-nodejs-todolist/pubspec.yaml +++ b/demos/firebase-nodejs-todolist/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.1 path: ^1.8.3 diff --git a/demos/supabase-anonymous-auth/pubspec.yaml b/demos/supabase-anonymous-auth/pubspec.yaml index db67696d..b4f44bcb 100644 --- a/demos/supabase-anonymous-auth/pubspec.yaml +++ b/demos/supabase-anonymous-auth/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.2 path: ^1.8.3 diff --git a/demos/supabase-edge-function-auth/pubspec.yaml b/demos/supabase-edge-function-auth/pubspec.yaml index 2dd12558..f1f5ddcb 100644 --- a/demos/supabase-edge-function-auth/pubspec.yaml +++ b/demos/supabase-edge-function-auth/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.2 path: ^1.8.3 diff --git a/demos/supabase-simple-chat/pubspec.yaml b/demos/supabase-simple-chat/pubspec.yaml index a65519af..463278d2 100644 --- a/demos/supabase-simple-chat/pubspec.yaml +++ b/demos/supabase-simple-chat/pubspec.yaml @@ -37,7 +37,7 @@ dependencies: supabase_flutter: ^2.0.2 timeago: ^3.6.0 - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 path: ^1.8.3 logging: ^1.2.0 diff --git a/demos/supabase-todolist-drift/pubspec.yaml b/demos/supabase-todolist-drift/pubspec.yaml index cf0c3f4f..051931b2 100644 --- a/demos/supabase-todolist-drift/pubspec.yaml +++ b/demos/supabase-todolist-drift/pubspec.yaml @@ -9,8 +9,8 @@ environment: dependencies: flutter: sdk: flutter - powersync_attachments_helper: ^0.6.19 - powersync: ^1.15.2 + powersync_attachments_helper: ^0.6.20 + powersync: ^1.16.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.1 path: ^1.8.3 diff --git a/demos/supabase-todolist-optional-sync/pubspec.yaml b/demos/supabase-todolist-optional-sync/pubspec.yaml index a914651c..477f3d02 100644 --- a/demos/supabase-todolist-optional-sync/pubspec.yaml +++ b/demos/supabase-todolist-optional-sync/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - powersync: ^1.15.2 + powersync: ^1.16.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.1 path: ^1.8.3 diff --git a/demos/supabase-todolist/lib/attachments/queue.dart b/demos/supabase-todolist/lib/attachments/queue.dart index 80460daf..8f036c85 100644 --- a/demos/supabase-todolist/lib/attachments/queue.dart +++ b/demos/supabase-todolist/lib/attachments/queue.dart @@ -53,12 +53,3 @@ Future savePhotoAttachment( }, ); } - -Future deletePhotoAttachment(String fileId) async { - return await attachmentQueue.deleteFile( - attachmentId: fileId, - updateHook: (context, attachment) async { - // Optionally update relationships in the same transaction - }, - ); -} diff --git a/demos/supabase-todolist/pubspec.yaml b/demos/supabase-todolist/pubspec.yaml index 53d61b7a..2175e2b4 100644 --- a/demos/supabase-todolist/pubspec.yaml +++ b/demos/supabase-todolist/pubspec.yaml @@ -10,8 +10,8 @@ environment: dependencies: flutter: sdk: flutter - powersync: ^1.15.2 - powersync_core: ^1.5.2 + powersync: ^1.16.1 + powersync_core: ^1.6.1 path_provider: ^2.1.1 supabase_flutter: ^2.0.1 path: ^1.8.3 diff --git a/demos/supabase-trello/pubspec.yaml b/demos/supabase-trello/pubspec.yaml index 15a7dccf..a609124e 100644 --- a/demos/supabase-trello/pubspec.yaml +++ b/demos/supabase-trello/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: random_name_generator: ^1.5.0 flutter_dotenv: ^5.2.1 logging: ^1.3.0 - powersync: ^1.15.2 + powersync: ^1.16.1 sqlite_async: ^0.12.0 path_provider: ^2.1.5 supabase_flutter: ^2.8.3 diff --git a/packages/powersync/CHANGELOG.md b/packages/powersync/CHANGELOG.md index 9cd53047..4f30cb92 100644 --- a/packages/powersync/CHANGELOG.md +++ b/packages/powersync/CHANGELOG.md @@ -1,3 +1,14 @@ +## 1.16.1 + + - Web: Fix decoding sync streams on status. + +## 1.16.0 + +- Add `getCrudTransactions()` returning a stream of completed transactions for uploads. +- Add experimental support for [sync streams](https://docs.powersync.com/usage/sync-streams). +- Add new attachments helper implementation in `package:powersync_core/attachments/attachments.dart`. +- Add SwiftPM support. + ## 1.15.2 - Fix excessive memory consumption during large sync. diff --git a/packages/powersync/pubspec.yaml b/packages/powersync/pubspec.yaml index ad31d0d3..26fffc25 100644 --- a/packages/powersync/pubspec.yaml +++ b/packages/powersync/pubspec.yaml @@ -1,5 +1,5 @@ name: powersync -version: 1.15.2 +version: 1.16.1 homepage: https://powersync.com repository: https://github.com/powersync-ja/powersync.dart description: PowerSync Flutter SDK. Sync Postgres, MongoDB or MySQL with SQLite in your Flutter app @@ -12,8 +12,8 @@ dependencies: sdk: flutter sqlite3_flutter_libs: ^0.5.39 - powersync_core: ^1.5.2 - powersync_flutter_libs: ^0.4.11 + powersync_core: ^1.6.1 + powersync_flutter_libs: ^0.4.12 collection: ^1.17.0 dev_dependencies: diff --git a/packages/powersync_attachments_helper/CHANGELOG.md b/packages/powersync_attachments_helper/CHANGELOG.md index 0aa268e3..f80b8798 100644 --- a/packages/powersync_attachments_helper/CHANGELOG.md +++ b/packages/powersync_attachments_helper/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.20 + + - Add note about new attachment queue system in core package. + ## 0.6.19 - Remove direct dependency on `sqlite_async`. diff --git a/packages/powersync_attachments_helper/README.md b/packages/powersync_attachments_helper/README.md index dbd65bef..c9b5f532 100644 --- a/packages/powersync_attachments_helper/README.md +++ b/packages/powersync_attachments_helper/README.md @@ -1,6 +1,20 @@ # PowerSync Attachments Helper for Dart/Flutter -[PowerSync Attachments Helper](https://pub.dev/packages/powersync_attachments_helper) is a package that assist in keeping files in sync with local and remote storage. +[PowerSync Attachments Helper](https://pub.dev/packages/powersync_attachments_helper) is a package that assists in keeping files in sync between local and remote storage. + +> [!WARNING] +> This package will eventually be replaced by a new attachments helper library in the core PowerSync package, available through: +> ```dart +> package:powersync_core/attachments/attachments.dart +> ``` +> +> The `powersync_core/attachments` library is in alpha and brings improved APIs and functionality that is more in line with our other SDKs, such as the ability to write your own local storage implementation. +> +> Check out the [docs here](https://pub.dev/documentation/powersync_core/latest/topics/attachments-topic.html) to get started. +> +> While the `powersync_attachments_helper` package will still get bug fixes if you need them, +> new features will only be developed on `powersync_core/attachments`. + ## Features @@ -83,5 +97,3 @@ initializeAttachmentQueue(PowerSyncDatabase db) async { await attachmentQueue.init(); } ``` - -See our [Supabase Flutter To-Do List example app](../../demos/supabase-todolist/README.md) for a concrete implementation of the above. diff --git a/packages/powersync_attachments_helper/pubspec.yaml b/packages/powersync_attachments_helper/pubspec.yaml index b705cf09..971228f9 100644 --- a/packages/powersync_attachments_helper/pubspec.yaml +++ b/packages/powersync_attachments_helper/pubspec.yaml @@ -1,6 +1,6 @@ name: powersync_attachments_helper description: A helper library for handling attachments when using PowerSync. -version: 0.6.19 +version: 0.6.20 repository: https://github.com/powersync-ja/powersync.dart homepage: https://www.powersync.com/ environment: @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter - powersync_core: ^1.5.2 + powersync_core: ^1.6.1 logging: ^1.2.0 path_provider: ^2.0.13 diff --git a/packages/powersync_core/CHANGELOG.md b/packages/powersync_core/CHANGELOG.md index ddd78a42..4ba23772 100644 --- a/packages/powersync_core/CHANGELOG.md +++ b/packages/powersync_core/CHANGELOG.md @@ -1,3 +1,17 @@ +## 1.6.1 + + - Web: Fix decoding sync streams on status. + + - **DOCS**: Point to uses in example. ([4f4da24e](https://github.com/powersync-ja/powersync.dart/commit/4f4da24e580dec6b1d29a5e0907b83ba7c55e3d8)) + +## 1.6.0 + +- Add `getCrudTransactions()` returning a stream of completed transactions for uploads. +- Add experimental support for [sync streams](https://docs.powersync.com/usage/sync-streams). +- Add new attachments helper implementation in `package:powersync_core/attachments/attachments.dart`. +- Add SwiftPM support. +- Add support for compiling `powersync_core` with `build_web_compilers`. + ## 1.5.2 - Fix excessive memory consumption during large sync. diff --git a/packages/powersync_core/doc/attachments.md b/packages/powersync_core/doc/attachments.md index aad9b5cb..6919430f 100644 --- a/packages/powersync_core/doc/attachments.md +++ b/packages/powersync_core/doc/attachments.md @@ -5,16 +5,26 @@ PowerSync. Embedding this data directly in your source databases is [inefficient and not recommended](https://docs.powersync.com/usage/use-case-examples/attachments). Instead, the PowerSync SDK for Dart and Flutter provides utilities you can use to _reference_ this binary data -in your primary data model, and then download it from a secondary data store such as S3. +in your regular database schema, and then download it from a secondary data store such as Supabase Storage or S3. Because binary data is not directly stored in the source database in this model, we call these files _attachments_. + +> [!NOTE] +> These attachment utilities are recommended over our legacy [PowerSync Attachments Helper](https://pub.dev/packages/powersync_attachments_helper) package. The new utilities provide cleaner APIs that are more aligned with similar helpers in our other SDKs, and include improved features such as: +> - Support for writing your own local storage implementation +> - Support for dynamic nested directories and custom per-attachment file extensions out of the box +> - Ability to add optional `metaData` to attachments +> - No longer depends on `dart:io` +> +> If you are new to handling attachments, we recommend starting with these utilities. If you currently use the legacy `powersync_attachments_helper` package, a fairly simple migration would be to adopt the new utilities with a different table name and drop the legacy package. This means existing attachments are lost, but they should be downloaded again. + ## Alpha release -The attachment helpers described in this document are currently in an alpha state, intended for testing. +The attachment utilities described in this document are currently in an alpha state, intended for testing. Expect breaking changes and instability as development continues. The attachments API is marked as `@experimental` for this reason. -Do not rely on these libraries for production use. +Do not rely on these utilities for production use. ## Usage @@ -31,8 +41,12 @@ The attachments' state is stored in a local-only attachments table. ### Example implementation -See the [supabase todolist](https://github.com/powersync-ja/powersync.dart/tree/main/demos/supabase-todolist) demo for -a basic example of attachment syncing. +See the [supabase-todolist](https://github.com/powersync-ja/powersync.dart/tree/main/demos/supabase-todolist) demo for a basic example of attachment syncing. + +In particular, relevant snippets from that example are: + +- The attachment queue is set up [here](https://github.com/powersync-ja/powersync.dart/blob/98d73e2f157a697786373fef755576505abc74a5/demos/supabase-todolist/lib/attachments/queue.dart#L16-L36), using conditional imports to store attachments in the file system on native platforms and in-memory for web. +- When a new attachment is added, `saveFile` is called [here](https://github.com/powersync-ja/powersync.dart/blob/98d73e2f157a697786373fef755576505abc74a5/demos/supabase-todolist/lib/attachments/queue.dart#L38-L55) and automatically updates references in the main schema to reference the attachment. ### Setup @@ -77,7 +91,6 @@ final attachmentQueue = AttachmentQueue( ``` Here, - - An instance of `LocalStorageAdapter`, such as the `IOLocalStorage` provided by the SDK, is responsible for storing attachment contents locally. - An instance of `RemoteStorageAdapter` is responsible for downloading and uploading attachment contents to the secondary diff --git a/packages/powersync_core/lib/src/version.dart b/packages/powersync_core/lib/src/version.dart index 26361d4c..211139eb 100644 --- a/packages/powersync_core/lib/src/version.dart +++ b/packages/powersync_core/lib/src/version.dart @@ -1 +1 @@ -const String libraryVersion = '1.5.2'; +const String libraryVersion = '1.6.1'; diff --git a/packages/powersync_core/lib/src/web/sync_worker_protocol.dart b/packages/powersync_core/lib/src/web/sync_worker_protocol.dart index 950cd1d6..0448fe5a 100644 --- a/packages/powersync_core/lib/src/web/sync_worker_protocol.dart +++ b/packages/powersync_core/lib/src/web/sync_worker_protocol.dart @@ -328,8 +328,8 @@ extension type SerializedSyncStatus._(JSObject _) implements JSObject { }, streamSubscriptions: switch (streamSubscriptions) { null => null, - final serialized => (json.decode(serialized) as List) - .map((e) => CoreActiveStreamSubscription.fromJson( + final serialized => (json.decode(serialized) as List?) + ?.map((e) => CoreActiveStreamSubscription.fromJson( e as Map)) .toList(), }, diff --git a/packages/powersync_core/pubspec.yaml b/packages/powersync_core/pubspec.yaml index 929b2d5e..723cd4e9 100644 --- a/packages/powersync_core/pubspec.yaml +++ b/packages/powersync_core/pubspec.yaml @@ -1,5 +1,5 @@ name: powersync_core -version: 1.5.2 +version: 1.6.1 homepage: https://powersync.com repository: https://github.com/powersync-ja/powersync.dart description: PowerSync Dart SDK - sync engine for building local-first apps. diff --git a/packages/powersync_flutter_libs/CHANGELOG.md b/packages/powersync_flutter_libs/CHANGELOG.md index e344e77b..79e23a87 100644 --- a/packages/powersync_flutter_libs/CHANGELOG.md +++ b/packages/powersync_flutter_libs/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.12 + + - Update core extension, add support for SwiftPM. + ## 0.4.11 - Update PowerSync core extension to version 0.4.4. diff --git a/packages/powersync_flutter_libs/pubspec.yaml b/packages/powersync_flutter_libs/pubspec.yaml index 2515531c..a6afea23 100644 --- a/packages/powersync_flutter_libs/pubspec.yaml +++ b/packages/powersync_flutter_libs/pubspec.yaml @@ -1,6 +1,6 @@ name: powersync_flutter_libs description: PowerSync core binaries for the PowerSync Flutter SDK. Needs to be included for Flutter apps. -version: 0.4.11 +version: 0.4.12 repository: https://github.com/powersync-ja/powersync.dart homepage: https://www.powersync.com/ diff --git a/packages/powersync_sqlcipher/CHANGELOG.md b/packages/powersync_sqlcipher/CHANGELOG.md index b037c1eb..33b9cb2f 100644 --- a/packages/powersync_sqlcipher/CHANGELOG.md +++ b/packages/powersync_sqlcipher/CHANGELOG.md @@ -1,3 +1,14 @@ +## 0.1.13 + + - Web: Fix decoding sync streams on status. + +## 0.1.12 + +- Add `getCrudTransactions()` returning a stream of completed transactions for uploads. +- Add experimental support for [sync streams](https://docs.powersync.com/usage/sync-streams). +- Add new attachments helper implementation in `package:powersync_core/attachments/attachments.dart`. +- Add SwiftPM support. + ## 0.1.11+1 - Fix excessive memory consumption during large sync. diff --git a/packages/powersync_sqlcipher/example/pubspec.yaml b/packages/powersync_sqlcipher/example/pubspec.yaml index d7746f71..753aa73a 100644 --- a/packages/powersync_sqlcipher/example/pubspec.yaml +++ b/packages/powersync_sqlcipher/example/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: path: ^1.9.1 path_provider: ^2.1.5 - powersync_sqlcipher: ^0.1.11+1 + powersync_sqlcipher: ^0.1.13 dev_dependencies: flutter_test: diff --git a/packages/powersync_sqlcipher/pubspec.yaml b/packages/powersync_sqlcipher/pubspec.yaml index 6aa109dc..b73913c2 100644 --- a/packages/powersync_sqlcipher/pubspec.yaml +++ b/packages/powersync_sqlcipher/pubspec.yaml @@ -1,5 +1,5 @@ name: powersync_sqlcipher -version: 0.1.11+1 +version: 0.1.13 homepage: https://powersync.com repository: https://github.com/powersync-ja/powersync.dart description: PowerSync Flutter SDK - sync engine for building local-first apps. @@ -12,8 +12,8 @@ dependencies: flutter: sdk: flutter - powersync_core: ^1.5.2 - powersync_flutter_libs: ^0.4.11 + powersync_core: ^1.6.1 + powersync_flutter_libs: ^0.4.12 sqlcipher_flutter_libs: ^0.6.4 sqlite3_web: ^0.3.0