@powersync/web 0.0.0-dev-20251119150914 → 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.
Files changed (35) hide show
  1. package/dist/index.umd.js +36 -11
  2. package/dist/index.umd.js.map +1 -1
  3. package/dist/worker/SharedSyncImplementation.umd.js +14863 -10910
  4. package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
  5. package/dist/worker/WASQLiteDB.umd.js +12733 -10923
  6. package/dist/worker/WASQLiteDB.umd.js.map +1 -1
  7. package/lib/package.json +2 -2
  8. package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +5 -0
  9. package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +1 -0
  10. package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +11 -2
  11. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +1 -0
  12. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +7 -2
  13. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +5 -0
  14. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js +7 -0
  15. package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +4 -3
  16. package/lib/src/worker/db/SharedWASQLiteConnection.js +15 -11
  17. package/lib/src/worker/db/WASQLiteDB.worker.js +2 -2
  18. package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +3 -3
  19. package/lib/src/worker/db/WorkerWASQLiteConnection.js +2 -14
  20. package/lib/src/worker/sync/SharedSyncImplementation.d.ts +2 -2
  21. package/lib/src/worker/sync/SharedSyncImplementation.js +7 -4
  22. package/lib/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +3 -3
  24. package/src/db/adapters/AsyncDatabaseConnection.ts +5 -0
  25. package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +12 -2
  26. package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +8 -2
  27. package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +8 -0
  28. package/src/worker/db/SharedWASQLiteConnection.ts +19 -14
  29. package/src/worker/db/WASQLiteDB.worker.ts +2 -2
  30. package/src/worker/db/WorkerWASQLiteConnection.ts +3 -18
  31. package/src/worker/sync/SharedSyncImplementation.ts +15 -12
  32. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js +0 -355
  33. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js.map +0 -1
  34. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3461.index.umd.js +0 -355
  35. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3461.index.umd.js.map +0 -1
@@ -34,6 +34,22 @@ export class SharedWASQLiteConnection implements AsyncDatabaseConnection {
34
34
  this.activeHoldId = null;
35
35
  }
36
36
 
37
+ protected get logger() {
38
+ return this.options.logger;
39
+ }
40
+
41
+ protected get dbEntry() {
42
+ return this.options.dbMap.get(this.options.dbFilename)!;
43
+ }
44
+
45
+ protected get connection() {
46
+ return this.dbEntry.db;
47
+ }
48
+
49
+ protected get clientIds() {
50
+ return this.dbEntry.clientIds;
51
+ }
52
+
37
53
  async init(): Promise<void> {
38
54
  // No-op since the connection is already initialized when it was created
39
55
  }
@@ -51,20 +67,8 @@ export class SharedWASQLiteConnection implements AsyncDatabaseConnection {
51
67
  }
52
68
  }
53
69
 
54
- protected get logger() {
55
- return this.options.logger;
56
- }
57
-
58
- protected get dbEntry() {
59
- return this.options.dbMap.get(this.options.dbFilename)!;
60
- }
61
-
62
- protected get connection() {
63
- return this.dbEntry.db;
64
- }
65
-
66
- protected get clientIds() {
67
- return this.dbEntry.clientIds;
70
+ async isAutoCommit(): Promise<boolean> {
71
+ return this.connection.isAutoCommit();
68
72
  }
69
73
 
70
74
  /**
@@ -92,6 +96,7 @@ export class SharedWASQLiteConnection implements AsyncDatabaseConnection {
92
96
  const connection = this.connection;
93
97
  dbMap.delete(dbFilename);
94
98
  await connection.close();
99
+ return;
95
100
  }
96
101
  logger.debug(`Connection to ${dbFilename} not closed yet due to active clients.`);
97
102
  return;
@@ -9,7 +9,7 @@ import { AsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnecti
9
9
  import { WorkerDBOpenerOptions } from '../../db/adapters/wa-sqlite/WASQLiteOpenFactory';
10
10
  import { getNavigatorLocks } from '../../shared/navigator';
11
11
  import { SharedDBWorkerConnection, SharedWASQLiteConnection } from './SharedWASQLiteConnection';
12
- import { WorkerWASQLiteConnection, proxyWASQLiteConnection } from './WorkerWASQLiteConnection';
12
+ import { WorkerWASQLiteConnection } from './WorkerWASQLiteConnection';
13
13
 
14
14
  const baseLogger = createBaseLogger();
15
15
  baseLogger.useDefaults();
@@ -59,7 +59,7 @@ const openDBShared = async (options: WorkerDBOpenerOptions): Promise<AsyncDataba
59
59
  logger
60
60
  });
61
61
 
62
- return proxyWASQLiteConnection(sharedConnection);
62
+ return Comlink.proxy(sharedConnection);
63
63
  });
64
64
  };
65
65
 
@@ -1,26 +1,11 @@
1
1
  import * as Comlink from 'comlink';
2
- import { AsyncDatabaseConnection, OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection';
2
+ import { OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection';
3
3
  import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
4
4
 
5
5
  /**
6
- * Fully proxies a WASQLiteConnection to be used as an AsyncDatabaseConnection.
6
+ * A Small proxy wrapper around the WASqliteConnection.
7
+ * This ensures that certain return types are properly proxied.
7
8
  */
8
- export function proxyWASQLiteConnection(connection: AsyncDatabaseConnection): AsyncDatabaseConnection {
9
- return Comlink.proxy({
10
- init: Comlink.proxy(() => connection.init()),
11
- close: Comlink.proxy(() => connection.close()),
12
- markHold: Comlink.proxy(() => connection.markHold()),
13
- releaseHold: Comlink.proxy((holdId: string) => connection.releaseHold(holdId)),
14
- execute: Comlink.proxy((sql: string, params?: any[]) => connection.execute(sql, params)),
15
- executeRaw: Comlink.proxy((sql: string, params?: any[]) => connection.executeRaw(sql, params)),
16
- executeBatch: Comlink.proxy((sql: string, params?: any[]) => connection.executeBatch(sql, params)),
17
- registerOnTableChange: Comlink.proxy((callback: OnTableChangeCallback) =>
18
- connection.registerOnTableChange(callback)
19
- ),
20
- getConfig: Comlink.proxy(() => connection.getConfig())
21
- });
22
- }
23
-
24
9
  export class WorkerWASQLiteConnection extends WASqliteConnection {
25
10
  async registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void> {
26
11
  // Proxy the callback remove function
@@ -1,10 +1,4 @@
1
1
  import {
2
- type ILogger,
3
- type ILogLevel,
4
- type PowerSyncConnectionOptions,
5
- type StreamingSyncImplementation,
6
- type StreamingSyncImplementationListener,
7
- type SyncStatusOptions,
8
2
  AbortOperation,
9
3
  BaseObserver,
10
4
  ConnectionManager,
@@ -13,7 +7,13 @@ import {
13
7
  PowerSyncBackendConnector,
14
8
  SqliteBucketStorage,
15
9
  SubscribedStream,
16
- SyncStatus
10
+ SyncStatus,
11
+ type ILogger,
12
+ type ILogLevel,
13
+ type PowerSyncConnectionOptions,
14
+ type StreamingSyncImplementation,
15
+ type StreamingSyncImplementationListener,
16
+ type SyncStatusOptions
17
17
  } from '@powersync/common';
18
18
  import { Mutex } from 'async-mutex';
19
19
  import * as Comlink from 'comlink';
@@ -75,7 +75,7 @@ export type WrappedSyncPort = {
75
75
  clientProvider: Comlink.Remote<AbstractSharedSyncClientProvider>;
76
76
  db?: DBAdapter;
77
77
  currentSubscriptions: SubscribedStream[];
78
- closeListeners: (() => void)[];
78
+ closeListeners: (() => void | Promise<void>)[];
79
79
  };
80
80
 
81
81
  /**
@@ -334,12 +334,15 @@ export class SharedSyncImplementation extends BaseObserver<SharedSyncImplementat
334
334
  }
335
335
 
336
336
  for (const closeListener of trackedPort.closeListeners) {
337
- closeListener();
337
+ await closeListener();
338
338
  }
339
339
 
340
340
  if (this.dbAdapter && this.dbAdapter == trackedPort.db) {
341
341
  // Unconditionally close the connection because the database it's writing to has just been closed.
342
- await this.connectionManager.disconnect();
342
+ // The connection has been closed previously, this might throw. We should be able to ignore it.
343
+ await this.connectionManager
344
+ .disconnect()
345
+ .catch((ex) => this.logger.warn('Error while disconnecting. Will attempt to reconnect.', ex));
343
346
 
344
347
  // Clearing the adapter will result in a new one being opened in connect
345
348
  this.dbAdapter = null;
@@ -482,9 +485,9 @@ export class SharedSyncImplementation extends BaseObserver<SharedSyncImplementat
482
485
  // that and ensure pending requests are aborted when the tab is closed.
483
486
  remoteCanCloseUnexpectedly: true
484
487
  });
485
- lastClient.closeListeners.push(() => {
488
+ lastClient.closeListeners.push(async () => {
486
489
  this.logger.info('Aborting open connection because associated tab closed.');
487
- wrapped.close();
490
+ wrapped.close().catch((ex) => this.logger.warn('error closing database connection', ex));
488
491
  wrapped.markRemoteClosed();
489
492
  });
490
493
 
@@ -1,355 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("@journeyapps/wa-sqlite"), require("@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js"), require("@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js"), require("@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"), require("@powersync/common"), require("async-mutex"), require("comlink"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["@journeyapps/wa-sqlite", "@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js", "@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js", "@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js", "@powersync/common", "async-mutex", "comlink"], factory);
6
- else if(typeof exports === 'object')
7
- exports["sdk_web"] = factory(require("@journeyapps/wa-sqlite"), require("@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js"), require("@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js"), require("@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"), require("@powersync/common"), require("async-mutex"), require("comlink"));
8
- else
9
- root["sdk_web"] = factory(root["@journeyapps/wa-sqlite"], root["@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js"], root["@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js"], root["@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"], root["@powersync/common"], root["async-mutex"], root["comlink"]);
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_AccessHandlePoolVFS_js__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_IDBBatchAtomicVFS_js__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_OPFSCoopSyncVFS_js__, __WEBPACK_EXTERNAL_MODULE__powersync_common__, __WEBPACK_EXTERNAL_MODULE_async_mutex__, __WEBPACK_EXTERNAL_MODULE_comlink__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ "@journeyapps/wa-sqlite":
16
- /*!*****************************************!*\
17
- !*** external "@journeyapps/wa-sqlite" ***!
18
- \*****************************************/
19
- /***/ ((module) => {
20
-
21
- module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite__;
22
-
23
- /***/ }),
24
-
25
- /***/ "@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js":
26
- /*!*****************************************************************************!*\
27
- !*** external "@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js" ***!
28
- \*****************************************************************************/
29
- /***/ ((module) => {
30
-
31
- module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_AccessHandlePoolVFS_js__;
32
-
33
- /***/ }),
34
-
35
- /***/ "@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js":
36
- /*!***************************************************************************!*\
37
- !*** external "@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js" ***!
38
- \***************************************************************************/
39
- /***/ ((module) => {
40
-
41
- module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_IDBBatchAtomicVFS_js__;
42
-
43
- /***/ }),
44
-
45
- /***/ "@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js":
46
- /*!*************************************************************************!*\
47
- !*** external "@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js" ***!
48
- \*************************************************************************/
49
- /***/ ((module) => {
50
-
51
- module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_OPFSCoopSyncVFS_js__;
52
-
53
- /***/ }),
54
-
55
- /***/ "@powersync/common":
56
- /*!************************************!*\
57
- !*** external "@powersync/common" ***!
58
- \************************************/
59
- /***/ ((module) => {
60
-
61
- module.exports = __WEBPACK_EXTERNAL_MODULE__powersync_common__;
62
-
63
- /***/ }),
64
-
65
- /***/ "async-mutex":
66
- /*!******************************!*\
67
- !*** external "async-mutex" ***!
68
- \******************************/
69
- /***/ ((module) => {
70
-
71
- module.exports = __WEBPACK_EXTERNAL_MODULE_async_mutex__;
72
-
73
- /***/ }),
74
-
75
- /***/ "comlink":
76
- /*!**************************!*\
77
- !*** external "comlink" ***!
78
- \**************************/
79
- /***/ ((module) => {
80
-
81
- module.exports = __WEBPACK_EXTERNAL_MODULE_comlink__;
82
-
83
- /***/ })
84
-
85
- /******/ });
86
- /************************************************************************/
87
- /******/ // The module cache
88
- /******/ var __webpack_module_cache__ = {};
89
- /******/
90
- /******/ // The require function
91
- /******/ function __webpack_require__(moduleId) {
92
- /******/ // Check if module is in cache
93
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
94
- /******/ if (cachedModule !== undefined) {
95
- /******/ return cachedModule.exports;
96
- /******/ }
97
- /******/ // Create a new module (and put it into the cache)
98
- /******/ var module = __webpack_module_cache__[moduleId] = {
99
- /******/ id: moduleId,
100
- /******/ loaded: false,
101
- /******/ exports: {}
102
- /******/ };
103
- /******/
104
- /******/ // Execute the module function
105
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
106
- /******/
107
- /******/ // Flag the module as loaded
108
- /******/ module.loaded = true;
109
- /******/
110
- /******/ // Return the exports of the module
111
- /******/ return module.exports;
112
- /******/ }
113
- /******/
114
- /******/ // expose the modules object (__webpack_modules__)
115
- /******/ __webpack_require__.m = __webpack_modules__;
116
- /******/
117
- /******/ // the startup function
118
- /******/ __webpack_require__.x = () => {
119
- /******/ // Load entry module and return exports
120
- /******/ // This entry module depends on other loaded chunks and execution need to be delayed
121
- /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["lib_src_worker_db_WASQLiteDB_worker_js-lib_src_worker_sync_SharedSyncImplementation_worker_js"], () => (__webpack_require__("./lib/src/worker/db/WASQLiteDB.worker.js")))
122
- /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
123
- /******/ return __webpack_exports__;
124
- /******/ };
125
- /******/
126
- /************************************************************************/
127
- /******/ /* webpack/runtime/chunk loaded */
128
- /******/ (() => {
129
- /******/ var deferred = [];
130
- /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
131
- /******/ if(chunkIds) {
132
- /******/ priority = priority || 0;
133
- /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
134
- /******/ deferred[i] = [chunkIds, fn, priority];
135
- /******/ return;
136
- /******/ }
137
- /******/ var notFulfilled = Infinity;
138
- /******/ for (var i = 0; i < deferred.length; i++) {
139
- /******/ var [chunkIds, fn, priority] = deferred[i];
140
- /******/ var fulfilled = true;
141
- /******/ for (var j = 0; j < chunkIds.length; j++) {
142
- /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
143
- /******/ chunkIds.splice(j--, 1);
144
- /******/ } else {
145
- /******/ fulfilled = false;
146
- /******/ if(priority < notFulfilled) notFulfilled = priority;
147
- /******/ }
148
- /******/ }
149
- /******/ if(fulfilled) {
150
- /******/ deferred.splice(i--, 1)
151
- /******/ var r = fn();
152
- /******/ if (r !== undefined) result = r;
153
- /******/ }
154
- /******/ }
155
- /******/ return result;
156
- /******/ };
157
- /******/ })();
158
- /******/
159
- /******/ /* webpack/runtime/compat get default export */
160
- /******/ (() => {
161
- /******/ // getDefaultExport function for compatibility with non-harmony modules
162
- /******/ __webpack_require__.n = (module) => {
163
- /******/ var getter = module && module.__esModule ?
164
- /******/ () => (module['default']) :
165
- /******/ () => (module);
166
- /******/ __webpack_require__.d(getter, { a: getter });
167
- /******/ return getter;
168
- /******/ };
169
- /******/ })();
170
- /******/
171
- /******/ /* webpack/runtime/create fake namespace object */
172
- /******/ (() => {
173
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
174
- /******/ var leafPrototypes;
175
- /******/ // create a fake namespace object
176
- /******/ // mode & 1: value is a module id, require it
177
- /******/ // mode & 2: merge all properties of value into the ns
178
- /******/ // mode & 4: return value when already ns object
179
- /******/ // mode & 16: return value when it's Promise-like
180
- /******/ // mode & 8|1: behave like require
181
- /******/ __webpack_require__.t = function(value, mode) {
182
- /******/ if(mode & 1) value = this(value);
183
- /******/ if(mode & 8) return value;
184
- /******/ if(typeof value === 'object' && value) {
185
- /******/ if((mode & 4) && value.__esModule) return value;
186
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
187
- /******/ }
188
- /******/ var ns = Object.create(null);
189
- /******/ __webpack_require__.r(ns);
190
- /******/ var def = {};
191
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
192
- /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
193
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
194
- /******/ }
195
- /******/ def['default'] = () => (value);
196
- /******/ __webpack_require__.d(ns, def);
197
- /******/ return ns;
198
- /******/ };
199
- /******/ })();
200
- /******/
201
- /******/ /* webpack/runtime/define property getters */
202
- /******/ (() => {
203
- /******/ // define getter functions for harmony exports
204
- /******/ __webpack_require__.d = (exports, definition) => {
205
- /******/ for(var key in definition) {
206
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
207
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
208
- /******/ }
209
- /******/ }
210
- /******/ };
211
- /******/ })();
212
- /******/
213
- /******/ /* webpack/runtime/ensure chunk */
214
- /******/ (() => {
215
- /******/ __webpack_require__.f = {};
216
- /******/ // This file contains only the entry chunk.
217
- /******/ // The chunk loading function for additional chunks
218
- /******/ __webpack_require__.e = (chunkId) => {
219
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
220
- /******/ __webpack_require__.f[key](chunkId, promises);
221
- /******/ return promises;
222
- /******/ }, []));
223
- /******/ };
224
- /******/ })();
225
- /******/
226
- /******/ /* webpack/runtime/get javascript chunk filename */
227
- /******/ (() => {
228
- /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
229
- /******/ __webpack_require__.u = (chunkId) => {
230
- /******/ // return url for filenames based on template
231
- /******/ return "index.umd.js";
232
- /******/ };
233
- /******/ })();
234
- /******/
235
- /******/ /* webpack/runtime/global */
236
- /******/ (() => {
237
- /******/ __webpack_require__.g = (function() {
238
- /******/ if (typeof globalThis === 'object') return globalThis;
239
- /******/ try {
240
- /******/ return this || new Function('return this')();
241
- /******/ } catch (e) {
242
- /******/ if (typeof window === 'object') return window;
243
- /******/ }
244
- /******/ })();
245
- /******/ })();
246
- /******/
247
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
248
- /******/ (() => {
249
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
250
- /******/ })();
251
- /******/
252
- /******/ /* webpack/runtime/make namespace object */
253
- /******/ (() => {
254
- /******/ // define __esModule on exports
255
- /******/ __webpack_require__.r = (exports) => {
256
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
257
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
258
- /******/ }
259
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
260
- /******/ };
261
- /******/ })();
262
- /******/
263
- /******/ /* webpack/runtime/node module decorator */
264
- /******/ (() => {
265
- /******/ __webpack_require__.nmd = (module) => {
266
- /******/ module.paths = [];
267
- /******/ if (!module.children) module.children = [];
268
- /******/ return module;
269
- /******/ };
270
- /******/ })();
271
- /******/
272
- /******/ /* webpack/runtime/publicPath */
273
- /******/ (() => {
274
- /******/ var scriptUrl;
275
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
276
- /******/ var document = __webpack_require__.g.document;
277
- /******/ if (!scriptUrl && document) {
278
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
279
- /******/ scriptUrl = document.currentScript.src;
280
- /******/ if (!scriptUrl) {
281
- /******/ var scripts = document.getElementsByTagName("script");
282
- /******/ if(scripts.length) {
283
- /******/ var i = scripts.length - 1;
284
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
285
- /******/ }
286
- /******/ }
287
- /******/ }
288
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
289
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
290
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
291
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
292
- /******/ __webpack_require__.p = scriptUrl;
293
- /******/ })();
294
- /******/
295
- /******/ /* webpack/runtime/importScripts chunk loading */
296
- /******/ (() => {
297
- /******/ __webpack_require__.b = self.location + "";
298
- /******/
299
- /******/ // object to store loaded chunks
300
- /******/ // "1" means "already loaded"
301
- /******/ var installedChunks = {
302
- /******/ "_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460": 1
303
- /******/ };
304
- /******/
305
- /******/ // importScripts chunk loading
306
- /******/ var installChunk = (data) => {
307
- /******/ var [chunkIds, moreModules, runtime] = data;
308
- /******/ for(var moduleId in moreModules) {
309
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
310
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
311
- /******/ }
312
- /******/ }
313
- /******/ if(runtime) runtime(__webpack_require__);
314
- /******/ while(chunkIds.length)
315
- /******/ installedChunks[chunkIds.pop()] = 1;
316
- /******/ parentChunkLoadingFunction(data);
317
- /******/ };
318
- /******/ __webpack_require__.f.i = (chunkId, promises) => {
319
- /******/ // "1" is the signal for "already loaded"
320
- /******/ if(!installedChunks[chunkId]) {
321
- /******/ if(true) { // all chunks have JS
322
- /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
323
- /******/ }
324
- /******/ }
325
- /******/ };
326
- /******/
327
- /******/ var chunkLoadingGlobal = self["webpackChunksdk_web"] = self["webpackChunksdk_web"] || [];
328
- /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
329
- /******/ chunkLoadingGlobal.push = installChunk;
330
- /******/
331
- /******/ // no HMR
332
- /******/
333
- /******/ // no HMR manifest
334
- /******/ })();
335
- /******/
336
- /******/ /* webpack/runtime/startup chunk dependencies */
337
- /******/ (() => {
338
- /******/ var next = __webpack_require__.x;
339
- /******/ __webpack_require__.x = () => {
340
- /******/ return Promise.all([
341
- /******/
342
- /******/ ]).then(next);
343
- /******/ };
344
- /******/ })();
345
- /******/
346
- /************************************************************************/
347
- /******/
348
- /******/ // run startup
349
- /******/ var __webpack_exports__ = __webpack_require__.x();
350
- /******/
351
- /******/ return __webpack_exports__;
352
- /******/ })()
353
- ;
354
- });
355
- //# sourceMappingURL=_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460.index.umd.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACVA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;;;;;AELA;AACA","sources":["webpack://sdk_web/webpack/universalModuleDefinition","webpack://sdk_web/external umd \"@journeyapps/wa-sqlite\"","webpack://sdk_web/external umd \"@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js\"","webpack://sdk_web/external umd \"@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js\"","webpack://sdk_web/external umd \"@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js\"","webpack://sdk_web/external umd \"@powersync/common\"","webpack://sdk_web/external umd \"async-mutex\"","webpack://sdk_web/external umd \"comlink\"","webpack://sdk_web/webpack/bootstrap","webpack://sdk_web/webpack/runtime/chunk loaded","webpack://sdk_web/webpack/runtime/compat get default export","webpack://sdk_web/webpack/runtime/create fake namespace object","webpack://sdk_web/webpack/runtime/define property getters","webpack://sdk_web/webpack/runtime/ensure chunk","webpack://sdk_web/webpack/runtime/get javascript chunk filename","webpack://sdk_web/webpack/runtime/global","webpack://sdk_web/webpack/runtime/hasOwnProperty shorthand","webpack://sdk_web/webpack/runtime/make namespace object","webpack://sdk_web/webpack/runtime/node module decorator","webpack://sdk_web/webpack/runtime/publicPath","webpack://sdk_web/webpack/runtime/importScripts chunk loading","webpack://sdk_web/webpack/runtime/startup chunk dependencies","webpack://sdk_web/webpack/before-startup","webpack://sdk_web/webpack/startup","webpack://sdk_web/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@journeyapps/wa-sqlite\"), require(\"@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js\"), require(\"@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js\"), require(\"@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js\"), require(\"@powersync/common\"), require(\"async-mutex\"), require(\"comlink\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@journeyapps/wa-sqlite\", \"@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js\", \"@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js\", \"@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js\", \"@powersync/common\", \"async-mutex\", \"comlink\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sdk_web\"] = factory(require(\"@journeyapps/wa-sqlite\"), require(\"@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js\"), require(\"@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js\"), require(\"@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js\"), require(\"@powersync/common\"), require(\"async-mutex\"), require(\"comlink\"));\n\telse\n\t\troot[\"sdk_web\"] = factory(root[\"@journeyapps/wa-sqlite\"], root[\"@journeyapps/wa-sqlite/src/examples/AccessHandlePoolVFS.js\"], root[\"@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js\"], root[\"@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js\"], root[\"@powersync/common\"], root[\"async-mutex\"], root[\"comlink\"]);\n})(self, (__WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_AccessHandlePoolVFS_js__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_IDBBatchAtomicVFS_js__, __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_OPFSCoopSyncVFS_js__, __WEBPACK_EXTERNAL_MODULE__powersync_common__, __WEBPACK_EXTERNAL_MODULE_async_mutex__, __WEBPACK_EXTERNAL_MODULE_comlink__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite__;","module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_AccessHandlePoolVFS_js__;","module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_IDBBatchAtomicVFS_js__;","module.exports = __WEBPACK_EXTERNAL_MODULE__journeyapps_wa_sqlite_src_examples_OPFSCoopSyncVFS_js__;","module.exports = __WEBPACK_EXTERNAL_MODULE__powersync_common__;","module.exports = __WEBPACK_EXTERNAL_MODULE_async_mutex__;","module.exports = __WEBPACK_EXTERNAL_MODULE_comlink__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [\"lib_src_worker_db_WASQLiteDB_worker_js-lib_src_worker_sync_SharedSyncImplementation_worker_js\"], () => (__webpack_require__(\"./lib/src/worker/db/WASQLiteDB.worker.js\")))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"index.umd.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = self.location + \"\";\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t\"_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-81d3460\": 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunksdk_web\"] = self[\"webpackChunksdk_web\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([\n\n\t]).then(next);\n};","","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n",""],"names":[],"sourceRoot":""}