Drop dependency on package:universal_io
#329
Merged
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.
package:powersync_core
has a dependency onpackage:universal_io
to conditionally use thesleep
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 ordart compile js
) overlook that and still compile code importingdart:io
(using a throwing implementation at runtime). However, there are stricter toolchains (such as e.g. thebuild_web_compilers
package commonly used for non-Flutter Dart web projects) which refuse to compile sources transitively importingdart: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.