Skip to content

Commit 0267713

Browse files
committed
Merge branch 'main' into 'isolate-demos'
2 parents 1b0b77c + 317c748 commit 0267713

File tree

31 files changed

+159
-60
lines changed

31 files changed

+159
-60
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@powersync/drizzle-driver": patch
3+
---
4+
5+
Reorder export attributes to prevent "Error: Default condition should be last one".

.changeset/large-ravens-divide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@powersync/react-native': minor
3+
'@powersync/common': minor
4+
'@powersync/node': minor
5+
'@powersync/web': minor
6+
---
7+
8+
Update PowerSync SQLite core to v0.4.10

.changeset/quick-lemons-switch.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@powersync/op-sqlite': patch
3+
'@powersync/capacitor': patch
4+
---
5+
6+
Update PowerSync SQLite core to v0.4.10

.changeset/quiet-owls-flash.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@powersync/react-native': minor
3+
'@powersync/common': minor
4+
'@powersync/node': minor
5+
'@powersync/web': minor
6+
'@powersync/capacitor': minor
7+
---
8+
9+
Added ability to specify `appMetadata` for sync/stream requests.
10+
11+
Note: This requires a PowerSync service version `>=1.17.0` in order for logs to display metadata.
12+
13+
```javascript
14+
powerSync.connect(connector, {
15+
// This will be included in PowerSync service logs
16+
appMetadata: {
17+
app_version: MY_APP_VERSION
18+
}
19+
});
20+
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/7372448/d2538c43-c1a0-4c47-9a76-41462dba484f"/></a>
33
</p>
44

5-
_[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side._
5+
_[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB, MySQL or SQL Server on the server-side._
66

77
# PowerSync JavaScript SDKs
88

demos/django-react-native-todolist/ios/powersyncexample.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@
300300
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle",
301301
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
302302
"${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle",
303-
"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle",
304303
);
305304
name = "[CP] Copy Pods Resources";
306305
outputPaths = (
@@ -330,7 +329,6 @@
330329
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle",
331330
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
332331
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle",
333-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle",
334332
);
335333
runOnlyForDeploymentPostprocessing = 0;
336334
shellPath = /bin/sh;

demos/example-nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@emotion/react": "^11.11.4",
1515
"@emotion/styled": "^11.11.5",
1616
"@fontsource/roboto": "^5.0.13",
17-
"@journeyapps/wa-sqlite": "^1.3.2",
17+
"@journeyapps/wa-sqlite": "^1.4.0",
1818
"@lexical/react": "^0.15.0",
1919
"@mui/icons-material": "^5.15.18",
2020
"@mui/material": "^5.15.18",

demos/example-node/src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import {
1010
SyncStreamConnectionMethod
1111
} from '@powersync/node';
1212
import { exit } from 'node:process';
13+
import { WorkerOpener } from 'node_modules/@powersync/node/src/db/options.js';
1314
import { AppSchema, DemoConnector } from './powersync.js';
1415
import { enableUncidiDiagnostics } from './UndiciDiagnostics.js';
15-
import { WorkerOpener } from 'node_modules/@powersync/node/src/db/options.js';
16-
import { LockContext } from 'node_modules/@powersync/node/dist/bundle.cjs';
1716

1817
const main = async () => {
1918
const baseLogger = createBaseLogger();
@@ -59,10 +58,12 @@ const main = async () => {
5958
logger
6059
});
6160
console.log(await db.get('SELECT powersync_rs_version();'));
62-
6361
await db.connect(new DemoConnector(), {
6462
connectionMethod: SyncStreamConnectionMethod.WEB_SOCKET,
65-
clientImplementation: SyncClientImplementation.RUST
63+
clientImplementation: SyncClientImplementation.RUST,
64+
appMetadata: {
65+
app_version: process.env.npm_package_version || 'unknown'
66+
}
6667
});
6768
// Example using a proxy agent for more control over the connection:
6869
// const proxyAgent = new (await import('undici')).ProxyAgent({

demos/react-supabase-todolist/src/components/providers/SystemProvider.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { createBaseLogger, DifferentialWatchedQuery, LogLevel, PowerSyncDatabase
77
import React, { Suspense } from 'react';
88
import { NavigationPanelContextProvider } from '../navigation/NavigationPanelContext';
99

10+
declare const APP_VERSION: string;
11+
1012
const SupabaseContext = React.createContext<SupabaseConnector | null>(null);
1113
export const useSupabase = () => React.useContext(SupabaseContext);
1214

@@ -68,7 +70,11 @@ export const SystemProvider = ({ children }: { children: React.ReactNode }) => {
6870
const l = connector.registerListener({
6971
initialized: () => {},
7072
sessionStarted: () => {
71-
powerSync.connect(connector);
73+
powerSync.connect(connector, {
74+
appMetadata: {
75+
app_version: APP_VERSION
76+
}
77+
});
7278
}
7379
});
7480

demos/react-supabase-todolist/vite.config.mts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import wasm from 'vite-plugin-wasm';
2-
import topLevelAwait from 'vite-plugin-top-level-await';
31
import { fileURLToPath, URL } from 'url';
2+
import topLevelAwait from 'vite-plugin-top-level-await';
3+
import wasm from 'vite-plugin-wasm';
44

5-
import { defineConfig } from 'vite';
65
import react from '@vitejs/plugin-react';
6+
import { defineConfig } from 'vite';
77
import { VitePWA } from 'vite-plugin-pwa';
88

99
// https://vitejs.dev/config/
@@ -19,6 +19,9 @@ export default defineConfig({
1919
resolve: {
2020
alias: [{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }]
2121
},
22+
define: {
23+
APP_VERSION: JSON.stringify(process.env.npm_package_version)
24+
},
2225
publicDir: '../public',
2326
envDir: '..', // Use this dir for env vars, not 'src'.
2427
optimizeDeps: {

0 commit comments

Comments
 (0)