Skip to content

Commit 96fd04b

Browse files
committed
refactor(evolu): WIP stub with interface preparation for Worker integration
- Uncommented Evolu interface methods: insert/update/upsert/resetAppOwner/reloadApp/exportDatabase - Changed appOwner to Promise<AppOwner> for async resolution - Added createLoadingPromises, createErrorStore helpers - Refactored react-expo components to top-level with prop drilling - Fixed Biome linting: import organization, unused variables Worker integration still TODO - mutations validate but don't persist
1 parent e8b1ecc commit 96fd04b

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

examples/react-expo/app/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
evoluReactNativeDeps,
77
localAuth,
88
} from "@evolu/react-native/expo-sqlite";
9-
import { type FC, Suspense, useEffect, useMemo, useState } from "react";
9+
import { Suspense, useEffect, useMemo, useState, type FC } from "react";
1010
import {
1111
ActivityIndicator,
1212
ScrollView,
@@ -440,7 +440,6 @@ const AuthActions: FC<{
440440
authResult: Evolu.AuthResult | null;
441441
ownerIds: Array<Evolu.AuthList> | null;
442442
}> = ({ evolu, appOwner, authResult, ownerIds }) => {
443-
// biome-ignore lint/correctness/useExhaustiveDependencies: Found ownerIds in outer scope
444443
const otherOwnerIds = useMemo(
445444
() => ownerIds?.filter(({ ownerId }) => ownerId !== appOwner?.id) ?? [],
446445
[appOwner?.id, ownerIds],

packages/common/src/local-first/Evolu.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { dedupeArray, isNonEmptyArray } from "../Array.js";
88
import { assertNonEmptyReadonlyArray } from "../Assert.js";
99
import { createCallbacks } from "../Callbacks.js";
10-
import { createConsole, type ConsoleDep } from "../Console.js";
10+
import { type ConsoleDep, createConsole } from "../Console.js";
1111
import {
1212
createRandomBytes,
1313
type EncryptionKey,
@@ -21,8 +21,8 @@ import { err, ok, type Result } from "../Result.js";
2121
import { SqliteBoolean, sqliteBooleanToBoolean } from "../Sqlite.js";
2222
import { createStore, type ReadonlyStore, type Store } from "../Store.js";
2323
import {
24-
createId,
2524
type AnyType,
25+
createId,
2626
type Id,
2727
type InferErrors,
2828
type InferInput,
@@ -32,7 +32,7 @@ import {
3232
} from "../Type.js";
3333
import type { CreateMessageChannelDep } from "../Worker.js";
3434
import type { EvoluError } from "./Error.js";
35-
import { type AppOwner, type OwnerId, type OwnerTransport } from "./Owner.js";
35+
import type { AppOwner, OwnerId, OwnerTransport } from "./Owner.js";
3636
import { pack } from "./Protocol.js";
3737
import {
3838
createSubscribedQueries,
@@ -46,17 +46,17 @@ import {
4646
type SubscribedQueries,
4747
} from "./Query.js";
4848
import {
49-
SystemColumns,
50-
insertable,
51-
updateable,
52-
upsertable,
5349
type EvoluSchema,
5450
type IndexesConfig,
51+
insertable,
5552
type Mutation,
5653
type MutationChange,
5754
type MutationKind,
5855
type MutationMapping,
5956
type MutationOptions,
57+
SystemColumns,
58+
updateable,
59+
upsertable,
6060
type ValidateSchema,
6161
} from "./Schema.js";
6262
import type { DbChange, ValidDbChangeValues } from "./Storage.js";
@@ -1011,7 +1011,7 @@ export const createEvolu =
10111011

10121012
exportDatabase: () =>
10131013
new Promise<Uint8Array>((resolve) => {
1014-
const id = exportCallbacks.register(resolve);
1014+
const _id = exportCallbacks.register(resolve);
10151015
// dbWorker.postMessage({ type: "export", id });
10161016
}),
10171017

packages/common/test/local-first/Evolu.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Schema = {
1818
},
1919
};
2020

21-
const createEvoluRun = () => testCreateRun({ reloadApp: lazyVoid });
21+
const _createEvoluRun = () => testCreateRun({ reloadApp: lazyVoid });
2222

2323
const createMockMessageChannel = () => {
2424
const listeners1 = new Set<(msg: any) => void>();

0 commit comments

Comments
 (0)