Skip to content

Commit 0e0ef52

Browse files
committed
Merge branch 'main' into poc-sqljs
2 parents 46bd668 + 6b38551 commit 0e0ef52

39 files changed

+348
-150
lines changed

.changeset/bright-snakes-clean.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.changeset/bright-yaks-pump.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@powersync/common': patch
3+
'@powersync/react-native': patch
4+
'@powersync/web': patch
5+
---
6+
7+
Fixed bug where a WebSocket connection timeout could cause an uncaught exception.

.changeset/cuddly-dingos-check.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changeset/curly-bugs-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/web': minor
3+
---
4+
5+
Export AsyncDatabaseConnection (and related) types for internal use

.changeset/mighty-doors-judge.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
'@powersync/react-native': patch
32
'@powersync/common': patch
4-
'@powersync/web': patch
53
'@powersync/node': patch
4+
'@powersync/react': patch
5+
'@powersync/react-native': patch
6+
'@powersync/web': patch
67
---
78

8-
Fix sync stream delays during CRUD upload.
9+
Fix a warning about raw tables being used when they're not.

.changeset/short-countries-swim.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

demos/react-supabase-todolist/src/app/views/layout.tsx

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { LOGIN_ROUTE, SQL_CONSOLE_ROUTE, TODO_LISTS_ROUTE } from '@/app/router';
2+
import { useNavigationPanel } from '@/components/navigation/NavigationPanelContext';
3+
import { useSupabase } from '@/components/providers/SystemProvider';
14
import ChecklistRtlIcon from '@mui/icons-material/ChecklistRtl';
25
import ExitToAppIcon from '@mui/icons-material/ExitToApp';
36
import MenuIcon from '@mui/icons-material/Menu';
@@ -17,16 +20,15 @@ import {
1720
ListItemButton,
1821
ListItemIcon,
1922
ListItemText,
23+
Menu,
24+
MenuItem,
2025
Toolbar,
2126
Typography,
2227
styled
2328
} from '@mui/material';
24-
import React from 'react';
2529
import { usePowerSync, useStatus } from '@powersync/react';
30+
import React from 'react';
2631
import { useNavigate } from 'react-router-dom';
27-
import { useSupabase } from '@/components/providers/SystemProvider';
28-
import { useNavigationPanel } from '@/components/navigation/NavigationPanelContext';
29-
import { LOGIN_ROUTE, SQL_CONSOLE_ROUTE, TODO_LISTS_ROUTE } from '@/app/router';
3032

3133
export default function ViewsLayout({ children }: { children: React.ReactNode }) {
3234
const powerSync = usePowerSync();
@@ -37,6 +39,8 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
3739
const [openDrawer, setOpenDrawer] = React.useState(false);
3840
const { title } = useNavigationPanel();
3941

42+
const [connectionAnchor, setConnectionAnchor] = React.useState<null | HTMLElement>(null);
43+
4044
const NAVIGATION_ITEMS = React.useMemo(
4145
() => [
4246
{
@@ -72,16 +76,45 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
7276
color="inherit"
7377
aria-label="menu"
7478
sx={{ mr: 2 }}
75-
onClick={() => setOpenDrawer(!openDrawer)}
76-
>
79+
onClick={() => setOpenDrawer(!openDrawer)}>
7780
<MenuIcon />
7881
</IconButton>
7982
<Box sx={{ flexGrow: 1 }}>
8083
<Typography>{title}</Typography>
8184
</Box>
8285
<NorthIcon sx={{ marginRight: '-10px' }} color={status?.dataFlowStatus.uploading ? 'primary' : 'inherit'} />
8386
<SouthIcon color={status?.dataFlowStatus.downloading ? 'primary' : 'inherit'} />
84-
{status?.connected ? <WifiIcon /> : <SignalWifiOffIcon />}
87+
<Box
88+
sx={{ cursor: 'pointer' }}
89+
onClick={(event) => {
90+
setConnectionAnchor(event.currentTarget);
91+
}}>
92+
{status?.connected ? <WifiIcon /> : <SignalWifiOffIcon />}
93+
</Box>
94+
{/* Allows for manual connection and disconnect for testing purposes */}
95+
<Menu
96+
id="connection-menu"
97+
anchorEl={connectionAnchor}
98+
open={Boolean(connectionAnchor)}
99+
onClose={() => setConnectionAnchor(null)}>
100+
{status?.connected || status?.connecting ? (
101+
<MenuItem
102+
onClick={(event) => {
103+
setConnectionAnchor(null);
104+
powerSync.disconnect();
105+
}}>
106+
Disconnect
107+
</MenuItem>
108+
) : supabase ? (
109+
<MenuItem
110+
onClick={(event) => {
111+
setConnectionAnchor(null);
112+
powerSync.connect(supabase);
113+
}}>
114+
Connect
115+
</MenuItem>
116+
) : null}
117+
</Menu>
85118
</Toolbar>
86119
</S.TopBar>
87120
<Drawer anchor={'left'} open={openDrawer} onClose={() => setOpenDrawer(false)}>
@@ -95,8 +128,7 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
95128
await item.beforeNavigate?.();
96129
navigate(item.path);
97130
setOpenDrawer(false);
98-
}}
99-
>
131+
}}>
100132
<ListItemIcon>{item.icon()}</ListItemIcon>
101133
<ListItemText primary={item.title} />
102134
</ListItemButton>

packages/attachments/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test": "pnpm build && vitest"
3030
},
3131
"peerDependencies": {
32-
"@powersync/common": "workspace:^1.33.2"
32+
"@powersync/common": "workspace:^1.34.0"
3333
},
3434
"devDependencies": {
3535
"@powersync/common": "workspace:*",

packages/common/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# @powersync/common
22

3+
## 1.34.0
4+
5+
### Minor Changes
6+
7+
- ab33799: Add experimental support for raw tables, giving you full control over the table structure to sync into.
8+
While PowerSync manages tables as JSON views by default, raw tables have to be created by the application
9+
developer.
10+
11+
For more information about raw tables, see [the documentation](https://docs.powersync.com/usage/use-case-examples/raw-tables).
12+
13+
- 810c6ad: Propagate logger from PowerSyncDatabase to streaming sync and remote implementations, and tweak some log messages.
14+
15+
### Patch Changes
16+
17+
- a1aa18c: Fix sync stream delays during CRUD upload.
18+
- 9fb898d: [Internal] Removed shared mutex implementation of `readLock` and `writeLock`.
19+
320
## 1.33.2
421

522
### Patch Changes

0 commit comments

Comments
 (0)