create-syncular-app 0.15.40 → 0.15.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-syncular-app",
3
- "version": "0.15.40",
3
+ "version": "0.15.43",
4
4
  "description": "Scaffold a new Syncular app: `create-syncular-app`",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -49,6 +49,6 @@
49
49
  "!dist/**/*.test.d.ts"
50
50
  ],
51
51
  "devDependencies": {
52
- "@syncular/typegen": "0.15.40"
52
+ "@syncular/typegen": "0.15.43"
53
53
  }
54
54
  }
@@ -32,9 +32,10 @@ bun run clients # terminal 2 — prints "✓ converged"
32
32
  1. **`src/server.ts` → `resolveScopes`** — the whole authorization story. It
33
33
  runs in your backend next to your auth. The starter returns `['*']` (see
34
34
  everything); a real one returns the scope values the authenticated actor may
35
- see. Multiple variables are independent, not correlated parent/child tuples:
36
- test isolation with at least two parents and child IDs, and carry the parent
37
- scope on every child table before using a child wildcard. See
35
+ see. Multiple variables are independent dimensions, so every combination of
36
+ allowed values is authorized: test isolation with at least two parents and
37
+ child IDs, and carry the parent scope on every child table before using a
38
+ child wildcard. See
38
39
  [Scopes & authorization](https://syncular.dev/concepts-scopes/).
39
40
  2. **`src/server.ts` → `authenticate`** — plug in your real session/token
40
41
  check; return `{ actorId, partition }` or `null` for a 401.
@@ -77,10 +77,10 @@ On desktop, the plugin owns the database path and the transport — see
77
77
 
78
78
  1. **`src/server.ts` → `resolveScopes`** — the whole authorization story. The
79
79
  starter returns `['*']`; a real one returns the scope values the
80
- authenticated actor may see. Multiple variables are independent, not
81
- correlated parent/child tuples: test isolation with at least two parents and
82
- child IDs, and carry the parent scope on every child table before using a
83
- child wildcard. See
80
+ authenticated actor may see. Multiple variables are independent dimensions,
81
+ so every combination of allowed values is authorized: test isolation with at
82
+ least two parents and child IDs, and carry the parent scope on every child
83
+ table before using a child wildcard. See
84
84
  [Scopes & authorization](https://syncular.dev/concepts-scopes/).
85
85
  2. **`src/server.ts` → `authenticate`** — plug in your real session/token
86
86
  check; return `{ actorId, partition }` or `null` for a 401.
@@ -42,10 +42,15 @@ export interface Engine extends SyncClientLike {
42
42
  const isTauri = () => '__TAURI_INTERNALS__' in window;
43
43
 
44
44
  export async function createEngine(): Promise<Engine> {
45
+ // Both hosts hand this view a shared transport — the Tauri core lives in
46
+ // the host process behind every webview, and the browser handle is
47
+ // multi-tab (followers proxy to one leader socket) — so `sharedTransport`
48
+ // keeps a hidden view from tearing down realtime for a visible sibling.
45
49
  const supervise = <Client extends Engine>(client: Client): Client =>
46
50
  installRealtimeSupervisor(client, {
47
51
  connectivity: browserConnectivitySignal(),
48
52
  lifecycle: documentLifecycleSignal(),
53
+ sharedTransport: true,
49
54
  });
50
55
  if (isTauri()) {
51
56
  // Desktop: the native Rust core in the Tauri process.
@@ -21,7 +21,7 @@ tauri = { version = "2", features = [] }
21
21
  # The syncular plugin from crates.io. `native-transport` gives the core its
22
22
  # real HTTP + WebSocket transport (ureq + tungstenite) inside the host
23
23
  # process — the webview never talks to the sync server directly.
24
- tauri-plugin-syncular = { version = "0.15.40", features = ["native-transport"] }
24
+ tauri-plugin-syncular = { version = "0.15.43", features = ["native-transport"] }
25
25
 
26
26
  [features]
27
27
  default = []
@@ -43,9 +43,10 @@ covered by `tsc`).
43
43
  1. **`src/server.ts` → `resolveScopes`** — the whole authorization story. It
44
44
  runs in your backend next to your auth. The starter returns `['*']`; a real
45
45
  one returns the scope values the authenticated actor may see. Multiple
46
- variables are independent, not correlated parent/child tuples: test
47
- isolation with at least two parents and child IDs, and carry the parent scope
48
- on every child table before using a child wildcard. See
46
+ variables are independent dimensions, so every combination of allowed values
47
+ is authorized: test isolation with at least two parents and child IDs, and
48
+ carry the parent scope on every child table before using a child wildcard.
49
+ See
49
50
  [Scopes & authorization](https://syncular.dev/concepts-scopes/).
50
51
  2. **`src/server.ts` → `authenticate`** — plug in your real session/token
51
52
  check; return `{ actorId, partition }` or `null` for a 401.
@@ -69,11 +69,15 @@ async function main(): Promise<void> {
69
69
  });
70
70
 
71
71
  // The supported host policy owns connect + catch-up, retries transient
72
- // startup/socket loss, and suspends while this page is offline or hidden.
72
+ // startup/socket loss, and suspends while this page is offline.
73
73
  // Rendering remains local-first: no network promise blocks app startup.
74
+ // The handle is multi-tab (followers proxy to one leader socket), so
75
+ // `sharedTransport` keeps a hidden tab from tearing down realtime for a
76
+ // sibling tab that is still visible.
74
77
  installRealtimeSupervisor(handle, {
75
78
  connectivity: browserConnectivitySignal(),
76
79
  lifecycle: documentLifecycleSignal(),
80
+ sharedTransport: true,
77
81
  });
78
82
  const renderRealtimeStatus = () => {
79
83
  const phase = realtimeSupervisorSnapshot(handle).phase;