Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
updated common sdk v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Feb 1, 2024
1 parent b261c2c commit 0d19d55
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 37 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-steaks-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/powersync-sdk-web': minor
---

Updated common SDK. Changes https://github.com/powersync-ja/powersync-react-native-sdk/pull/46
4 changes: 2 additions & 2 deletions demos/powersync-nextjs-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@journeyapps/powersync-react": "1.0.1",
"@journeyapps/powersync-react": "1.0.3",
"@journeyapps/powersync-sdk-web": "workspace:*",
"@journeyapps/wa-sqlite": "~0.1.0",
"@journeyapps/wa-sqlite": "~0.1.1",
"@mui/icons-material": "^5.14.16",
"@mui/material": "^5.14.16",
"@mui/x-data-grid": "^6.17.0",
Expand Down
4 changes: 2 additions & 2 deletions demos/powersync-supabase-yjs-text-collab-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@journeyapps/powersync-react": "^1.0.1",
"@journeyapps/powersync-react": "1.0.3",
"@journeyapps/powersync-sdk-web": "workspace:*",
"@journeyapps/wa-sqlite": "~0.1.0",
"@journeyapps/wa-sqlite": "~0.1.1",
"@lexical/react": "^0.11.1",
"@mui/icons-material": "^5.14.16",
"@mui/material": "^5.14.16",
Expand Down
6 changes: 3 additions & 3 deletions packages/powersync-sdk-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
"author": "JOURNEYAPPS",
"license": "Apache-2.0",
"devDependencies": {
"@journeyapps/wa-sqlite": "~0.1.0",
"@journeyapps/wa-sqlite": "~0.1.1",
"@types/lodash": "^4.14.200",
"@types/uuid": "^9.0.6",
"typescript": "^5.2.2"
},
"peerDependencies": {
"@journeyapps/wa-sqlite": "~0.1.0"
"@journeyapps/wa-sqlite": "~0.1.1"
},
"dependencies": {
"@journeyapps/powersync-sdk-common": "1.0.1",
"@journeyapps/powersync-sdk-common": "1.2.0",
"async-mutex": "^0.4.0",
"comlink": "^4.4.1",
"js-logger": "^1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync-sdk-web/src/db/PowerSyncDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
await this.waitForReady();
await connector.uploadData(this);
},
workerIdentifier: this.options.database.name
identifier: this.options.database.name
};

const { flags } = this.options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class SharedWebStreamingSyncImplementation extends WebStreamingSyncImplem
this.syncTabId = uuid();
const worker = new SharedWorker(new URL('../../worker/sync/SharedSyncImplementation.worker.js', import.meta.url), {
/* @vite-ignore */
name: `shared-sync-${this.webOptions.workerIdentifier}`,
name: `shared-sync-${this.webOptions.identifier}`,
type: 'module'
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import {
LockType
} from '@journeyapps/powersync-sdk-common';

export interface WebStreamingSyncImplementationOptions extends AbstractStreamingSyncImplementationOptions {
/**
* An identifier for which PowerSync DB this sync implementation is
* linked to. Most commonly DB name, but not restricted to DB name.
*/
workerIdentifier: string;
}
export interface WebStreamingSyncImplementationOptions extends AbstractStreamingSyncImplementationOptions {}

export class WebStreamingSyncImplementation extends AbstractStreamingSyncImplementation {
constructor(options: WebStreamingSyncImplementationOptions) {
Expand All @@ -25,7 +19,7 @@ export class WebStreamingSyncImplementation extends AbstractStreamingSyncImpleme
}

obtainLock<T>(lockOptions: LockOptions<T>): Promise<T> {
const identifier = `streaming-sync-${lockOptions.type}-${this.webOptions.workerIdentifier}`;
const identifier = `streaming-sync-${lockOptions.type}-${this.webOptions.identifier}`;
lockOptions.type == LockType.SYNC && console.debug('requesting lock for ', identifier);
return navigator.locks.request(identifier, { signal: lockOptions.signal }, lockOptions.callback);
}
Expand Down
40 changes: 20 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d19d55

Please sign in to comment.