@powersync/web 0.6.0 → 0.7.0

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 (40) hide show
  1. package/README.md +8 -0
  2. package/lib/src/db/PowerSyncDatabase.js +0 -1
  3. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +0 -1
  4. package/lib/src/db/adapters/SSRDBAdapter.js +0 -1
  5. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +0 -1
  6. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +0 -1
  7. package/lib/src/db/sync/SSRWebStreamingSyncImplementation.js +0 -1
  8. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +0 -1
  9. package/lib/src/db/sync/WebRemote.d.ts +3 -1
  10. package/lib/src/db/sync/WebRemote.js +22 -1
  11. package/lib/src/db/sync/WebStreamingSyncImplementation.js +0 -1
  12. package/lib/src/index.js +0 -1
  13. package/lib/src/worker/db/SharedWASQLiteDB.worker.js +0 -1
  14. package/lib/src/worker/db/WASQLiteDB.worker.js +0 -1
  15. package/lib/src/worker/db/open-db.js +0 -1
  16. package/lib/src/worker/db/open-worker-database.js +0 -1
  17. package/lib/src/worker/sync/AbstractSharedSyncClientProvider.js +0 -1
  18. package/lib/src/worker/sync/BroadcastLogger.js +0 -1
  19. package/lib/src/worker/sync/SharedSyncImplementation.js +0 -1
  20. package/lib/src/worker/sync/SharedSyncImplementation.worker.js +0 -1
  21. package/lib/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +14 -13
  23. package/lib/src/db/PowerSyncDatabase.js.map +0 -1
  24. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js.map +0 -1
  25. package/lib/src/db/adapters/SSRDBAdapter.js.map +0 -1
  26. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js.map +0 -1
  27. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js.map +0 -1
  28. package/lib/src/db/sync/SSRWebStreamingSyncImplementation.js.map +0 -1
  29. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js.map +0 -1
  30. package/lib/src/db/sync/WebRemote.js.map +0 -1
  31. package/lib/src/db/sync/WebStreamingSyncImplementation.js.map +0 -1
  32. package/lib/src/index.js.map +0 -1
  33. package/lib/src/worker/db/SharedWASQLiteDB.worker.js.map +0 -1
  34. package/lib/src/worker/db/WASQLiteDB.worker.js.map +0 -1
  35. package/lib/src/worker/db/open-db.js.map +0 -1
  36. package/lib/src/worker/db/open-worker-database.js.map +0 -1
  37. package/lib/src/worker/sync/AbstractSharedSyncClientProvider.js.map +0 -1
  38. package/lib/src/worker/sync/BroadcastLogger.js.map +0 -1
  39. package/lib/src/worker/sync/SharedSyncImplementation.js.map +0 -1
  40. package/lib/src/worker/sync/SharedSyncImplementation.worker.js.map +0 -1
package/README.md CHANGED
@@ -56,6 +56,14 @@ if (typeof self.Buffer == 'undefined') {
56
56
  }
57
57
  ```
58
58
 
59
+ ## Webpack
60
+
61
+ See the [example Webpack config](https://github.com/powersync-ja/powersync-js/blob/main/demos/example-webpack/webpack.config.js) for details on polyfills and requirements.
62
+
63
+ ## Vite
64
+
65
+ See the [example Vite config](https://github.com/powersync-ja/powersync-js/blob/main/demos/example-vite/vite.config.ts) for details on polyfills and requirements.
66
+
59
67
  # Getting Started
60
68
 
61
69
  Our [full SDK reference](https://docs.powersync.com/client-sdk-references/js-web) contains everything you need to know to get started implementing PowerSync in your project.
@@ -89,4 +89,3 @@ Logs for shared sync worker will only be available in the shared worker context
89
89
  }
90
90
  }
91
91
  PowerSyncDatabase.SHARED_MUTEX = new Mutex();
92
- //# sourceMappingURL=PowerSyncDatabase.js.map
@@ -54,4 +54,3 @@ export class AbstractWebPowerSyncDatabaseOpenFactory extends AbstractPowerSyncDa
54
54
  return new PowerSyncDatabase(options);
55
55
  }
56
56
  }
57
- //# sourceMappingURL=AbstractWebPowerSyncDatabaseOpenFactory.js.map
@@ -83,4 +83,3 @@ export class SSRDBAdapter extends BaseObserver {
83
83
  }) });
84
84
  }
85
85
  }
86
- //# sourceMappingURL=SSRDBAdapter.js.map
@@ -194,4 +194,3 @@ export class WASQLiteDBAdapter extends BaseObserver {
194
194
  } });
195
195
  }
196
196
  }
197
- //# sourceMappingURL=WASQLiteDBAdapter.js.map
@@ -9,4 +9,3 @@ export class WASQLitePowerSyncDatabaseOpenFactory extends AbstractWebPowerSyncDa
9
9
  return new PowerSyncDatabase(options);
10
10
  }
11
11
  }
12
- //# sourceMappingURL=WASQLitePowerSyncDatabaseOpenFactory.js.map
@@ -11,4 +11,3 @@ export class SSRStreamingSyncImplementation extends AbstractStreamingSyncImpleme
11
11
  return mutex.runExclusive(lockOptions.callback);
12
12
  }
13
13
  }
14
- //# sourceMappingURL=SSRWebStreamingSyncImplementation.js.map
@@ -185,4 +185,3 @@ export class SharedWebStreamingSyncImplementation extends WebStreamingSyncImplem
185
185
  });
186
186
  }
187
187
  }
188
- //# sourceMappingURL=SharedWebStreamingSyncImplementation.js.map
@@ -1,3 +1,5 @@
1
- import { AbstractRemote } from '@powersync/common';
1
+ import { AbstractRemote, BSONImplementation } from '@powersync/common';
2
2
  export declare class WebRemote extends AbstractRemote {
3
+ private _bson;
4
+ getBSON(): Promise<BSONImplementation>;
3
5
  }
@@ -1,4 +1,25 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { AbstractRemote } from '@powersync/common';
2
11
  export class WebRemote extends AbstractRemote {
12
+ getBSON() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ if (this._bson) {
15
+ return this._bson;
16
+ }
17
+ /**
18
+ * Dynamic import to be used only when needed.
19
+ */
20
+ const { BSON } = yield import('bson');
21
+ this._bson = BSON;
22
+ return this._bson;
23
+ });
24
+ }
3
25
  }
4
- //# sourceMappingURL=WebRemote.js.map
@@ -13,4 +13,3 @@ export class WebStreamingSyncImplementation extends AbstractStreamingSyncImpleme
13
13
  return navigator.locks.request(identifier, { signal: lockOptions.signal }, lockOptions.callback);
14
14
  }
15
15
  }
16
- //# sourceMappingURL=WebStreamingSyncImplementation.js.map
package/lib/src/index.js CHANGED
@@ -6,4 +6,3 @@ export * from './db/sync/SharedWebStreamingSyncImplementation';
6
6
  export * from './db/adapters/wa-sqlite/WASQLiteDBAdapter';
7
7
  export * from './db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory';
8
8
  export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory';
9
- //# sourceMappingURL=index.js.map
@@ -55,4 +55,3 @@ addEventListener('unload', () => {
55
55
  (_a = db.close) === null || _a === void 0 ? void 0 : _a.call(db);
56
56
  }));
57
57
  });
58
- //# sourceMappingURL=SharedWASQLiteDB.worker.js.map
@@ -10,4 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import * as Comlink from 'comlink';
11
11
  import { _openDB } from './open-db';
12
12
  Comlink.expose((dbFileName) => __awaiter(void 0, void 0, void 0, function* () { return Comlink.proxy(yield _openDB(dbFileName)); }));
13
- //# sourceMappingURL=WASQLiteDB.worker.js.map
@@ -190,4 +190,3 @@ export function _openDB(dbFileName) {
190
190
  };
191
191
  });
192
192
  }
193
- //# sourceMappingURL=open-db.js.map
@@ -28,4 +28,3 @@ export function openWorkerDatabasePort(workerIdentifier, multipleTabs = true) {
28
28
  export function getWorkerDatabaseOpener(workerIdentifier, multipleTabs = true) {
29
29
  return Comlink.wrap(openWorkerDatabasePort(workerIdentifier, multipleTabs));
30
30
  }
31
- //# sourceMappingURL=open-worker-database.js.map
@@ -3,4 +3,3 @@
3
3
  */
4
4
  export class AbstractSharedSyncClientProvider {
5
5
  }
6
- //# sourceMappingURL=AbstractSharedSyncClientProvider.js.map
@@ -105,4 +105,3 @@ export class BroadcastLogger {
105
105
  return sanitizedParams;
106
106
  }
107
107
  }
108
- //# sourceMappingURL=BroadcastLogger.js.map
@@ -245,4 +245,3 @@ export class SharedSyncImplementation extends BaseObserver {
245
245
  this.updateAllStatuses(status);
246
246
  }
247
247
  }
248
- //# sourceMappingURL=SharedSyncImplementation.js.map
@@ -24,4 +24,3 @@ _self.onconnect = function (event) {
24
24
  Comlink.expose(sharedSyncImplementation, port);
25
25
  sharedSyncImplementation.addPort(port);
26
26
  };
27
- //# sourceMappingURL=SharedSyncImplementation.worker.js.map