@livestore/livestore 0.0.0 → 0.0.2
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/dist/.tsbuildinfo +1 -1
- package/dist/backends/index.d.ts +5 -1
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +4 -4
- package/dist/backends/index.js.map +1 -1
- package/dist/backends/tauri.d.ts +2 -4
- package/dist/backends/tauri.d.ts.map +1 -1
- package/dist/backends/tauri.js +3 -3
- package/dist/backends/tauri.js.map +1 -1
- package/dist/backends/web-in-memory.d.ts +2 -4
- package/dist/backends/web-in-memory.d.ts.map +1 -1
- package/dist/backends/web-in-memory.js +2 -3
- package/dist/backends/web-in-memory.js.map +1 -1
- package/dist/backends/web.d.ts +2 -3
- package/dist/backends/web.d.ts.map +1 -1
- package/dist/backends/web.js +2 -3
- package/dist/backends/web.js.map +1 -1
- package/dist/effect/LiveStore.d.ts +8 -8
- package/dist/effect/LiveStore.d.ts.map +1 -1
- package/dist/effect/LiveStore.js +12 -8
- package/dist/effect/LiveStore.js.map +1 -1
- package/dist/otel.js +1 -1
- package/dist/otel.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +5 -2
- package/dist/store.js.map +1 -1
- package/package.json +10 -3
- package/src/backends/index.ts +8 -4
- package/src/backends/tauri.ts +7 -11
- package/src/backends/web-in-memory.ts +6 -6
- package/src/backends/web.ts +6 -5
- package/src/effect/LiveStore.ts +23 -16
- package/src/otel.ts +1 -1
- package/src/store.ts +5 -2
- package/dist/LiveRiffleStore.d.ts +0 -42
- package/dist/LiveRiffleStore.d.ts.map +0 -1
- package/dist/LiveRiffleStore.js +0 -36
- package/dist/LiveRiffleStore.js.map +0 -1
- package/dist/__tests__/react/useRiffleComponent.test.d.ts +0 -2
- package/dist/__tests__/react/useRiffleComponent.test.d.ts.map +0 -1
- package/dist/__tests__/react/useRiffleComponent.test.js +0 -78
- package/dist/__tests__/react/useRiffleComponent.test.js.map +0 -1
- package/dist/react/RiffleProvider.d.ts +0 -21
- package/dist/react/RiffleProvider.d.ts.map +0 -1
- package/dist/react/RiffleProvider.js +0 -48
- package/dist/react/RiffleProvider.js.map +0 -1
- package/dist/react/StoreContext.d.ts +0 -11
- package/dist/react/StoreContext.d.ts.map +0 -1
- package/dist/react/StoreContext.js +0 -10
- package/dist/react/StoreContext.js.map +0 -1
- package/dist/react/useRiffleComponent.d.ts +0 -70
- package/dist/react/useRiffleComponent.d.ts.map +0 -1
- package/dist/react/useRiffleComponent.js +0 -261
- package/dist/react/useRiffleComponent.js.map +0 -1
- package/dist/react/useRiffleJsonHook.d.ts +0 -4
- package/dist/react/useRiffleJsonHook.d.ts.map +0 -1
- package/dist/react/useRiffleJsonHook.js +0 -21
- package/dist/react/useRiffleJsonHook.js.map +0 -1
package/src/backends/tauri.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { getTraceParentHeader
|
|
1
|
+
import { getTraceParentHeader } from '@livestore/utils'
|
|
2
2
|
import type * as otel from '@opentelemetry/api'
|
|
3
3
|
import { invoke } from '@tauri-apps/api/tauri'
|
|
4
4
|
|
|
5
5
|
import type { ParamsObject } from '../util.js'
|
|
6
6
|
import { prepareBindValues } from '../util.js'
|
|
7
7
|
import { BaseBackend } from './base.js'
|
|
8
|
-
import type { SelectResponse } from './index.js'
|
|
8
|
+
import type { BackendOtelProps, SelectResponse } from './index.js'
|
|
9
9
|
|
|
10
10
|
export type BackendOptionsTauri = {
|
|
11
11
|
type: 'tauri'
|
|
12
12
|
dbDirPath: string
|
|
13
13
|
appDbFileName: string
|
|
14
|
-
otelTracer?: otel.Tracer
|
|
15
|
-
parentSpan: otel.Span
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
export class TauriBackend extends BaseBackend {
|
|
@@ -25,16 +23,14 @@ export class TauriBackend extends BaseBackend {
|
|
|
25
23
|
super()
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
static load = async (
|
|
29
|
-
dbDirPath,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
parentSpan,
|
|
33
|
-
}: BackendOptionsTauri): Promise<TauriBackend> => {
|
|
26
|
+
static load = async (
|
|
27
|
+
{ dbDirPath, appDbFileName }: BackendOptionsTauri,
|
|
28
|
+
{ otelTracer, parentSpan }: BackendOtelProps,
|
|
29
|
+
): Promise<TauriBackend> => {
|
|
34
30
|
const dbFilePath = `${dbDirPath}/${appDbFileName}`
|
|
35
31
|
await invoke('initialize_connection', { dbName: dbFilePath, otelData: getOtelData_(parentSpan) })
|
|
36
32
|
|
|
37
|
-
return new TauriBackend(dbFilePath, dbDirPath, otelTracer
|
|
33
|
+
return new TauriBackend(dbFilePath, dbDirPath, otelTracer, parentSpan)
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
execute = (query: string, bindValues?: ParamsObject, parentSpan?: otel.Span): void => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { makeNoopTracer } from '@livestore/utils'
|
|
2
1
|
import type * as otel from '@opentelemetry/api'
|
|
3
2
|
import type * as SqliteWasm from 'sqlite-esm'
|
|
4
3
|
import sqlite3InitModule from 'sqlite-esm'
|
|
@@ -6,12 +5,10 @@ import sqlite3InitModule from 'sqlite-esm'
|
|
|
6
5
|
import type { ParamsObject } from '../util.js'
|
|
7
6
|
import { prepareBindValues } from '../util.js'
|
|
8
7
|
import { BaseBackend } from './base.js'
|
|
9
|
-
import type { SelectResponse } from './index.js'
|
|
8
|
+
import type { BackendOtelProps, SelectResponse } from './index.js'
|
|
10
9
|
|
|
11
10
|
export type BackendOptionsWebInMemory = {
|
|
12
11
|
type: 'web-in-memory'
|
|
13
|
-
/** Specifies where to persist data for this backend */
|
|
14
|
-
otelTracer?: otel.Tracer
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
declare type DatabaseWithCAPI = SqliteWasm.Database & { capi: SqliteWasm.CAPI }
|
|
@@ -25,7 +22,10 @@ export class WebInMemoryBackend extends BaseBackend {
|
|
|
25
22
|
super()
|
|
26
23
|
}
|
|
27
24
|
|
|
28
|
-
static load = async (
|
|
25
|
+
static load = async (
|
|
26
|
+
_options: BackendOptionsWebInMemory,
|
|
27
|
+
{ otelTracer }: BackendOtelProps,
|
|
28
|
+
): Promise<WebInMemoryBackend> => {
|
|
29
29
|
const sqlite3 = await sqlite3InitModule({
|
|
30
30
|
print: (message) => console.log(`[sql-client] ${message}`),
|
|
31
31
|
printErr: (message) => console.error(`[sql-client] ${message}`),
|
|
@@ -33,7 +33,7 @@ export class WebInMemoryBackend extends BaseBackend {
|
|
|
33
33
|
const db = new sqlite3.oo1.DB({ filename: ':memory:', flags: 'c' }) as DatabaseWithCAPI
|
|
34
34
|
db.capi = sqlite3.capi
|
|
35
35
|
|
|
36
|
-
return new WebInMemoryBackend(
|
|
36
|
+
return new WebInMemoryBackend(otelTracer, db)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
execute = (query: string, bindValues?: ParamsObject): void => {
|
package/src/backends/web.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { makeNoopTracer } from '@livestore/utils'
|
|
2
1
|
import type * as otel from '@opentelemetry/api'
|
|
3
2
|
import * as Comlink from 'comlink'
|
|
4
3
|
|
|
5
4
|
import type { ParamsObject } from '../util.js'
|
|
6
5
|
import { prepareBindValues } from '../util.js'
|
|
7
6
|
import { BaseBackend } from './base.js'
|
|
8
|
-
import type { SelectResponse, WritableDatabaseLocation } from './index.js'
|
|
7
|
+
import type { BackendOtelProps, SelectResponse, WritableDatabaseLocation } from './index.js'
|
|
9
8
|
import type { WrappedWorker } from './web-worker.js'
|
|
10
9
|
|
|
11
10
|
export type BackendOptionsWeb = {
|
|
12
11
|
type: 'web'
|
|
13
12
|
/** Specifies where to persist data for this backend */
|
|
14
13
|
persistentDatabaseLocation: WritableDatabaseLocation
|
|
15
|
-
otelTracer?: otel.Tracer
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
export class WebWorkerBackend extends BaseBackend {
|
|
@@ -38,7 +36,10 @@ export class WebWorkerBackend extends BaseBackend {
|
|
|
38
36
|
this.otelTracer = otelTracer
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
static load = async (
|
|
39
|
+
static load = async (
|
|
40
|
+
{ persistentDatabaseLocation }: BackendOptionsWeb,
|
|
41
|
+
{ otelTracer }: BackendOtelProps,
|
|
42
|
+
): Promise<WebWorkerBackend> => {
|
|
42
43
|
// TODO: Importing the worker like this only works with Vite;
|
|
43
44
|
// should this really be inside the LiveStore library?
|
|
44
45
|
// Doesn't work with Firefox right now during dev https://bugzilla.mozilla.org/show_bug.cgi?id=1247687
|
|
@@ -52,7 +53,7 @@ export class WebWorkerBackend extends BaseBackend {
|
|
|
52
53
|
return new WebWorkerBackend({
|
|
53
54
|
worker: wrappedWorker,
|
|
54
55
|
persistentDatabaseLocation,
|
|
55
|
-
otelTracer
|
|
56
|
+
otelTracer,
|
|
56
57
|
})
|
|
57
58
|
}
|
|
58
59
|
|
package/src/effect/LiveStore.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Scope } from '@livestore/utils/effect'
|
|
2
|
-
import { Context, Deferred, Duration, Effect, Layer,
|
|
3
|
-
import
|
|
2
|
+
import { Context, Deferred, Duration, Effect, Layer, OtelTracer, pipe, Runtime } from '@livestore/utils/effect'
|
|
3
|
+
import * as otel from '@opentelemetry/api'
|
|
4
4
|
import type { GraphQLSchema } from 'graphql'
|
|
5
5
|
import { mapValues } from 'lodash-es'
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@ import type { Schema } from '../schema.js'
|
|
|
10
10
|
import type { BaseGraphQLContext, GraphQLOptions, LiveStoreQuery, Store } from '../store.js'
|
|
11
11
|
import { createStore } from '../store.js'
|
|
12
12
|
|
|
13
|
+
// TODO get rid of `LiveStoreContext` wrapper and only expose the `Store` directly
|
|
13
14
|
export type LiveStoreContext = {
|
|
14
15
|
store: Store<any>
|
|
15
16
|
globalQueries: LiveStoreQueryTypes
|
|
@@ -39,21 +40,21 @@ export const DeferredStoreContext = Context.Tag<DeferredStoreContext>(
|
|
|
39
40
|
|
|
40
41
|
export type LiveStoreContextProps<GraphQLContext extends BaseGraphQLContext> = {
|
|
41
42
|
schema: Schema
|
|
42
|
-
globalQueryDefs?: Effect.Effect<
|
|
43
|
-
backendOptions: Effect.Effect<
|
|
43
|
+
globalQueryDefs?: Effect.Effect<never, never, GlobalQueryDefs>
|
|
44
|
+
backendOptions: Effect.Effect<never, never, BackendOptions>
|
|
44
45
|
graphQLOptions?: {
|
|
45
|
-
schema: Effect.Effect<
|
|
46
|
+
schema: Effect.Effect<otel.Tracer, never, GraphQLSchema>
|
|
46
47
|
makeContext: (db: InMemoryDatabase) => GraphQLContext
|
|
47
48
|
}
|
|
48
|
-
boot?: (backend: Backend) => Effect.Effect<
|
|
49
|
+
boot?: (backend: Backend) => Effect.Effect<never, never, void>
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export const LiveStoreContextLayer = <GraphQLContext extends BaseGraphQLContext>(
|
|
52
53
|
props: LiveStoreContextProps<GraphQLContext>,
|
|
53
|
-
): Layer.Layer<
|
|
54
|
+
): Layer.Layer<otel.Tracer, never, LiveStoreContext> =>
|
|
54
55
|
Layer.provide(
|
|
55
56
|
LiveStoreContextDeferred,
|
|
56
|
-
|
|
57
|
+
Layer.scoped(LiveStoreContext, makeLiveStoreContext(props)).pipe(Layer.withSpan('LiveStore')),
|
|
57
58
|
)
|
|
58
59
|
|
|
59
60
|
export const LiveStoreContextDeferred = Layer.effect(DeferredStoreContext, Deferred.make<never, LiveStoreContext>())
|
|
@@ -65,15 +66,17 @@ export const makeLiveStoreContext = <GraphQLContext extends BaseGraphQLContext>(
|
|
|
65
66
|
graphQLOptions: graphQLOptions_,
|
|
66
67
|
boot: boot_,
|
|
67
68
|
}: LiveStoreContextProps<GraphQLContext>): Effect.Effect<
|
|
68
|
-
|
|
69
|
+
DeferredStoreContext | Scope.Scope | otel.Tracer,
|
|
69
70
|
never,
|
|
70
71
|
LiveStoreContext
|
|
71
72
|
> =>
|
|
72
73
|
pipe(
|
|
73
74
|
Effect.gen(function* ($) {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const
|
|
75
|
+
const runtime = yield* $(Effect.runtime<never>())
|
|
76
|
+
|
|
77
|
+
const otelRootSpanContext = otel.context.active()
|
|
78
|
+
|
|
79
|
+
const otelTracer = yield* $(OtelTracer.OtelTracer)
|
|
77
80
|
|
|
78
81
|
const graphQLOptions = yield* $(
|
|
79
82
|
graphQLOptions_
|
|
@@ -81,10 +84,11 @@ export const makeLiveStoreContext = <GraphQLContext extends BaseGraphQLContext>(
|
|
|
81
84
|
: Effect.succeed(undefined),
|
|
82
85
|
)
|
|
83
86
|
|
|
84
|
-
const backendOptions = yield* $(backendOptions_
|
|
87
|
+
const backendOptions = yield* $(backendOptions_)
|
|
85
88
|
|
|
86
89
|
const boot = boot_
|
|
87
|
-
? (db: Backend) =>
|
|
90
|
+
? (db: Backend) =>
|
|
91
|
+
boot_(db).pipe(Effect.withSpan('boot'), Effect.tapCauseLogPretty, Runtime.runPromise(runtime))
|
|
88
92
|
: undefined
|
|
89
93
|
|
|
90
94
|
const store = yield* $(
|
|
@@ -103,10 +107,13 @@ export const makeLiveStoreContext = <GraphQLContext extends BaseGraphQLContext>(
|
|
|
103
107
|
|
|
104
108
|
window.__debugLiveStore = store
|
|
105
109
|
|
|
110
|
+
// TODO remove global queries concept
|
|
106
111
|
const globalQueries = yield* $(
|
|
107
|
-
globalQueryDefs ?? Effect.succeed({}),
|
|
112
|
+
globalQueryDefs ?? Effect.succeed({} as GlobalQueryDefs),
|
|
108
113
|
Effect.map((defs) => mapValues(defs, (queryDef) => queryDef(store))),
|
|
109
|
-
|
|
114
|
+
Effect.withSpan('LiveStore:makeGlobalQueries', {
|
|
115
|
+
parent: OtelTracer.makeExternalSpan(otel.trace.getSpanContext(store.otel.queriesSpanContext)!),
|
|
116
|
+
}),
|
|
110
117
|
)
|
|
111
118
|
|
|
112
119
|
// NOTE give main thread a chance to render
|
package/src/otel.ts
CHANGED
package/src/store.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
|
|
2
|
-
import { assertNever, makeNoopTracer, shouldNeverHappen } from '@livestore/utils'
|
|
2
|
+
import { assertNever, makeNoopSpan, makeNoopTracer, shouldNeverHappen } from '@livestore/utils'
|
|
3
3
|
import * as otel from '@opentelemetry/api'
|
|
4
4
|
import type { GraphQLSchema } from 'graphql'
|
|
5
5
|
import * as graphql from 'graphql'
|
|
@@ -807,7 +807,10 @@ export const createStore = async <TGraphQLContext extends BaseGraphQLContext>({
|
|
|
807
807
|
return otelTracer.startActiveSpan('createStore', {}, otelRootSpanContext, async (span) => {
|
|
808
808
|
try {
|
|
809
809
|
let persistedData: Uint8Array | undefined
|
|
810
|
-
const backend = await createBackend(backendOptions
|
|
810
|
+
const backend = await createBackend(backendOptions, {
|
|
811
|
+
otelTracer: otelTracer ?? makeNoopTracer(),
|
|
812
|
+
parentSpan: otel.trace.getSpan(otelRootSpanContext ?? otel.context.active()) ?? makeNoopSpan(),
|
|
813
|
+
})
|
|
811
814
|
// if we're resetting the database, run boot here.
|
|
812
815
|
|
|
813
816
|
let shouldResetDB = false
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type * as otel from '@opentelemetry/api';
|
|
2
|
-
import type { Scope } from '@overtone/utils/effect';
|
|
3
|
-
import { Context, Deferred, Effect, Layer, Otel } from '@overtone/utils/effect';
|
|
4
|
-
import type { GraphQLSchema } from 'graphql';
|
|
5
|
-
import type { Backend, BackendOptions } from './backends/index.js';
|
|
6
|
-
import type { InMemoryDatabase } from './inMemoryDatabase.js';
|
|
7
|
-
import type { Schema } from './schema.js';
|
|
8
|
-
import type { BaseGraphQLContext, GraphQLOptions, RiffleQuery, Store } from './store.js';
|
|
9
|
-
export type StoreContext = {
|
|
10
|
-
store: Store<any>;
|
|
11
|
-
globalQueries: RiffleQueryTypes;
|
|
12
|
-
};
|
|
13
|
-
export type QueryDefinition = (store: Store<any>) => RiffleQuery;
|
|
14
|
-
export type GlobalQueryDefs = {
|
|
15
|
-
[key: string]: QueryDefinition;
|
|
16
|
-
};
|
|
17
|
-
export type RiffleCreateStoreOptions<GraphQLContext extends BaseGraphQLContext> = {
|
|
18
|
-
schema: Schema;
|
|
19
|
-
globalQueryDefs: GlobalQueryDefs;
|
|
20
|
-
backendOptions: BackendOptions;
|
|
21
|
-
graphQLOptions?: GraphQLOptions<GraphQLContext>;
|
|
22
|
-
otelTracer?: otel.Tracer;
|
|
23
|
-
otelRootSpanContext?: otel.Context;
|
|
24
|
-
boot?: (backend: Backend, parentSpan: otel.Span) => Promise<void>;
|
|
25
|
-
};
|
|
26
|
-
export declare const StoreContext: Context.Tag<StoreContext, StoreContext>;
|
|
27
|
-
export type DeferredStoreContext = Deferred.Deferred<never, StoreContext>;
|
|
28
|
-
export declare const DeferredStoreContext: Context.Tag<DeferredStoreContext, DeferredStoreContext>;
|
|
29
|
-
export type RiffleStoreContextProps<GraphQLContext extends BaseGraphQLContext> = {
|
|
30
|
-
schema: Schema;
|
|
31
|
-
globalQueryDefs?: Effect.Effect<Otel.Tracer | Otel.Span, never, GlobalQueryDefs>;
|
|
32
|
-
backendOptions: Effect.Effect<Otel.Tracer | Otel.Span, never, BackendOptions>;
|
|
33
|
-
graphQLOptions?: {
|
|
34
|
-
schema: Effect.Effect<Otel.Tracer, never, GraphQLSchema>;
|
|
35
|
-
makeContext: (db: InMemoryDatabase) => GraphQLContext;
|
|
36
|
-
};
|
|
37
|
-
boot?: (backend: Backend) => Effect.Effect<Otel.Tracer, never, void>;
|
|
38
|
-
};
|
|
39
|
-
export declare const LiveRiffleStoreContext: <GraphQLContext extends BaseGraphQLContext>(props: RiffleStoreContextProps<GraphQLContext>) => Layer.Layer<Otel.Tracer, never, StoreContext>;
|
|
40
|
-
export declare const LiveRiffleStoreContextDeferred: Layer.Layer<never, never, DeferredStoreContext>;
|
|
41
|
-
export declare const makeRiffle: <GraphQLContext extends BaseGraphQLContext>({ globalQueryDefs, schema, backendOptions: backendOptions_, graphQLOptions: graphQLOptions_, boot: boot_, }: RiffleStoreContextProps<GraphQLContext>) => Effect.Effect<Otel.Tracer | Otel.Span | DeferredStoreContext | Scope.Scope, never, StoreContext>;
|
|
42
|
-
//# sourceMappingURL=LiveRiffleStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LiveRiffleStore.d.ts","sourceRoot":"","sources":["../src/LiveRiffleStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAY,MAAM,EAAE,KAAK,EAAE,IAAI,EAAQ,MAAM,wBAAwB,CAAA;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGxF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACjB,aAAa,EAAE,gBAAgB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,WAAW,CAAA;AAChE,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAA;C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C,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;CACrE,CAAA;AAED,eAAO,MAAM,sBAAsB,iGAEhC,WAAW,CAAC,KAAK,MAAM,EAAE,KAAK,EAAE,YAAY,CAI5C,CAAA;AAEH,eAAO,MAAM,8BAA8B,iDAA2E,CAAA;AAEtH,eAAO,MAAM,UAAU,uMAMsB,aAAa,CACxD,KAAK,MAAM,GAAG,KAAK,IAAI,GAAG,oBAAoB,GAAG,WAAW,EAC5D,KAAK,EACL,YAAY,CAqDX,CAAA"}
|
package/dist/LiveRiffleStore.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Context, Deferred, Duration, Effect, Layer, Otel, pipe } from '@overtone/utils/effect';
|
|
2
|
-
import { mapValues } from 'lodash-es';
|
|
3
|
-
import { createStore } from './store.js';
|
|
4
|
-
export const StoreContext = Context.Tag('@overtone/riffle/StoreContext');
|
|
5
|
-
export const DeferredStoreContext = Context.Tag(Symbol.for('@overtone/riffle/DeferredStoreContext'));
|
|
6
|
-
export const LiveRiffleStoreContext = (props) => Layer.provide(LiveRiffleStoreContextDeferred, pipe(Layer.scoped(StoreContext, makeRiffle(props)), Otel.withSpanLayer('Riffle')));
|
|
7
|
-
export const LiveRiffleStoreContextDeferred = Layer.effect(DeferredStoreContext, Deferred.make());
|
|
8
|
-
export const makeRiffle = ({ globalQueryDefs, schema, backendOptions: backendOptions_, graphQLOptions: graphQLOptions_, boot: boot_, }) => pipe(Effect.gen(function* ($) {
|
|
9
|
-
const ctx = yield* $(Effect.context());
|
|
10
|
-
const otelRootSpanContext = yield* $(Otel.activeContext);
|
|
11
|
-
const { tracer: otelTracer } = yield* $(Otel.Tracer);
|
|
12
|
-
const graphQLOptions = yield* $(graphQLOptions_
|
|
13
|
-
? Effect.all({ schema: graphQLOptions_.schema, makeContext: Effect.succeed(graphQLOptions_.makeContext) })
|
|
14
|
-
: Effect.succeed(undefined));
|
|
15
|
-
const backendOptions = yield* $(backendOptions_ ?? Effect.succeed(undefined));
|
|
16
|
-
const boot = boot_
|
|
17
|
-
? (db) => pipe(boot_(db), Effect.provideContext(ctx), Effect.tapCauseLogPretty, Effect.runPromise)
|
|
18
|
-
: undefined;
|
|
19
|
-
const store = yield* $(Effect.tryPromise(() => createStore({
|
|
20
|
-
schema,
|
|
21
|
-
backendOptions,
|
|
22
|
-
graphQLOptions,
|
|
23
|
-
otelTracer,
|
|
24
|
-
otelRootSpanContext,
|
|
25
|
-
boot,
|
|
26
|
-
})), Effect.acquireRelease((store) => Effect.sync(() => store.destroy())));
|
|
27
|
-
window.__debugRiffleStore = store;
|
|
28
|
-
const globalQueries = yield* $(globalQueryDefs ?? Effect.succeed({}), Effect.map((defs) => mapValues(defs, (queryDef) => queryDef(store))), Otel.withSpan('riffle:makeGlobalQueries', {}, store.otel.queriesSpanContext));
|
|
29
|
-
// NOTE give main thread a chance to render
|
|
30
|
-
yield* $(Effect.yieldNow());
|
|
31
|
-
return { store, globalQueries };
|
|
32
|
-
}), Effect.tap((storeCtx) => Effect.flatMap(DeferredStoreContext, (def) => Deferred.succeed(def, storeCtx))), Effect.timeoutFail({
|
|
33
|
-
onTimeout: () => new Error('Timed out while creating Riffle store after 10sec'),
|
|
34
|
-
duration: Duration.seconds(10),
|
|
35
|
-
}), Effect.orDie);
|
|
36
|
-
//# sourceMappingURL=LiveRiffleStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LiveRiffleStore.js","sourceRoot":"","sources":["../src/LiveRiffleStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE/F,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAMrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAoBxC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,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AAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;IAE3B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA;AACjC,CAAC,CAAC,EACF,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EACxG,MAAM,CAAC,WAAW,CAAC;IACjB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,mDAAmD,CAAC;IAC/E,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC,EACF,MAAM,CAAC,KAAK,CACb,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRiffleComponent.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/react/useRiffleComponent.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { act, renderHook } from '@testing-library/react';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { sql } from '../../index.js';
|
|
4
|
-
import * as RiffleReact from '../../react/index.js';
|
|
5
|
-
import { makeTodoMvc } from './fixture.js';
|
|
6
|
-
describe('useRiffleComponent', () => {
|
|
7
|
-
it('should update the data based on component key', async () => {
|
|
8
|
-
let renderCount = 0;
|
|
9
|
-
const { wrapper, AppSchema, store } = await makeTodoMvc();
|
|
10
|
-
const { result, rerender } = renderHook((userId) => {
|
|
11
|
-
renderCount++;
|
|
12
|
-
return RiffleReact.useRiffleComponent({
|
|
13
|
-
stateSchema: AppSchema,
|
|
14
|
-
componentKey: { name: 'UserInfo', id: userId },
|
|
15
|
-
queries: () => ({}),
|
|
16
|
-
});
|
|
17
|
-
}, { wrapper, initialProps: 'u1' });
|
|
18
|
-
expect(result.current.state.id).toBe('u1');
|
|
19
|
-
expect(result.current.state.username).toBe('');
|
|
20
|
-
expect(renderCount).toBe(1);
|
|
21
|
-
act(() => {
|
|
22
|
-
void store.execute(sql `INSERT INTO components__UserInfo (id, username) VALUES ('u2', 'username_u2');`);
|
|
23
|
-
});
|
|
24
|
-
rerender('u2');
|
|
25
|
-
expect(result.current.state.id).toBe('u2');
|
|
26
|
-
expect(result.current.state.username).toBe('username_u2');
|
|
27
|
-
expect(renderCount).toBe(2);
|
|
28
|
-
});
|
|
29
|
-
it('should update the data reactively - via setState', async () => {
|
|
30
|
-
let renderCount = 0;
|
|
31
|
-
const { wrapper, AppSchema } = await makeTodoMvc();
|
|
32
|
-
const { result } = renderHook((userId) => {
|
|
33
|
-
renderCount++;
|
|
34
|
-
return RiffleReact.useRiffleComponent({
|
|
35
|
-
stateSchema: AppSchema,
|
|
36
|
-
componentKey: { name: 'UserInfo', id: userId },
|
|
37
|
-
queries: () => ({}),
|
|
38
|
-
});
|
|
39
|
-
}, { wrapper, initialProps: 'u1' });
|
|
40
|
-
expect(result.current.state.id).toBe('u1');
|
|
41
|
-
expect(result.current.state.username).toBe('');
|
|
42
|
-
expect(renderCount).toBe(1);
|
|
43
|
-
act(() => {
|
|
44
|
-
result.current.setState.username('username_u1_hello');
|
|
45
|
-
});
|
|
46
|
-
// act(() => {
|
|
47
|
-
// store.execute(sql`UPDATE components__UserInfo SET username = 'username_u1_hello' WHERE id = 'u1';`)
|
|
48
|
-
// })
|
|
49
|
-
expect(result.current.state.id).toBe('u1');
|
|
50
|
-
expect(result.current.state.username).toBe('username_u1_hello');
|
|
51
|
-
expect(renderCount).toBe(2);
|
|
52
|
-
});
|
|
53
|
-
it('should update the data reactively - via raw store update', async () => {
|
|
54
|
-
let renderCount = 0;
|
|
55
|
-
const { wrapper, AppSchema, store } = await makeTodoMvc();
|
|
56
|
-
const { result } = renderHook((userId) => {
|
|
57
|
-
renderCount++;
|
|
58
|
-
return RiffleReact.useRiffleComponent({
|
|
59
|
-
stateSchema: AppSchema,
|
|
60
|
-
componentKey: { name: 'UserInfo', id: userId },
|
|
61
|
-
queries: () => ({}),
|
|
62
|
-
});
|
|
63
|
-
}, { wrapper, initialProps: 'u1' });
|
|
64
|
-
expect(result.current.state.id).toBe('u1');
|
|
65
|
-
expect(result.current.state.username).toBe('');
|
|
66
|
-
expect(renderCount).toBe(1);
|
|
67
|
-
act(() => {
|
|
68
|
-
result.current.setState.username('username_u1_hello');
|
|
69
|
-
});
|
|
70
|
-
act(() => {
|
|
71
|
-
void store.execute(sql `UPDATE components__UserInfo SET username = 'username_u1_hello' WHERE id = 'u1';`);
|
|
72
|
-
});
|
|
73
|
-
expect(result.current.state.id).toBe('u1');
|
|
74
|
-
expect(result.current.state.username).toBe('username_u1_hello');
|
|
75
|
-
expect(renderCount).toBe(2);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=useRiffleComponent.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRiffleComponent.test.js","sourceRoot":"","sources":["../../../src/__tests__/react/useRiffleComponent.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,IAAI,WAAW,GAAG,CAAC,CAAA;QAEnB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,WAAW,EAAE,CAAA;QAEzD,MAAM,EAAE,MAAM,EAAE,Q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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type * as otel from '@opentelemetry/api';
|
|
2
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
-
import type { Backend, BackendOptions } from '../backends/index.js';
|
|
4
|
-
import type { GlobalQueryDefs } from '../LiveRiffleStore.js';
|
|
5
|
-
import type { Schema } from '../schema.js';
|
|
6
|
-
import type { BaseGraphQLContext, GraphQLOptions } from '../store.js';
|
|
7
|
-
interface RiffleProviderProps<GraphQLContext> {
|
|
8
|
-
schema: Schema;
|
|
9
|
-
backendOptions: BackendOptions;
|
|
10
|
-
boot?: (backend: Backend, parentSpan: otel.Span) => Promise<void>;
|
|
11
|
-
globalQueryDefs: GlobalQueryDefs;
|
|
12
|
-
graphQLOptions?: GraphQLOptions<GraphQLContext>;
|
|
13
|
-
otelTracer?: otel.Tracer;
|
|
14
|
-
otelRootSpanContext?: otel.Context;
|
|
15
|
-
fallback: ReactElement;
|
|
16
|
-
}
|
|
17
|
-
export declare const RiffleProvider: <GraphQLContext extends BaseGraphQLContext>({ fallback, globalQueryDefs, backendOptions, graphQLOptions, otelTracer, otelRootSpanContext, children, schema, boot, }: RiffleProviderProps<GraphQLContext> & {
|
|
18
|
-
children?: ReactNode;
|
|
19
|
-
}) => JSX.Element;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=RiffleProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RiffleProvider.d.ts","sourceRoot":"","sources":["../../src/react/RiffleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGpD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAA2D,MAAM,uBAAuB,CAAA;AACrH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIrE,UAAU,mBAAmB,CAAC,cAAc;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,cAAc,CAAA;IAC9B,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE,eAAe,EAAE,eAAe,CAAA;IAChC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;IAC/C,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,CAAA;IACxB,mBAAmB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAA;IAClC,QAAQ,EAAE,YAAY,CAAA;CACvB;AAED,eAAO,MAAM,cAAc;eAU2B,SAAS;MAAK,WAgBnE,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { mapValues } from 'lodash-es';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { createStore } from '../store.js';
|
|
4
|
-
import { StoreContext } from './StoreContext.js';
|
|
5
|
-
export const RiffleProvider = ({ fallback, globalQueryDefs, backendOptions, graphQLOptions, otelTracer, otelRootSpanContext, children, schema, boot, }) => {
|
|
6
|
-
const store = useCreateStore({
|
|
7
|
-
schema,
|
|
8
|
-
globalQueryDefs,
|
|
9
|
-
backendOptions,
|
|
10
|
-
graphQLOptions,
|
|
11
|
-
otelTracer,
|
|
12
|
-
otelRootSpanContext,
|
|
13
|
-
boot,
|
|
14
|
-
});
|
|
15
|
-
if (store === undefined) {
|
|
16
|
-
return fallback;
|
|
17
|
-
}
|
|
18
|
-
return React.createElement(StoreContext.Provider, { value: store }, children);
|
|
19
|
-
};
|
|
20
|
-
const useCreateStore = ({ schema, globalQueryDefs, backendOptions, graphQLOptions, otelTracer, otelRootSpanContext, boot, }) => {
|
|
21
|
-
const [ctxValue, setCtxValue] = React.useState();
|
|
22
|
-
React.useEffect(() => {
|
|
23
|
-
void (async () => {
|
|
24
|
-
try {
|
|
25
|
-
const store = await createStore({
|
|
26
|
-
schema,
|
|
27
|
-
backendOptions,
|
|
28
|
-
graphQLOptions,
|
|
29
|
-
otelTracer,
|
|
30
|
-
otelRootSpanContext,
|
|
31
|
-
boot,
|
|
32
|
-
});
|
|
33
|
-
store.otel.tracer.startActiveSpan('riffle:makeGlobalQueries', {}, store.otel.queriesSpanContext, (span) => {
|
|
34
|
-
const globalQueries = mapValues(globalQueryDefs, (queryDef) => queryDef(store));
|
|
35
|
-
setCtxValue({ store, globalQueries });
|
|
36
|
-
span.end();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
console.error(`Error creating Riffle store:`, e);
|
|
41
|
-
throw e;
|
|
42
|
-
}
|
|
43
|
-
})();
|
|
44
|
-
// TODO: do we need to return any cleanup function here?
|
|
45
|
-
}, [schema, backendOptions, globalQueryDefs, graphQLOptions, otelTracer, otelRootSpanContext, boot]);
|
|
46
|
-
return ctxValue;
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=RiffleProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RiffleProvider.js","sourceRoot":"","sources":["../../src/react/RiffleProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAahD,MAAM,CAAC,MAAM,cAAc,GAAG,CAA4C,EACxE,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,U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AE;gBACV,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAA;gBAChD,MAAM,CAAC,CAAA;aACR;QACH,CAAC,CAAC,EAAE,CAAA;QAEJ,wDAAwD;IAC1D,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAA;IAEpG,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { StoreContext as StoreContext_ } from '../LiveRiffleStore.js';
|
|
3
|
-
import type { RiffleQuery } from '../store.js';
|
|
4
|
-
declare global {
|
|
5
|
-
interface RiffleQueryTypes {
|
|
6
|
-
[key: string]: RiffleQuery;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare const StoreContext: React.Context<StoreContext_ | undefined>;
|
|
10
|
-
export declare const useStore: () => StoreContext_;
|
|
11
|
-
//# sourceMappingURL=StoreContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StoreContext.d.ts","sourceRoot":"","sources":["../../src/react/StoreContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,gBAAgB;QACxB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;KAC3B;CACF;AAED,eAAO,MAAM,YAAY,0CAA4D,CAAA;AAErF,eAAO,MAAM,QAAQ,QAAO,aAQ3B,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
export const StoreContext = React.createContext(undefined);
|
|
3
|
-
export const useStore = () => {
|
|
4
|
-
const storeContext = useContext(StoreContext);
|
|
5
|
-
if (storeContext === undefined) {
|
|
6
|
-
throw new Error(`useStore can only be used inside StoreContext.Provider`);
|
|
7
|
-
}
|
|
8
|
-
return storeContext;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=StoreContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StoreContext.js","sourceRoot":"","sources":["../../src/react/StoreContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAYzC,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAA4B,SAAS,CAAC,CAAA;AAErF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAkB,EAAE;IAC1C,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IAE7C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;KAC1E;IAED,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
-
import { type LiteralUnion } from '@overtone/utils';
|
|
3
|
-
import type { DependencyList } from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { ComponentKey } from '../componentKey.js';
|
|
6
|
-
import type { GetAtom } from '../reactive.js';
|
|
7
|
-
import type { RiffleGraphQLQuery } from '../reactiveQueries/graphql.js';
|
|
8
|
-
import type { RiffleJSQuery } from '../reactiveQueries/js.js';
|
|
9
|
-
import type { RiffleSQLQuery } from '../reactiveQueries/sql.js';
|
|
10
|
-
import type { ComponentStateSchema } from '../schema.js';
|
|
11
|
-
import type { BaseGraphQLContext, QueryResult, RiffleQuery } from '../store.js';
|
|
12
|
-
export interface QueryDefinitions {
|
|
13
|
-
[queryName: string]: RiffleQuery;
|
|
14
|
-
}
|
|
15
|
-
export type QueryResults<TQuery> = {
|
|
16
|
-
[queryName in keyof TQuery]: QueryResult<TQuery[queryName]>;
|
|
17
|
-
};
|
|
18
|
-
export type ReactiveSQL = <TResult>(genQuery: (get: GetAtom) => string, queriedTables: string[]) => RiffleSQLQuery<TResult>;
|
|
19
|
-
export type ReactiveGraphQL = <TResult extends Record<string, any>, TVariables extends Record<string, any>, TContext extends BaseGraphQLContext>(query: DocumentNode<TResult, TVariables>, genVariableValues: (get: GetAtom) => TVariables, label?: string) => RiffleGraphQLQuery<TResult, TVariables, TContext>;
|
|
20
|
-
type RegisterSubscription = <TQuery extends RiffleQuery>(query: TQuery, onNewValue: (value: QueryResult<TQuery>) => void, onUnsubscribe?: () => void) => void;
|
|
21
|
-
type GenQueries<TQueries, TStateResult> = (args: {
|
|
22
|
-
rxSQL: ReactiveSQL;
|
|
23
|
-
rxGraphQL: ReactiveGraphQL;
|
|
24
|
-
globalQueries: QueryDefinitions;
|
|
25
|
-
state$: RiffleJSQuery<TStateResult>;
|
|
26
|
-
/** Registers a subscription */
|
|
27
|
-
subscribe: RegisterSubscription;
|
|
28
|
-
isTemporaryQuery: boolean;
|
|
29
|
-
}) => TQueries;
|
|
30
|
-
export type UseRiffleComponentProps<TQueries, TComponentState> = {
|
|
31
|
-
stateSchema?: ComponentStateSchema<TComponentState>;
|
|
32
|
-
queries?: GenQueries<TQueries, TComponentState>;
|
|
33
|
-
reactDeps?: React.DependencyList;
|
|
34
|
-
componentKey: ComponentKeyConfig;
|
|
35
|
-
};
|
|
36
|
-
export type ComponentKeyConfig = {
|
|
37
|
-
/**
|
|
38
|
-
* Name of the Component
|
|
39
|
-
*
|
|
40
|
-
* TODO we should eventually derive this info automatically from the component (TBD how though...)
|
|
41
|
-
*/
|
|
42
|
-
name: string;
|
|
43
|
-
id: LiteralUnion<'singleton' | '__ephemeral__', string>;
|
|
44
|
-
};
|
|
45
|
-
type ComponentState = {
|
|
46
|
-
/** Equivalent to `componentKey.key` */
|
|
47
|
-
id: string;
|
|
48
|
-
[key: string]: string | number | boolean | null;
|
|
49
|
-
};
|
|
50
|
-
type UseRiffleJsonState<TState> = <TResult>(jsonStringKey: keyof TState, parse?: (_: unknown) => TResult) => [value: TResult, setValue: (newVal: TResult | ((prevVal: TResult) => TResult)) => void];
|
|
51
|
-
/**
|
|
52
|
-
* Create reactive queries within a component.
|
|
53
|
-
* @param config.queries A function that returns a map of named reactive queries.
|
|
54
|
-
* @param config.componentKey A function that returns a unique key for this component.
|
|
55
|
-
* @param config.reactDeps A list of React-level dependencies that will refresh the queries.
|
|
56
|
-
*/
|
|
57
|
-
export declare const useRiffleComponent: <TComponentState extends ComponentState, TQueries extends QueryDefinitions>({ stateSchema: stateSchema_, queries, componentKey: componentKeyConfig, reactDeps, }: UseRiffleComponentProps<TQueries, TComponentState>) => {
|
|
58
|
-
queryResults: QueryResults<TQueries>;
|
|
59
|
-
state: TComponentState;
|
|
60
|
-
setState: Setters<TComponentState>;
|
|
61
|
-
useRiffleJsonState: UseRiffleJsonState<TComponentState>;
|
|
62
|
-
};
|
|
63
|
-
export type Setters<TComponentState> = {
|
|
64
|
-
[k in keyof TComponentState]: (newValue: TComponentState[k]) => void;
|
|
65
|
-
} & {
|
|
66
|
-
setMany: (newValues: Partial<TComponentState>) => void;
|
|
67
|
-
};
|
|
68
|
-
export declare const useComponentKey: ({ name, id }: ComponentKeyConfig, deps?: DependencyList) => ComponentKey;
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=useRiffleComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRiffleComponent.d.ts","sourceRoot":"","sources":["../../src/react/useRiffleComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAE1F,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,iBAAiB,CAA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