Skip to content

Commit 63316f9

Browse files
committed
Merge branch 'main' into native-localauth
2 parents dd3c865 + b1955df commit 63316f9

51 files changed

Lines changed: 2380 additions & 1723 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/lucky-rice-shop.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@evolu/common": patch
3+
---
4+
5+
Remove dead code comments and improve tests
6+
7+
- Simplify JSDoc for `loadQuery` to focus on current behavior (caching for Suspense)
8+
- Add note about SSR behavior to `appOwner`
9+
- Improve `createEvolu` JSDoc with clearer description and instance caching behavior
10+
- Improve tests to use proper async/await patterns and avoid mock libraries
11+
- Add comprehensive test coverage for query loading, subscriptions, and cache behavior

.changeset/pre.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@
2525
"common-ads-serve",
2626
"heavy-mugs-tickle",
2727
"lazy-clouds-exist",
28+
"lucky-rice-shop",
2829
"plenty-carrots-lead",
2930
"rotten-gifts-write",
31+
"short-corners-notice",
3032
"solid-cameras-study",
3133
"some-internal-improvements",
3234
"some-rice-do",
3335
"tricky-wings-join",
3436
"true-teams-wash",
3537
"two-shrimps-yawn",
38+
"upset-beds-try",
3639
"yummy-cups-drop"
3740
]
3841
}

.changeset/short-corners-notice.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@evolu/common": patch
3+
"@evolu/nodejs": patch
4+
"@evolu/relay": patch
5+
---
6+
7+
Add relay authentication support with `authenticateOwner` callback
8+
9+
- Add `createWebSocketTransportConfig` helper to create WebSocket transports with OwnerId for relay authentication
10+
- Add `parseOwnerIdFromUrl` to extract OwnerId from URL query strings on relay side
11+
- Add `authenticateOwner` callback to `RelayConfig` for controlling relay access by OwnerId
12+
- Add comprehensive relay logging with `createRelayLogger`
13+
- Refactor `createNodeJsRelay` to return `Result<Relay, SqliteError>` for proper error handling
14+
- Add HTTP upgrade authentication flow with appropriate status codes (400, 401, 500)
15+
- Rename `createRelayStorage` to `createRelaySqliteStorage` for clarity
16+
- Add `ProtocolQuotaExceededError` for storage/billing quota management (placeholder for future implementation)
17+
- Improve transport configuration documentation with redundancy best practices

.changeset/upset-beds-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@evolu/react": patch
3+
---
4+
5+
Rename `wasSrr` React Hook to `isSrr`.

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
- name: Lint
3838
run: pnpm lint
3939

40+
- name: Lint Monorepo
41+
run: pnpm lint-monorepo
42+
43+
- name: Check Circular Dependencies
44+
run: pnpm circular
45+
4046
- name: Test
4147
run: pnpm test
4248

apps/relay/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# @evolu/relay
22

3+
## 1.1.2-preview.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [446eac5]
8+
- @evolu/common@6.0.1-preview.22
9+
- @evolu/nodejs@1.0.1-preview.9
10+
11+
## 1.1.2-preview.1
12+
13+
### Patch Changes
14+
15+
- d913cf9: Add relay authentication support with `authenticateOwner` callback
16+
- Add `createWebSocketTransportConfig` helper to create WebSocket transports with OwnerId for relay authentication
17+
- Add `parseOwnerIdFromUrl` to extract OwnerId from URL query strings on relay side
18+
- Add `authenticateOwner` callback to `RelayConfig` for controlling relay access by OwnerId
19+
- Add comprehensive relay logging with `createRelayLogger`
20+
- Refactor `createNodeJsRelay` to return `Result<Relay, SqliteError>` for proper error handling
21+
- Add HTTP upgrade authentication flow with appropriate status codes (400, 401, 500)
22+
- Rename `createRelayStorage` to `createRelaySqliteStorage` for clarity
23+
- Add `ProtocolQuotaExceededError` for storage/billing quota management (placeholder for future implementation)
24+
- Improve transport configuration documentation with redundancy best practices
25+
26+
- Updated dependencies [d913cf9]
27+
- @evolu/common@6.0.1-preview.21
28+
- @evolu/nodejs@1.0.1-preview.9
29+
330
## 1.1.2-preview.0
431

532
### Patch Changes

apps/relay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@evolu/relay",
3-
"version": "1.1.2-preview.0",
3+
"version": "1.1.2-preview.2",
44
"private": true,
55
"type": "module",
66
"scripts": {

apps/relay/src/index.ts

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,35 @@ import { createConsole } from "@evolu/common";
22
import { createNodeJsRelay } from "@evolu/nodejs";
33
import { mkdirSync } from "fs";
44

5-
const deps = {
6-
console: createConsole(),
7-
};
8-
95
// Ensure the database is created in a predictable location for Docker.
106
mkdirSync("data", { recursive: true });
117
process.chdir("data");
128

13-
const relay = await createNodeJsRelay(deps)({
9+
const relay = await createNodeJsRelay({
10+
console: createConsole(),
11+
})({
1412
port: 4000,
1513
enableLogging: false,
14+
15+
/**
16+
* ### Example
17+
*
18+
* ```ts
19+
* Evolu.createWebSocketTransportConfig({
20+
* relayUrl: "ws://localhost:4000",
21+
* ownerId: "6jy_2F4RT5qqeLgJ14_dnQ" as Evolu.OwnerId,
22+
* });
23+
* ```
24+
*/
25+
// authenticateOwner: (ownerId) => {
26+
// return Promise.resolve(ownerId === "6jy_2F4RT5qqeLgJ14_dnQ");
27+
// },
1628
});
1729

18-
process.once("SIGINT", relay[Symbol.dispose]);
19-
process.once("SIGTERM", relay[Symbol.dispose]);
30+
if (relay.ok) {
31+
process.once("SIGINT", relay.value[Symbol.dispose]);
32+
process.once("SIGTERM", relay.value[Symbol.dispose]);
33+
} else {
34+
// eslint-disable-next-line no-console
35+
console.error(relay.error);
36+
}

apps/web/src/app/(playgrounds)/playgrounds/full/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
import dynamic from "next/dynamic";
44

5-
// Evolu is currently client-only. Server-side rendering support is planned for
6-
// the future.
5+
/**
6+
* Evolu supports server-side rendering (SSR) even with web-only deps, but
7+
* that's only practical if we want to render empty rows and don't care about
8+
* the layout shift when the client hydrates.
9+
*
10+
* Evolu can also SSR data with server deps (check tests). Use it only for
11+
* non-private (public or shared) data.
12+
*/
713
const EvoluFullExample = dynamic(
814
() =>
915
import("@/components/EvoluFullExample").then((mod) => mod.EvoluFullExample),

apps/web/src/app/(playgrounds)/playgrounds/minimal/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
import dynamic from "next/dynamic";
44

5-
// Evolu is currently client-only. Server-side rendering support is planned for
6-
// the future.
5+
/**
6+
* Evolu supports server-side rendering (SSR) even with web-only deps, but
7+
* that's only practical if we want to render empty rows and don't care about
8+
* the layout shift when the client hydrates.
9+
*
10+
* Evolu can also SSR data with server deps (check tests). Use it only for
11+
* non-private (public or shared) data.
12+
*/
713
const EvoluMinimalExample = dynamic(
814
() =>
915
import("@/components/EvoluMinimalExample").then(

0 commit comments

Comments
 (0)