Skip to content

Commit

Permalink
Backport package:web upgrade for drift 2.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Aug 13, 2024
1 parent 7449479 commit 4863513
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions drift/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.19.2

- Support version `1.x` of `package:web`.

## 2.19.1

- Fix `exclusively` breaking the database connection on the web. Please note
Expand Down
4 changes: 2 additions & 2 deletions drift/lib/src/web/wasm_setup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class WasmDatabaseOpener {
Future<void> _probeDedicated() async {
if (supportsWorkers) {
final dedicatedWorker = _dedicatedWorker =
_DriftWorker.dedicated(web.Worker(driftWorkerUri.toString()));
_DriftWorker.dedicated(web.Worker(driftWorkerUri.toString().toJS));
_createCompatibilityCheck().sendTo(dedicatedWorker.send);

final status = await dedicatedWorker.workerMessages.nextNoError
Expand All @@ -134,7 +134,7 @@ class WasmDatabaseOpener {
Future<void> _probeShared() async {
if (supportsSharedWorkers) {
final sharedWorker =
web.SharedWorker(driftWorkerUri.toString(), 'drift worker'.toJS);
web.SharedWorker(driftWorkerUri.toString().toJS, 'drift worker'.toJS);
final port = sharedWorker.port;
final shared = _sharedWorker = _DriftWorker.shared(sharedWorker, port);

Expand Down
2 changes: 1 addition & 1 deletion drift/lib/src/web/wasm_setup/shared.dart
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class DriftServerController {
final options = WasmVfs.createOptions(
root: pathForOpfs(databaseName),
);
final worker = Worker(Uri.base.toString());
final worker = Worker(Uri.base.toString().toJS);

StartFileSystemServer(options).sendToWorker(worker);

Expand Down
2 changes: 1 addition & 1 deletion drift/lib/src/web/wasm_setup/shared_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SharedDriftWorker {
version: ProtocolVersion.current,
);
} else {
final worker = _dedicatedWorker ??= Worker(Uri.base.toString());
final worker = _dedicatedWorker ??= Worker(Uri.base.toString().toJS);

// Ask the worker about the storage implementations it can support.
RequestCompatibilityCheck(databaseName).sendToWorker(worker);
Expand Down
4 changes: 2 additions & 2 deletions drift/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: drift
description: Drift is a reactive library to store relational data in Dart and Flutter applications.
version: 2.19.1
version: 2.19.2
repository: https://github.com/simolus3/drift
homepage: https://drift.simonbinder.eu/
issue_tracker: https://github.com/simolus3/drift/issues
Expand All @@ -18,7 +18,7 @@ dependencies:
sqlite3: ^2.4.3
path: ^1.8.0
stack_trace: ^1.11.1
web: ^0.5.0
web: ^1.0.0

dev_dependencies:
archive: ^3.3.1
Expand Down

0 comments on commit 4863513

Please sign in to comment.