@powersync/web 1.31.0 → 1.32.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.
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js +1867 -0
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530150.index.umd.js +555 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530150.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530151.index.umd.js +555 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530151.index.umd.js.map +1 -0
- package/dist/index.umd.js +4575 -43416
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +402 -2053
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +449 -2104
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/dist/worker/{node_modules_bson_lib_bson_mjs.umd.js → node_modules_pnpm_bson_6_10_4_node_modules_bson_lib_bson_mjs.umd.js} +6 -6
- package/dist/worker/node_modules_pnpm_bson_6_10_4_node_modules_bson_lib_bson_mjs.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-3a94cf.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-3a94cf.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-868779.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-868779.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqli-f60d0d.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqli-f60d0d.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-0d2437.umd.js} +24 -24
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-0d2437.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-1d4e74.umd.js} +18 -18
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-1d4e74.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-3622cf.umd.js} +18 -18
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-3622cf.umd.js.map +1 -0
- package/lib/package.json +26 -22
- package/lib/src/db/NavigatorTriggerClaimManager.d.ts +6 -0
- package/lib/src/db/NavigatorTriggerClaimManager.js +20 -0
- package/lib/src/db/PowerSyncDatabase.d.ts +5 -2
- package/lib/src/db/PowerSyncDatabase.js +46 -8
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +1 -1
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.d.ts +2 -2
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js +2 -2
- package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +1 -1
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +4 -4
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +8 -4
- package/lib/src/db/adapters/WebDBAdapter.d.ts +5 -2
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +2 -2
- package/lib/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.d.ts +12 -0
- package/lib/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.js +19 -0
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +2 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.d.ts +4 -4
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +6 -6
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.d.ts +4 -4
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +7 -7
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +3 -3
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +5 -5
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +5 -5
- package/lib/src/db/sync/WebRemote.js +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.d.ts +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.js +1 -1
- package/lib/src/index.d.ts +12 -12
- package/lib/src/index.js +12 -12
- package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WASQLiteDB.worker.js +3 -3
- package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WorkerWASQLiteConnection.js +1 -1
- package/lib/src/worker/db/open-worker-database.d.ts +2 -2
- package/lib/src/worker/db/open-worker-database.js +1 -1
- package/lib/src/worker/sync/BroadcastLogger.d.ts +1 -1
- package/lib/src/worker/sync/SharedSyncImplementation.d.ts +4 -4
- package/lib/src/worker/sync/SharedSyncImplementation.js +5 -5
- package/lib/src/worker/sync/SharedSyncImplementation.worker.js +2 -2
- package/lib/src/worker/sync/WorkerClient.d.ts +1 -1
- package/lib/src/worker/sync/WorkerClient.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -17
- package/src/db/NavigatorTriggerClaimManager.ts +23 -0
- package/src/db/PowerSyncDatabase.ts +53 -9
- package/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.ts +1 -1
- package/src/db/adapters/AbstractWebSQLOpenFactory.ts +3 -3
- package/src/db/adapters/AsyncDatabaseConnection.ts +1 -1
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +13 -9
- package/src/db/adapters/WebDBAdapter.ts +6 -2
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +2 -2
- package/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.ts +23 -0
- package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +2 -2
- package/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts +8 -8
- package/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.ts +8 -8
- package/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.ts +3 -3
- package/src/db/sync/SharedWebStreamingSyncImplementation.ts +7 -7
- package/src/db/sync/WebRemote.ts +1 -1
- package/src/db/sync/WebStreamingSyncImplementation.ts +2 -2
- package/src/index.ts +12 -12
- package/src/worker/db/SharedWASQLiteConnection.ts +2 -2
- package/src/worker/db/WASQLiteDB.worker.ts +5 -5
- package/src/worker/db/WorkerWASQLiteConnection.ts +2 -2
- package/src/worker/db/open-worker-database.ts +2 -2
- package/src/worker/sync/BroadcastLogger.ts +1 -1
- package/src/worker/sync/SharedSyncImplementation.ts +9 -9
- package/src/worker/sync/SharedSyncImplementation.worker.ts +2 -2
- package/src/worker/sync/WorkerClient.ts +2 -2
- package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map +0 -1
- /package/bin/{powersync.js → powersync.cjs} +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "PowerSync Web SDK",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
|
+
"module": "lib/src/index.js",
|
|
7
|
+
"type": "module",
|
|
6
8
|
"types": "lib/src/index.d.ts",
|
|
7
9
|
"bin": {
|
|
8
|
-
"powersync-web": "bin/powersync.
|
|
10
|
+
"powersync-web": "bin/powersync.cjs"
|
|
9
11
|
},
|
|
10
12
|
"files": [
|
|
11
13
|
"bin",
|
|
@@ -15,21 +17,23 @@
|
|
|
15
17
|
"src"
|
|
16
18
|
],
|
|
17
19
|
"exports": {
|
|
18
|
-
".":
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./lib/src/index.d.ts",
|
|
22
|
+
"default": "./lib/src/index.js"
|
|
23
|
+
},
|
|
19
24
|
"./umd": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"types": "./lib/src/index.d.ts"
|
|
25
|
+
"types": "./lib/src/index.d.ts",
|
|
26
|
+
"default": "./dist/index.umd.js"
|
|
23
27
|
},
|
|
24
28
|
"./umd/worker/db": {
|
|
29
|
+
"types": "./lib/src/index.d.ts",
|
|
25
30
|
"import": "./dist/worker/WASQLiteDB.umd.js",
|
|
26
|
-
"require": "./dist/worker/WASQLiteDB.umd.js"
|
|
27
|
-
"types": "./lib/src/index.d.ts"
|
|
31
|
+
"require": "./dist/worker/WASQLiteDB.umd.js"
|
|
28
32
|
},
|
|
29
33
|
"./umd/worker/sync": {
|
|
34
|
+
"types": "./lib/src/index.d.ts",
|
|
30
35
|
"import": "./dist/worker/SharedSyncImplementation.umd.js",
|
|
31
|
-
"require": "./dist/worker/SharedSyncImplementation.umd.js"
|
|
32
|
-
"types": "./lib/src/index.d.ts"
|
|
36
|
+
"require": "./dist/worker/SharedSyncImplementation.umd.js"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"repository": "https://github.com/powersync-ja/powersync-js",
|
|
@@ -52,27 +56,26 @@
|
|
|
52
56
|
"license": "Apache-2.0",
|
|
53
57
|
"peerDependencies": {
|
|
54
58
|
"@journeyapps/wa-sqlite": "^1.4.1",
|
|
55
|
-
"@powersync/common": "^1.
|
|
59
|
+
"@powersync/common": "^1.46.0"
|
|
56
60
|
},
|
|
57
61
|
"dependencies": {
|
|
58
62
|
"async-mutex": "^0.5.0",
|
|
59
63
|
"bson": "^6.10.4",
|
|
60
64
|
"comlink": "^4.4.2",
|
|
61
65
|
"commander": "^12.1.0",
|
|
62
|
-
"@powersync/common": "1.
|
|
66
|
+
"@powersync/common": "1.46.0"
|
|
63
67
|
},
|
|
64
68
|
"devDependencies": {
|
|
65
69
|
"@journeyapps/wa-sqlite": "^1.4.1",
|
|
66
70
|
"@types/uuid": "^9.0.6",
|
|
67
71
|
"crypto-browserify": "^3.12.0",
|
|
72
|
+
"glob": "^11.0.0",
|
|
68
73
|
"p-defer": "^4.0.1",
|
|
69
74
|
"source-map-loader": "^5.0.0",
|
|
70
75
|
"stream-browserify": "^3.0.0",
|
|
71
76
|
"terser-webpack-plugin": "^5.3.9",
|
|
72
|
-
"uuid": "^
|
|
73
|
-
"vite": "^
|
|
74
|
-
"vite-plugin-top-level-await": "^1.4.4",
|
|
75
|
-
"vite-plugin-wasm": "^3.3.0",
|
|
77
|
+
"uuid": "^11.1.0",
|
|
78
|
+
"vite": "^7.3.1",
|
|
76
79
|
"vm-browserify": "^1.1.2",
|
|
77
80
|
"webpack": "^5.90.1",
|
|
78
81
|
"webpack-cli": "^5.1.4",
|
|
@@ -86,6 +89,7 @@
|
|
|
86
89
|
"build:prod": "pnpm run build:tsc --sourceMap false && pnpm run build:webpack-main && pnpm run build:webpack-workers",
|
|
87
90
|
"clean": "rm -rf lib dist tsconfig.tsbuildinfo",
|
|
88
91
|
"watch": "tsc --build -w",
|
|
89
|
-
"test": "pnpm build && vitest"
|
|
92
|
+
"test": "pnpm build && vitest",
|
|
93
|
+
"test:exports": "attw --pack . --entrypoints . --profile=esm-only "
|
|
90
94
|
}
|
|
91
95
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TriggerClaimManager } from '@powersync/common';
|
|
2
|
+
import { getNavigatorLocks } from '../shared/navigator.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export const NAVIGATOR_TRIGGER_CLAIM_MANAGER: TriggerClaimManager = {
|
|
9
|
+
async obtainClaim(identifier: string): Promise<() => Promise<void>> {
|
|
10
|
+
return new Promise((resolveReleaser) => {
|
|
11
|
+
getNavigatorLocks().request(identifier, async () => {
|
|
12
|
+
await new Promise<void>((releaseLock) => {
|
|
13
|
+
resolveReleaser(async () => releaseLock());
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
async checkClaim(identifier: string): Promise<boolean> {
|
|
20
|
+
const currentState = await getNavigatorLocks().query();
|
|
21
|
+
return currentState.held?.find((heldLock) => heldLock.name == identifier) != null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
PowerSyncDatabaseOptionsWithSettings,
|
|
8
8
|
SqliteBucketStorage,
|
|
9
9
|
StreamingSyncImplementation,
|
|
10
|
+
TriggerManagerConfig,
|
|
10
11
|
isDBAdapter,
|
|
11
12
|
isSQLOpenFactory,
|
|
12
13
|
type BucketStorageAdapter,
|
|
@@ -15,22 +16,25 @@ import {
|
|
|
15
16
|
type RequiredAdditionalConnectionOptions
|
|
16
17
|
} from '@powersync/common';
|
|
17
18
|
import { Mutex } from 'async-mutex';
|
|
18
|
-
import { getNavigatorLocks } from '../shared/navigator';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { getNavigatorLocks } from '../shared/navigator.js';
|
|
20
|
+
import { NAVIGATOR_TRIGGER_CLAIM_MANAGER } from './NavigatorTriggerClaimManager.js';
|
|
21
|
+
import { LockedAsyncDatabaseAdapter } from './adapters/LockedAsyncDatabaseAdapter.js';
|
|
22
|
+
import { WebDBAdapter } from './adapters/WebDBAdapter.js';
|
|
23
|
+
import { WASQLiteOpenFactory } from './adapters/wa-sqlite/WASQLiteOpenFactory.js';
|
|
21
24
|
import {
|
|
22
25
|
DEFAULT_WEB_SQL_FLAGS,
|
|
23
26
|
ResolvedWebSQLOpenOptions,
|
|
24
27
|
WebSQLFlags,
|
|
28
|
+
isServerSide,
|
|
25
29
|
resolveWebSQLFlags
|
|
26
|
-
} from './adapters/web-sql-flags';
|
|
27
|
-
import { SSRStreamingSyncImplementation } from './sync/SSRWebStreamingSyncImplementation';
|
|
28
|
-
import { SharedWebStreamingSyncImplementation } from './sync/SharedWebStreamingSyncImplementation';
|
|
29
|
-
import { WebRemote } from './sync/WebRemote';
|
|
30
|
+
} from './adapters/web-sql-flags.js';
|
|
31
|
+
import { SSRStreamingSyncImplementation } from './sync/SSRWebStreamingSyncImplementation.js';
|
|
32
|
+
import { SharedWebStreamingSyncImplementation } from './sync/SharedWebStreamingSyncImplementation.js';
|
|
33
|
+
import { WebRemote } from './sync/WebRemote.js';
|
|
30
34
|
import {
|
|
31
35
|
WebStreamingSyncImplementation,
|
|
32
36
|
WebStreamingSyncImplementationOptions
|
|
33
|
-
} from './sync/WebStreamingSyncImplementation';
|
|
37
|
+
} from './sync/WebStreamingSyncImplementation.js';
|
|
34
38
|
|
|
35
39
|
export interface WebPowerSyncFlags extends WebSQLFlags {
|
|
36
40
|
/**
|
|
@@ -143,7 +147,33 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
|
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
|
|
146
|
-
async _initialize(): Promise<void> {
|
|
150
|
+
async _initialize(): Promise<void> {
|
|
151
|
+
if (this.database instanceof LockedAsyncDatabaseAdapter) {
|
|
152
|
+
/**
|
|
153
|
+
* While init is done automatically,
|
|
154
|
+
* LockedAsyncDatabaseAdapter only exposes config after init.
|
|
155
|
+
* We can explicitly wait for init here in order to access config.
|
|
156
|
+
*/
|
|
157
|
+
await this.database.init();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// In some cases, like the SQLJs adapter, we don't pass a WebDBAdapter, so we need to check.
|
|
161
|
+
if (typeof (this.database as WebDBAdapter).getConfiguration == 'function') {
|
|
162
|
+
const config = (this.database as WebDBAdapter).getConfiguration();
|
|
163
|
+
if (config.requiresPersistentTriggers) {
|
|
164
|
+
this.triggersImpl.updateDefaults({
|
|
165
|
+
useStorageByDefault: true
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
protected generateTriggerManagerConfig(): TriggerManagerConfig {
|
|
172
|
+
return {
|
|
173
|
+
// We need to share hold information between tabs for web
|
|
174
|
+
claimManager: NAVIGATOR_TRIGGER_CLAIM_MANAGER
|
|
175
|
+
};
|
|
176
|
+
}
|
|
147
177
|
|
|
148
178
|
protected openDBAdapter(options: WebPowerSyncDatabaseOptionsWithSettings): DBAdapter {
|
|
149
179
|
const defaultFactory = new WASQLiteOpenFactory({
|
|
@@ -169,6 +199,20 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
|
|
|
169
199
|
});
|
|
170
200
|
}
|
|
171
201
|
|
|
202
|
+
protected async loadVersion(): Promise<void> {
|
|
203
|
+
if (isServerSide()) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
return super.loadVersion();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
protected async resolveOfflineSyncStatus() {
|
|
210
|
+
if (isServerSide()) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
return super.resolveOfflineSyncStatus();
|
|
214
|
+
}
|
|
215
|
+
|
|
172
216
|
protected generateBucketStorageAdapter(): BucketStorageAdapter {
|
|
173
217
|
return new SqliteBucketStorage(this.database);
|
|
174
218
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ILogger,
|
|
2
|
-
import { SSRDBAdapter } from './SSRDBAdapter';
|
|
3
|
-
import { ResolvedWebSQLFlags, WebSQLOpenFactoryOptions, isServerSide, resolveWebSQLFlags } from './web-sql-flags';
|
|
1
|
+
import { DBAdapter, type ILogger, SQLOpenFactory, createLogger } from '@powersync/common';
|
|
2
|
+
import { SSRDBAdapter } from './SSRDBAdapter.js';
|
|
3
|
+
import { ResolvedWebSQLFlags, WebSQLOpenFactoryOptions, isServerSide, resolveWebSQLFlags } from './web-sql-flags.js';
|
|
4
4
|
|
|
5
5
|
export abstract class AbstractWebSQLOpenFactory implements SQLOpenFactory {
|
|
6
6
|
protected resolvedFlags: ResolvedWebSQLFlags;
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
createLogger,
|
|
12
12
|
type ILogger
|
|
13
13
|
} from '@powersync/common';
|
|
14
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
15
|
-
import { AsyncDatabaseConnection } from './AsyncDatabaseConnection';
|
|
16
|
-
import { SharedConnectionWorker, WebDBAdapter } from './WebDBAdapter';
|
|
17
|
-
import { WorkerWrappedAsyncDatabaseConnection } from './WorkerWrappedAsyncDatabaseConnection';
|
|
18
|
-
import { WASQLiteVFS } from './wa-sqlite/WASQLiteConnection';
|
|
19
|
-
import { ResolvedWASQLiteOpenFactoryOptions } from './wa-sqlite/WASQLiteOpenFactory';
|
|
20
|
-
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
|
|
14
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
15
|
+
import { AsyncDatabaseConnection } from './AsyncDatabaseConnection.js';
|
|
16
|
+
import { SharedConnectionWorker, WebDBAdapter, WebDBAdapterConfiguration } from './WebDBAdapter.js';
|
|
17
|
+
import { WorkerWrappedAsyncDatabaseConnection } from './WorkerWrappedAsyncDatabaseConnection.js';
|
|
18
|
+
import { WASQLiteVFS } from './wa-sqlite/WASQLiteConnection.js';
|
|
19
|
+
import { ResolvedWASQLiteOpenFactoryOptions } from './wa-sqlite/WASQLiteOpenFactory.js';
|
|
20
|
+
import { ResolvedWebSQLOpenOptions } from './web-sql-flags.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @internal
|
|
@@ -181,11 +181,15 @@ export class LockedAsyncDatabaseAdapter
|
|
|
181
181
|
this.iterateListeners((cb) => cb.initialized?.());
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
getConfiguration():
|
|
184
|
+
getConfiguration(): WebDBAdapterConfiguration {
|
|
185
185
|
if (!this._config) {
|
|
186
186
|
throw new Error(`Cannot get config before initialization is completed`);
|
|
187
187
|
}
|
|
188
|
-
return
|
|
188
|
+
return {
|
|
189
|
+
...this._config,
|
|
190
|
+
// This can be overridden by the adapter later
|
|
191
|
+
requiresPersistentTriggers: false
|
|
192
|
+
};
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
protected async waitForInitialized() {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { DBAdapter } from '@powersync/common';
|
|
2
|
-
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
|
|
2
|
+
import { ResolvedWebSQLOpenOptions } from './web-sql-flags.js';
|
|
3
3
|
|
|
4
4
|
export type SharedConnectionWorker = {
|
|
5
5
|
identifier: string;
|
|
6
6
|
port: MessagePort;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
export type WebDBAdapterConfiguration = ResolvedWebSQLOpenOptions & {
|
|
10
|
+
requiresPersistentTriggers: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
9
13
|
export interface WebDBAdapter extends DBAdapter {
|
|
10
14
|
/**
|
|
11
15
|
* Get a MessagePort which can be used to share the internals of this connection.
|
|
@@ -16,5 +20,5 @@ export interface WebDBAdapter extends DBAdapter {
|
|
|
16
20
|
* Get the config options used to open this connection.
|
|
17
21
|
* This is useful for sharing connections.
|
|
18
22
|
*/
|
|
19
|
-
getConfiguration():
|
|
23
|
+
getConfiguration(): WebDBAdapterConfiguration;
|
|
20
24
|
}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
OnTableChangeCallback,
|
|
6
6
|
OpenAsyncDatabaseConnection,
|
|
7
7
|
ProxiedQueryResult
|
|
8
|
-
} from './AsyncDatabaseConnection';
|
|
9
|
-
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
|
|
8
|
+
} from './AsyncDatabaseConnection.js';
|
|
9
|
+
import { ResolvedWebSQLOpenOptions } from './web-sql-flags.js';
|
|
10
10
|
|
|
11
11
|
export type SharedConnectionWorker = {
|
|
12
12
|
identifier: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LockedAsyncDatabaseAdapter } from '../LockedAsyncDatabaseAdapter.js';
|
|
2
|
+
import { WebDBAdapterConfiguration } from '../WebDBAdapter.js';
|
|
3
|
+
import { WASQLiteVFS } from './WASQLiteConnection.js';
|
|
4
|
+
import { ResolvedWASQLiteOpenFactoryOptions } from './WASQLiteOpenFactory.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* An intermediary implementation of WASQLiteDBAdapter, which takes the same
|
|
9
|
+
* constructor arguments as {@link LockedAsyncDatabaseAdapter}, but provides some
|
|
10
|
+
* basic WA-SQLite specific functionality.
|
|
11
|
+
* This base class is used to avoid requiring overloading the constructor of {@link WASQLiteDBAdapter}
|
|
12
|
+
*/
|
|
13
|
+
export class InternalWASQLiteDBAdapter extends LockedAsyncDatabaseAdapter {
|
|
14
|
+
getConfiguration(): WebDBAdapterConfiguration {
|
|
15
|
+
// This is valid since we only handle WASQLite connections
|
|
16
|
+
const baseConfig = super.getConfiguration() as unknown as ResolvedWASQLiteOpenFactoryOptions;
|
|
17
|
+
return {
|
|
18
|
+
...super.getConfiguration(),
|
|
19
|
+
requiresPersistentTriggers:
|
|
20
|
+
baseConfig.vfs == WASQLiteVFS.OPFSCoopSyncVFS || baseConfig.vfs == WASQLiteVFS.AccessHandlePoolVFS
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as SQLite from '@journeyapps/wa-sqlite';
|
|
2
2
|
import { BaseObserver, BatchedUpdateNotification } from '@powersync/common';
|
|
3
3
|
import { Mutex } from 'async-mutex';
|
|
4
|
-
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../AsyncDatabaseConnection';
|
|
5
|
-
import { ResolvedWASQLiteOpenFactoryOptions } from './WASQLiteOpenFactory';
|
|
4
|
+
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../AsyncDatabaseConnection.js';
|
|
5
|
+
import { ResolvedWASQLiteOpenFactoryOptions } from './WASQLiteOpenFactory.js';
|
|
6
6
|
/**
|
|
7
7
|
* List of currently tested virtual filesystems
|
|
8
8
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { type PowerSyncOpenFactoryOptions } from '@powersync/common';
|
|
2
2
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { resolveWebPowerSyncFlags } from '../../PowerSyncDatabase';
|
|
4
|
-
import { OpenAsyncDatabaseConnection } from '../AsyncDatabaseConnection';
|
|
5
|
-
import { LockedAsyncDatabaseAdapter } from '../LockedAsyncDatabaseAdapter';
|
|
3
|
+
import { resolveWebPowerSyncFlags } from '../../PowerSyncDatabase.js';
|
|
4
|
+
import { OpenAsyncDatabaseConnection } from '../AsyncDatabaseConnection.js';
|
|
6
5
|
import {
|
|
7
6
|
DEFAULT_CACHE_SIZE_KB,
|
|
8
7
|
ResolvedWebSQLOpenOptions,
|
|
9
8
|
TemporaryStorageOption,
|
|
10
9
|
WebSQLFlags
|
|
11
|
-
} from '../web-sql-flags';
|
|
12
|
-
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
} from '../web-sql-flags.js';
|
|
11
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection.js';
|
|
12
|
+
import { InternalWASQLiteDBAdapter } from './InternalWASQLiteDBAdapter.js';
|
|
13
|
+
import { WASQLiteVFS } from './WASQLiteConnection.js';
|
|
14
|
+
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* These flags are the same as {@link WebSQLFlags}.
|
|
@@ -44,7 +44,7 @@ export interface WASQLiteDBAdapterOptions extends Omit<PowerSyncOpenFactoryOptio
|
|
|
44
44
|
/**
|
|
45
45
|
* Adapter for WA-SQLite SQLite connections.
|
|
46
46
|
*/
|
|
47
|
-
export class WASQLiteDBAdapter extends
|
|
47
|
+
export class WASQLiteDBAdapter extends InternalWASQLiteDBAdapter {
|
|
48
48
|
constructor(options: WASQLiteDBAdapterOptions) {
|
|
49
49
|
super({
|
|
50
50
|
name: options.dbFilename,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { DBAdapter, type ILogLevel } from '@powersync/common';
|
|
2
2
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { openWorkerDatabasePort, resolveWorkerDatabasePortFactory } from '../../../worker/db/open-worker-database';
|
|
4
|
-
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory';
|
|
5
|
-
import { AsyncDatabaseConnection, OpenAsyncDatabaseConnection } from '../AsyncDatabaseConnection';
|
|
6
|
-
import {
|
|
7
|
-
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection';
|
|
3
|
+
import { openWorkerDatabasePort, resolveWorkerDatabasePortFactory } from '../../../worker/db/open-worker-database.js';
|
|
4
|
+
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory.js';
|
|
5
|
+
import { AsyncDatabaseConnection, OpenAsyncDatabaseConnection } from '../AsyncDatabaseConnection.js';
|
|
6
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection.js';
|
|
8
7
|
import {
|
|
9
8
|
DEFAULT_CACHE_SIZE_KB,
|
|
10
9
|
ResolvedWebSQLOpenOptions,
|
|
11
10
|
TemporaryStorageOption,
|
|
12
11
|
WebSQLOpenFactoryOptions
|
|
13
|
-
} from '../web-sql-flags';
|
|
14
|
-
import {
|
|
12
|
+
} from '../web-sql-flags.js';
|
|
13
|
+
import { InternalWASQLiteDBAdapter } from './InternalWASQLiteDBAdapter.js';
|
|
14
|
+
import { WASQLiteVFS, WASqliteConnection } from './WASQLiteConnection.js';
|
|
15
15
|
|
|
16
16
|
export interface WASQLiteOpenFactoryOptions extends WebSQLOpenFactoryOptions {
|
|
17
17
|
vfs?: WASQLiteVFS;
|
|
@@ -41,7 +41,7 @@ export class WASQLiteOpenFactory extends AbstractWebSQLOpenFactory {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
protected openAdapter(): DBAdapter {
|
|
44
|
-
return new
|
|
44
|
+
return new InternalWASQLiteDBAdapter({
|
|
45
45
|
name: this.options.dbFilename,
|
|
46
46
|
openConnection: () => this.openConnection(),
|
|
47
47
|
debugMode: this.options.debugMode,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractPowerSyncDatabase, DBAdapter, PowerSyncDatabaseOptions } from '@powersync/common';
|
|
2
|
-
import { PowerSyncDatabase } from '../../../db/PowerSyncDatabase';
|
|
3
|
-
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory';
|
|
4
|
-
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory';
|
|
2
|
+
import { PowerSyncDatabase } from '../../../db/PowerSyncDatabase.js';
|
|
3
|
+
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
4
|
+
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated {@link PowerSyncDatabase} can now be constructed directly
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
SyncStatusOptions
|
|
6
6
|
} from '@powersync/common';
|
|
7
7
|
import * as Comlink from 'comlink';
|
|
8
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
9
|
-
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider';
|
|
10
|
-
import { ManualSharedSyncPayload, SharedSyncClientEvent } from '../../worker/sync/SharedSyncImplementation';
|
|
11
|
-
import { WorkerClient } from '../../worker/sync/WorkerClient';
|
|
12
|
-
import { WebDBAdapter } from '../adapters/WebDBAdapter';
|
|
13
|
-
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption, resolveWebSQLFlags } from '../adapters/web-sql-flags';
|
|
8
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
9
|
+
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider.js';
|
|
10
|
+
import { ManualSharedSyncPayload, SharedSyncClientEvent } from '../../worker/sync/SharedSyncImplementation.js';
|
|
11
|
+
import { WorkerClient } from '../../worker/sync/WorkerClient.js';
|
|
12
|
+
import { WebDBAdapter } from '../adapters/WebDBAdapter.js';
|
|
13
|
+
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption, resolveWebSQLFlags } from '../adapters/web-sql-flags.js';
|
|
14
14
|
import {
|
|
15
15
|
WebStreamingSyncImplementation,
|
|
16
16
|
WebStreamingSyncImplementationOptions
|
|
17
|
-
} from './WebStreamingSyncImplementation';
|
|
17
|
+
} from './WebStreamingSyncImplementation.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The shared worker will trigger methods on this side of the message port
|
package/src/db/sync/WebRemote.ts
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
LockOptions,
|
|
5
5
|
LockType
|
|
6
6
|
} from '@powersync/common';
|
|
7
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
8
|
-
import { ResolvedWebSQLOpenOptions, WebSQLFlags } from '../adapters/web-sql-flags';
|
|
7
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
8
|
+
import { ResolvedWebSQLOpenOptions, WebSQLFlags } from '../adapters/web-sql-flags.js';
|
|
9
9
|
|
|
10
10
|
export interface WebStreamingSyncImplementationOptions extends AbstractStreamingSyncImplementationOptions {
|
|
11
11
|
flags?: WebSQLFlags;
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export * from '@powersync/common';
|
|
2
|
-
export * from './db/adapters/
|
|
3
|
-
export * from './db/adapters/
|
|
4
|
-
export * from './db/adapters/
|
|
5
|
-
export * from './db/adapters/wa-sqlite/WASQLiteConnection';
|
|
6
|
-
export * from './db/adapters/wa-sqlite/WASQLiteDBAdapter';
|
|
7
|
-
export * from './db/adapters/wa-sqlite/WASQLiteOpenFactory';
|
|
8
|
-
export * from './db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory';
|
|
9
|
-
export * from './db/adapters/web-sql-flags';
|
|
10
|
-
export * from './db/PowerSyncDatabase';
|
|
11
|
-
export * from './db/sync/SharedWebStreamingSyncImplementation';
|
|
12
|
-
export * from './db/sync/WebRemote';
|
|
13
|
-
export * from './db/sync/WebStreamingSyncImplementation';
|
|
2
|
+
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
3
|
+
export * from './db/adapters/AbstractWebSQLOpenFactory.js';
|
|
4
|
+
export * from './db/adapters/AsyncDatabaseConnection.js';
|
|
5
|
+
export * from './db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
6
|
+
export * from './db/adapters/wa-sqlite/WASQLiteDBAdapter.js';
|
|
7
|
+
export * from './db/adapters/wa-sqlite/WASQLiteOpenFactory.js';
|
|
8
|
+
export * from './db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js';
|
|
9
|
+
export * from './db/adapters/web-sql-flags.js';
|
|
10
|
+
export * from './db/PowerSyncDatabase.js';
|
|
11
|
+
export * from './db/sync/SharedWebStreamingSyncImplementation.js';
|
|
12
|
+
export * from './db/sync/WebRemote.js';
|
|
13
|
+
export * from './db/sync/WebStreamingSyncImplementation.js';
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
AsyncDatabaseConnection,
|
|
4
4
|
OnTableChangeCallback,
|
|
5
5
|
ProxiedQueryResult
|
|
6
|
-
} from '../../db/adapters/AsyncDatabaseConnection';
|
|
7
|
-
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags';
|
|
6
|
+
} from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
7
|
+
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Keeps track of open DB connections and the clients which
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import '@journeyapps/wa-sqlite';
|
|
6
6
|
import { createBaseLogger, createLogger } from '@powersync/common';
|
|
7
7
|
import * as Comlink from 'comlink';
|
|
8
|
-
import { AsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection';
|
|
9
|
-
import { WorkerDBOpenerOptions } from '../../db/adapters/wa-sqlite/WASQLiteOpenFactory';
|
|
10
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
11
|
-
import { SharedDBWorkerConnection, SharedWASQLiteConnection } from './SharedWASQLiteConnection';
|
|
12
|
-
import { WorkerWASQLiteConnection } from './WorkerWASQLiteConnection';
|
|
8
|
+
import { AsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
9
|
+
import { WorkerDBOpenerOptions } from '../../db/adapters/wa-sqlite/WASQLiteOpenFactory.js';
|
|
10
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
11
|
+
import { SharedDBWorkerConnection, SharedWASQLiteConnection } from './SharedWASQLiteConnection.js';
|
|
12
|
+
import { WorkerWASQLiteConnection } from './WorkerWASQLiteConnection.js';
|
|
13
13
|
|
|
14
14
|
const baseLogger = createBaseLogger();
|
|
15
15
|
baseLogger.useDefaults();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection';
|
|
3
|
-
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
2
|
+
import { OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
3
|
+
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A Small proxy wrapper around the WASqliteConnection.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { OpenAsyncDatabaseConnection } from '
|
|
3
|
-
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
2
|
+
import { OpenAsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
3
|
+
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Opens a shared or dedicated worker which exposes opening of database connections
|
|
@@ -17,18 +17,18 @@ import {
|
|
|
17
17
|
} from '@powersync/common';
|
|
18
18
|
import { Mutex } from 'async-mutex';
|
|
19
19
|
import * as Comlink from 'comlink';
|
|
20
|
-
import { WebRemote } from '../../db/sync/WebRemote';
|
|
20
|
+
import { WebRemote } from '../../db/sync/WebRemote.js';
|
|
21
21
|
import {
|
|
22
22
|
WebStreamingSyncImplementation,
|
|
23
23
|
WebStreamingSyncImplementationOptions
|
|
24
|
-
} from '../../db/sync/WebStreamingSyncImplementation';
|
|
25
|
-
|
|
26
|
-
import { OpenAsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection';
|
|
27
|
-
import { LockedAsyncDatabaseAdapter } from '../../db/adapters/LockedAsyncDatabaseAdapter';
|
|
28
|
-
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection';
|
|
29
|
-
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags';
|
|
30
|
-
import { AbstractSharedSyncClientProvider } from './AbstractSharedSyncClientProvider';
|
|
31
|
-
import { BroadcastLogger } from './BroadcastLogger';
|
|
24
|
+
} from '../../db/sync/WebStreamingSyncImplementation.js';
|
|
25
|
+
|
|
26
|
+
import { OpenAsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
27
|
+
import { LockedAsyncDatabaseAdapter } from '../../db/adapters/LockedAsyncDatabaseAdapter.js';
|
|
28
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection.js';
|
|
29
|
+
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags.js';
|
|
30
|
+
import { AbstractSharedSyncClientProvider } from './AbstractSharedSyncClientProvider.js';
|
|
31
|
+
import { BroadcastLogger } from './BroadcastLogger.js';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @internal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBaseLogger } from '@powersync/common';
|
|
2
|
-
import { SharedSyncImplementation } from './SharedSyncImplementation';
|
|
3
|
-
import { WorkerClient } from './WorkerClient';
|
|
2
|
+
import { SharedSyncImplementation } from './SharedSyncImplementation.js';
|
|
3
|
+
import { WorkerClient } from './WorkerClient.js';
|
|
4
4
|
|
|
5
5
|
const _self: SharedWorkerGlobalScope = self as any;
|
|
6
6
|
const logger = createBaseLogger();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ILogLevel, PowerSyncConnectionOptions, SubscribedStream } from '@powersync/common';
|
|
2
2
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
3
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
4
4
|
import {
|
|
5
5
|
ManualSharedSyncPayload,
|
|
6
6
|
SharedSyncClientEvent,
|
|
7
7
|
SharedSyncImplementation,
|
|
8
8
|
SharedSyncInitOptions,
|
|
9
9
|
WrappedSyncPort
|
|
10
|
-
} from './SharedSyncImplementation';
|
|
10
|
+
} from './SharedSyncImplementation.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* A client to the shared sync worker.
|