@powersync/web 0.0.0-dev-20251120085122 → 0.0.0-dev-20251126195153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +17 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +14852 -10907
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +12708 -10895
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/lib/package.json +2 -2
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +1 -0
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +11 -2
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +1 -1
- package/lib/src/worker/db/SharedWASQLiteConnection.js +1 -0
- package/lib/src/worker/sync/SharedSyncImplementation.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +12 -2
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +1 -1
- package/src/worker/db/SharedWASQLiteConnection.ts +1 -0
- package/src/worker/sync/SharedSyncImplementation.ts +1 -1
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js +0 -355
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js.map +0 -1
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3461.index.umd.js +0 -355
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3461.index.umd.js.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -38700,6 +38700,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38700
38700
|
/* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_powersync_common__WEBPACK_IMPORTED_MODULE_0__);
|
|
38701
38701
|
/* harmony import */ var _shared_navigator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../..//shared/navigator */ "./lib/src/shared/navigator.js");
|
|
38702
38702
|
/* harmony import */ var _WorkerWrappedAsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WorkerWrappedAsyncDatabaseConnection */ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js");
|
|
38703
|
+
/* harmony import */ var _wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wa-sqlite/WASQLiteConnection */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
|
|
38704
|
+
|
|
38703
38705
|
|
|
38704
38706
|
|
|
38705
38707
|
|
|
@@ -38719,6 +38721,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
|
|
|
38719
38721
|
_disposeTableChangeListener = null;
|
|
38720
38722
|
_config = null;
|
|
38721
38723
|
pendingAbortControllers;
|
|
38724
|
+
requiresHolds;
|
|
38722
38725
|
closing;
|
|
38723
38726
|
closed;
|
|
38724
38727
|
constructor(options) {
|
|
@@ -38729,6 +38732,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
|
|
|
38729
38732
|
this.pendingAbortControllers = new Set();
|
|
38730
38733
|
this.closed = false;
|
|
38731
38734
|
this.closing = false;
|
|
38735
|
+
this.requiresHolds = null;
|
|
38732
38736
|
// Set the name if provided. We can query for the name if not available yet
|
|
38733
38737
|
this.debugMode = options.debugMode ?? false;
|
|
38734
38738
|
if (this.debugMode) {
|
|
@@ -38773,6 +38777,10 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
|
|
|
38773
38777
|
this._config = await this._db.getConfig();
|
|
38774
38778
|
await this.registerOnChangeListener(this._db);
|
|
38775
38779
|
this.iterateListeners((cb) => cb.initialized?.());
|
|
38780
|
+
/**
|
|
38781
|
+
* This is only required for the long-lived shared IndexedDB connections.
|
|
38782
|
+
*/
|
|
38783
|
+
this.requiresHolds = this._config.vfs == _wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_3__.WASQLiteVFS.IDBBatchAtomicVFS;
|
|
38776
38784
|
}
|
|
38777
38785
|
getConfiguration() {
|
|
38778
38786
|
if (!this._config) {
|
|
@@ -38867,12 +38875,14 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
|
|
|
38867
38875
|
if (timoutId) {
|
|
38868
38876
|
clearTimeout(timoutId);
|
|
38869
38877
|
}
|
|
38870
|
-
const holdId = await this.baseDB.markHold();
|
|
38878
|
+
const holdId = this.requiresHolds ? await this.baseDB.markHold() : null;
|
|
38871
38879
|
try {
|
|
38872
38880
|
return await callback();
|
|
38873
38881
|
}
|
|
38874
38882
|
finally {
|
|
38875
|
-
|
|
38883
|
+
if (holdId) {
|
|
38884
|
+
await this.baseDB.releaseHold(holdId);
|
|
38885
|
+
}
|
|
38876
38886
|
}
|
|
38877
38887
|
});
|
|
38878
38888
|
}
|
|
@@ -39132,7 +39142,7 @@ class WorkerWrappedAsyncDatabaseConnection {
|
|
|
39132
39142
|
return this.withRemote(() => this.baseConnection.releaseHold(holdId));
|
|
39133
39143
|
}
|
|
39134
39144
|
isAutoCommit() {
|
|
39135
|
-
return this.baseConnection.isAutoCommit();
|
|
39145
|
+
return this.withRemote(() => this.baseConnection.isAutoCommit());
|
|
39136
39146
|
}
|
|
39137
39147
|
withRemote(workerPromise) {
|
|
39138
39148
|
const controller = this.notifyRemoteClosed;
|
|
@@ -40156,7 +40166,7 @@ class SharedWebStreamingSyncImplementation extends _WebStreamingSyncImplementati
|
|
|
40156
40166
|
}
|
|
40157
40167
|
}
|
|
40158
40168
|
else {
|
|
40159
|
-
this.messagePort = new SharedWorker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("
|
|
40169
|
+
this.messagePort = new SharedWorker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("lib_src_worker_sync_SharedSyncImplementation_worker_js-_journeyapps_wa-sqlite-_journeyapps_wa-4748cf"), __webpack_require__.b), {
|
|
40160
40170
|
/* @vite-ignore */
|
|
40161
40171
|
name: `shared-sync-${this.webOptions.identifier}`,
|
|
40162
40172
|
type: undefined
|
|
@@ -40507,12 +40517,12 @@ function openWorkerDatabasePort(workerIdentifier, multipleTabs = true, worker =
|
|
|
40507
40517
|
* (in the case of Android)
|
|
40508
40518
|
*/
|
|
40509
40519
|
return !needsDedicated && multipleTabs
|
|
40510
|
-
? new SharedWorker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("
|
|
40520
|
+
? new SharedWorker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("lib_src_worker_db_WASQLiteDB_worker_js-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVF-1dc7800"), __webpack_require__.b), {
|
|
40511
40521
|
/* @vite-ignore */
|
|
40512
40522
|
name: `shared-DB-worker-${workerIdentifier}`,
|
|
40513
40523
|
type: undefined
|
|
40514
40524
|
}).port
|
|
40515
|
-
: new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("
|
|
40525
|
+
: new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u("lib_src_worker_db_WASQLiteDB_worker_js-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVF-1dc7801"), __webpack_require__.b), {
|
|
40516
40526
|
/* @vite-ignore */
|
|
40517
40527
|
name: `DB-worker-${workerIdentifier}`,
|
|
40518
40528
|
type: undefined
|
|
@@ -41093,7 +41103,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
|
|
|
41093
41103
|
});
|
|
41094
41104
|
lastClient.closeListeners.push(async () => {
|
|
41095
41105
|
this.logger.info('Aborting open connection because associated tab closed.');
|
|
41096
|
-
|
|
41106
|
+
wrapped.close().catch((ex) => this.logger.warn('error closing database connection', ex));
|
|
41097
41107
|
wrapped.markRemoteClosed();
|
|
41098
41108
|
});
|
|
41099
41109
|
return wrapped;
|