Skip to content

Conversation

simolus3
Copy link
Contributor

package:powersync_core has a dependency on package:universal_io to conditionally use the sleep method to delay opening a database when it's locked.

An issue with that package is that it exports dart:io, which is supposed to be unavailable on the web. Most compilers (such as the configuration used by Flutter or dart compile js) overlook that and still compile code importing dart:io (using a throwing implementation at runtime). However, there are stricter toolchains (such as e.g. the build_web_compilers package commonly used for non-Flutter Dart web projects) which refuse to compile sources transitively importing dart:io.

To allow PowerSync to be used with such projects, this refactors the open factory to avoid that dependency.

I've also raised the minimum version of package:sqlite3_flutter_libs, which closes #328.

Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

Happy with the changes :)

@simolus3 simolus3 merged commit a2b8d76 into main Sep 22, 2025
5 checks passed
@simolus3 simolus3 deleted the drop-universal-io branch September 22, 2025 14:37
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.

Upgrade sqlite3_flutter_libs to version 0.5.25 to support memory page size requirement from Google for Android
2 participants