@livestore/livestore 0.0.54-dev.5 → 0.0.55-dev.0
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/MainDatabaseWrapper.d.ts +6 -5
- package/dist/MainDatabaseWrapper.d.ts.map +1 -1
- package/dist/MainDatabaseWrapper.js +3 -3
- package/dist/MainDatabaseWrapper.js.map +1 -1
- package/dist/QueryCache.d.ts +1 -1
- package/dist/QueryCache.d.ts.map +1 -1
- package/dist/QueryCache.js.map +1 -1
- package/dist/__tests__/react/fixture.d.ts +9 -27
- package/dist/__tests__/react/fixture.d.ts.map +1 -1
- package/dist/__tests__/react/fixture.js +12 -10
- package/dist/__tests__/react/fixture.js.map +1 -1
- package/dist/effect/LiveStore.d.ts +20 -12
- package/dist/effect/LiveStore.d.ts.map +1 -1
- package/dist/effect/LiveStore.js +23 -22
- package/dist/effect/LiveStore.js.map +1 -1
- package/dist/effect/index.d.ts +1 -1
- package/dist/effect/index.d.ts.map +1 -1
- package/dist/effect/index.js +1 -1
- package/dist/effect/index.js.map +1 -1
- package/dist/global-state.d.ts +1 -3
- package/dist/global-state.d.ts.map +1 -1
- package/dist/global-state.js +2 -3
- package/dist/global-state.js.map +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/react/LiveStoreContext.d.ts +5 -2
- package/dist/react/LiveStoreContext.d.ts.map +1 -1
- package/dist/react/LiveStoreContext.js +3 -0
- package/dist/react/LiveStoreContext.js.map +1 -1
- package/dist/react/LiveStoreProvider.d.ts +8 -7
- package/dist/react/LiveStoreProvider.d.ts.map +1 -1
- package/dist/react/LiveStoreProvider.js +70 -43
- package/dist/react/LiveStoreProvider.js.map +1 -1
- package/dist/react/LiveStoreProvider.test.js +33 -12
- package/dist/react/LiveStoreProvider.test.js.map +1 -1
- package/dist/react/components/LiveList.d.ts.map +1 -1
- package/dist/react/useAtom.d.ts +1 -1
- package/dist/react/useAtom.d.ts.map +1 -1
- package/dist/react/useLocalId.d.ts.map +1 -1
- package/dist/react/useQuery.d.ts.map +1 -1
- package/dist/react/useQuery.js +2 -2
- package/dist/react/useQuery.js.map +1 -1
- package/dist/react/useRow.d.ts +2 -2
- package/dist/react/useRow.d.ts.map +1 -1
- package/dist/react/useRow.js +5 -5
- package/dist/react/useRow.js.map +1 -1
- package/dist/react/useRow.test.js +22 -22
- package/dist/react/useRow.test.js.map +1 -1
- package/dist/react/useTemporaryQuery.d.ts.map +1 -1
- package/dist/react/useTemporaryQuery.js +1 -1
- package/dist/react/useTemporaryQuery.js.map +1 -1
- package/dist/react/utils/useStateRefWithReactiveInput.d.ts.map +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactive.d.ts.map +1 -1
- package/dist/reactive.js +4 -5
- package/dist/reactive.js.map +1 -1
- package/dist/reactiveQueries/base-class.d.ts +6 -6
- package/dist/reactiveQueries/base-class.d.ts.map +1 -1
- package/dist/reactiveQueries/base-class.js +3 -3
- package/dist/reactiveQueries/base-class.js.map +1 -1
- package/dist/reactiveQueries/graphql.d.ts +8 -8
- package/dist/reactiveQueries/graphql.d.ts.map +1 -1
- package/dist/reactiveQueries/graphql.js +10 -10
- package/dist/reactiveQueries/graphql.js.map +1 -1
- package/dist/reactiveQueries/js.d.ts +6 -6
- package/dist/reactiveQueries/js.d.ts.map +1 -1
- package/dist/reactiveQueries/js.js +8 -8
- package/dist/reactiveQueries/js.js.map +1 -1
- package/dist/reactiveQueries/sql.d.ts +9 -10
- package/dist/reactiveQueries/sql.d.ts.map +1 -1
- package/dist/reactiveQueries/sql.js +12 -12
- package/dist/reactiveQueries/sql.js.map +1 -1
- package/dist/reactiveQueries/sql.test.js +6 -6
- package/dist/reactiveQueries/sql.test.js.map +1 -1
- package/dist/row-query.d.ts +2 -2
- package/dist/row-query.d.ts.map +1 -1
- package/dist/row-query.js +4 -38
- package/dist/row-query.js.map +1 -1
- package/dist/store.d.ts +41 -24
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +336 -223
- package/dist/store.js.map +1 -1
- package/dist/utils/otel.d.ts.map +1 -1
- package/package.json +10 -19
- package/src/MainDatabaseWrapper.ts +14 -8
- package/src/QueryCache.ts +1 -2
- package/src/__tests__/react/fixture.tsx +13 -11
- package/src/effect/LiveStore.ts +65 -54
- package/src/effect/index.ts +2 -1
- package/src/global-state.ts +2 -6
- package/src/index.ts +25 -7
- package/src/react/LiveStoreContext.ts +7 -2
- package/src/react/LiveStoreProvider.test.tsx +56 -14
- package/src/react/LiveStoreProvider.tsx +105 -46
- package/src/react/useQuery.ts +2 -2
- package/src/react/useRow.test.tsx +22 -22
- package/src/react/useRow.ts +7 -10
- package/src/react/useTemporaryQuery.ts +2 -2
- package/src/reactive.ts +6 -5
- package/src/reactiveQueries/base-class.ts +9 -9
- package/src/reactiveQueries/graphql.ts +19 -15
- package/src/reactiveQueries/js.ts +12 -12
- package/src/reactiveQueries/sql.test.ts +6 -6
- package/src/reactiveQueries/sql.ts +19 -21
- package/src/row-query.ts +8 -54
- package/src/store.ts +533 -284
- package/dist/utils/bounded-collections.d.ts +0 -34
- package/dist/utils/bounded-collections.d.ts.map +0 -1
- package/dist/utils/bounded-collections.js +0 -91
- package/dist/utils/bounded-collections.js.map +0 -1
- package/dist/utils/util.d.ts +0 -14
- package/dist/utils/util.d.ts.map +0 -1
- package/dist/utils/util.js +0 -19
- package/dist/utils/util.js.map +0 -1
- package/src/utils/util.ts +0 -31
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { DebugInfo, InMemoryDatabase, MutableDebugInfo } from '@livestore/common';
|
|
1
|
+
import type { DebugInfo, InMemoryDatabase, MutableDebugInfo, PreparedBindValues } from '@livestore/common';
|
|
2
2
|
import type * as otel from '@opentelemetry/api';
|
|
3
|
-
import { type PreparedBindValues } from './utils/util.js';
|
|
4
3
|
export declare const emptyDebugInfo: () => DebugInfo;
|
|
5
4
|
export declare class MainDatabaseWrapper {
|
|
6
5
|
private cachedStmts;
|
|
@@ -11,10 +10,12 @@ export declare class MainDatabaseWrapper {
|
|
|
11
10
|
private otelRootSpanContext;
|
|
12
11
|
private tablesUsedStmt;
|
|
13
12
|
debugInfo: MutableDebugInfo;
|
|
14
|
-
constructor({ db,
|
|
13
|
+
constructor({ db, otel, }: {
|
|
15
14
|
db: InMemoryDatabase;
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
otel: {
|
|
16
|
+
tracer: otel.Tracer;
|
|
17
|
+
rootSpanContext: otel.Context;
|
|
18
|
+
};
|
|
18
19
|
});
|
|
19
20
|
txn<TRes>(callback: () => TRes): TRes;
|
|
20
21
|
getTablesUsed(query: string): Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainDatabaseWrapper.d.ts","sourceRoot":"","sources":["../src/MainDatabaseWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"MainDatabaseWrapper.d.ts","sourceRoot":"","sources":["../src/MainDatabaseWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAK/C,eAAO,MAAM,cAAc,QAAO,SAKhC,CAAA;AAEF,qBAAa,mBAAmB;IAE9B,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,mBAAmB,CAAc;IACzC,OAAO,CAAC,cAAc,CAAA;IACf,SAAS,EAAE,gBAAgB,CAAmB;gBAEzC,EACV,EAAE,EACF,IAAI,GACL,EAAE;QACD,EAAE,EAAE,gBAAgB,CAAA;QACpB,IAAI,EAAE;YACJ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;YACnB,eAAe,EAAE,IAAI,CAAC,OAAO,CAAA;SAC9B,CAAA;KACF;IAcD,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAqBrC,aAAa,CAAC,KAAK,EAAE,MAAM;IA4B3B,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,kBAAkB,EAC/B,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAA;KAAE,GAC/D;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE;IAkDzB,MAAM,CAAC,CAAC,GAAG,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QACR,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;QACnC,UAAU,CAAC,EAAE,kBAAkB,CAAA;QAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAA;KAC3B,GACA,aAAa,CAAC,CAAC,CAAC;IAkEnB,MAAM;CAQP"}
|
|
@@ -19,10 +19,10 @@ export class MainDatabaseWrapper {
|
|
|
19
19
|
otelRootSpanContext;
|
|
20
20
|
tablesUsedStmt;
|
|
21
21
|
debugInfo = emptyDebugInfo();
|
|
22
|
-
constructor({ db,
|
|
22
|
+
constructor({ db, otel, }) {
|
|
23
23
|
this.db = db;
|
|
24
|
-
this.otelTracer =
|
|
25
|
-
this.otelRootSpanContext =
|
|
24
|
+
this.otelTracer = otel.tracer;
|
|
25
|
+
this.otelRootSpanContext = otel.rootSpanContext;
|
|
26
26
|
this.tablesUsedStmt = db.prepare(`SELECT tbl_name FROM tables_used(?) AS u JOIN sqlite_master ON sqlite_master.name = u.name WHERE u.schema = 'main';`);
|
|
27
27
|
this.cachedStmts.onEvict = (_queryStr, stmt) => stmt.finalize();
|
|
28
28
|
configureSQLite(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainDatabaseWrapper.js","sourceRoot":"","sources":["../src/MainDatabaseWrapper.ts"],"names":[],"mappings":"AAAA,wDAAwD;
|
|
1
|
+
{"version":3,"file":"MainDatabaseWrapper.js","sourceRoot":"","sources":["../src/MainDatabaseWrapper.ts"],"names":[],"mappings":"AAAA,wDAAwD;AASxD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAEpF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAc,EAAE,CAAC,CAAC;IAC9C,WAAW,EAAE,IAAI,UAAU,CAAC,GAAG,CAAC;IAChC,kBAAkB,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC;CAC7B,CAAC,CAAA;AAEF,MAAM,OAAO,mBAAmB;IAC9B,wDAAwD;IAChD,WAAW,GAAG,IAAI,QAAQ,CAA4B,GAAG,CAAC,CAAA;IAC1D,eAAe,GAAG,IAAI,QAAQ,CAAsB,GAAG,CAAC,CAAA;IACxD,WAAW,GAAG,IAAI,UAAU,EAAE,CAAA;IAC9B,EAAE,CAAkB;IACpB,UAAU,CAAa;IACvB,mBAAmB,CAAc;IACjC,cAAc,CAAA;IACf,SAAS,GAAqB,cAAc,EAAE,CAAA;IAErD,YAAY,EACV,EAAE,EACF,IAAI,GAOL;QACC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,UAAU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AAC;CACF;AAED,4EAA4E;AAC5E,MAAM,eAAe,GAAG,CAAC,EAAuB,EAAE,EAAE;IAClD,EAAE,CAAC,OAAO;IACR,4DAA4D;IAC5D,GAAG,CAAA;;;;;;;KAOF,CACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,mCAAmC,GAAG,CAAC,KAAa,EAAE,EAAE;IAC5D,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAA;IAC3E,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
package/dist/QueryCache.d.ts
CHANGED
package/dist/QueryCache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryCache.d.ts","sourceRoot":"","sources":["../src/QueryCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueryCache.d.ts","sourceRoot":"","sources":["../src/QueryCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGjD,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,IAAI,QAAQ,GAAG;IACtD,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACjC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CACpC,CAAA;AAED,kBAAU,OAAO,CAAC;IACD,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;IACzB,MAAM,KAAK,EAAE,OAAO,MAAM,CAAA;CAC1C;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAO7C,MAAM,CAAC,OAAO,OAAO,UAAU;;IAI7B,MAAM,QAAS,MAAM,eAAe,QAAQ,KAAG,QAAQ,CAUtD;IAED,GAAG,QAAS,QAAQ,SAEnB;IAED,GAAG,kBAAmB,QAAQ,CAAC,MAAM,CAAC,OAAO,QAAQ,WAAW,GAAG,UAWlE;IAMD,WAAW,UAAW,MAAM,aAE3B;IAUD,UAAU,kBAAmB,QAAQ,CAAC,MAAM,CAAC,UAU5C;CACF"}
|
package/dist/QueryCache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryCache.js","sourceRoot":"","sources":["../src/QueryCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QueryCache.js","sourceRoot":"","sources":["../src/QueryCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAOtD,IAAU,OAAO,CAGhB;AAHD,WAAU,OAAO;AAGjB,CAAC,EAHS,OAAO,KAAP,OAAO,QAGhB;AAKD,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAA;AAEtE,yDAAyD;AACzD,MAAM,SAAS,GAAG,GAAG,CAAA;AACrB,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,GAAG,IAAI,QAAQ,CAAgB,SAAS,CAAC,CAAA;IACjD,aAAa,GAAG,IAAI,GAAG,EAAiC,CAAA;IAExD,MAAM,GAAG,CAAC,GAAW,EAAE,UAAqB,EAAY,EAAE;QACxD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,GAAe,CAAA;QACxB,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,GAAG,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAa,CAAA;QACzD,CAAC;QAED,OAAO,CAAC,GAAG,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAa,CAAA;IACxE,C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MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAC1C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;gBACjB,SAAQ;YACV,CAAC;YACD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACzB,CAAC;QACH,CAAC;IACH,CAAC,CAAA;CACF"}
|
|
@@ -36,7 +36,6 @@ export declare const todos: DbSchema.TableDef<DbSchema.SqliteDsl.TableDefinition
|
|
|
36
36
|
};
|
|
37
37
|
}>, false, {
|
|
38
38
|
isSingleton: false;
|
|
39
|
-
dynamicRegistration: false;
|
|
40
39
|
disableAutomaticIdColumn: false;
|
|
41
40
|
deriveMutations: {
|
|
42
41
|
enabled: true;
|
|
@@ -76,7 +75,6 @@ export declare const app: DbSchema.TableDef<DbSchema.SqliteDsl.TableDefinition<"
|
|
|
76
75
|
};
|
|
77
76
|
}>, false, {
|
|
78
77
|
isSingleton: false;
|
|
79
|
-
dynamicRegistration: false;
|
|
80
78
|
disableAutomaticIdColumn: false;
|
|
81
79
|
deriveMutations: never;
|
|
82
80
|
isSingleColumn: false;
|
|
@@ -114,7 +112,6 @@ export declare const tables: {
|
|
|
114
112
|
};
|
|
115
113
|
}>, false, {
|
|
116
114
|
isSingleton: false;
|
|
117
|
-
dynamicRegistration: false;
|
|
118
115
|
disableAutomaticIdColumn: false;
|
|
119
116
|
deriveMutations: {
|
|
120
117
|
enabled: true;
|
|
@@ -154,7 +151,6 @@ export declare const tables: {
|
|
|
154
151
|
};
|
|
155
152
|
}>, false, {
|
|
156
153
|
isSingleton: false;
|
|
157
|
-
dynamicRegistration: false;
|
|
158
154
|
disableAutomaticIdColumn: false;
|
|
159
155
|
deriveMutations: never;
|
|
160
156
|
isSingleColumn: false;
|
|
@@ -185,7 +181,6 @@ export declare const tables: {
|
|
|
185
181
|
id: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
|
|
186
182
|
}>, false, {
|
|
187
183
|
isSingleton: false;
|
|
188
|
-
dynamicRegistration: false;
|
|
189
184
|
disableAutomaticIdColumn: false;
|
|
190
185
|
deriveMutations: {
|
|
191
186
|
enabled: true;
|
|
@@ -212,7 +207,6 @@ export declare const tables: {
|
|
|
212
207
|
id: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
|
|
213
208
|
}>, false, {
|
|
214
209
|
isSingleton: true;
|
|
215
|
-
dynamicRegistration: false;
|
|
216
210
|
disableAutomaticIdColumn: false;
|
|
217
211
|
deriveMutations: {
|
|
218
212
|
enabled: true;
|
|
@@ -228,7 +222,7 @@ export declare const tables: {
|
|
|
228
222
|
}, never>>;
|
|
229
223
|
};
|
|
230
224
|
export declare const schema: {
|
|
231
|
-
readonly _Type:
|
|
225
|
+
readonly _Type: import("@livestore/common/dist/schema/index.js").LiveStoreSchemaSymbol;
|
|
232
226
|
readonly _DbSchemaType: {
|
|
233
227
|
todos: DbSchema.SqliteDsl.TableDefinition<"todos", {
|
|
234
228
|
id: {
|
|
@@ -305,25 +299,20 @@ export declare const schema: {
|
|
|
305
299
|
}>;
|
|
306
300
|
};
|
|
307
301
|
readonly _MutationDefMapType: never;
|
|
308
|
-
readonly tables: Map<string,
|
|
309
|
-
sqliteDef: DbSchema.DefaultSqliteTableDefConstrained;
|
|
310
|
-
isSingleColumn: boolean;
|
|
311
|
-
options: DbSchema.TableOptions;
|
|
312
|
-
schema: __Schema.Schema<any, any, never>;
|
|
313
|
-
}>;
|
|
302
|
+
readonly tables: Map<string, DbSchema.TableDef>;
|
|
314
303
|
readonly mutations: import("@livestore/common/dist/schema/mutations.js").MutationDefMap;
|
|
315
304
|
readonly hash: number;
|
|
316
305
|
migrationOptions: import("@livestore/common/dist/adapter-types.js").MigrationOptions;
|
|
317
306
|
};
|
|
318
|
-
export declare const parseTodos: (rawRows:
|
|
319
|
-
text: string;
|
|
307
|
+
export declare const parseTodos: (rawRows: ReadonlyArray<any>) => readonly {
|
|
320
308
|
id: string;
|
|
309
|
+
text: string;
|
|
321
310
|
completed: boolean;
|
|
322
311
|
}[];
|
|
323
|
-
export declare const makeTodoMvc: ({ otelTracer, otelContext,
|
|
312
|
+
export declare const makeTodoMvc: ({ otelTracer, otelContext, useGlobalReactivityGraph, strictMode, }?: {
|
|
324
313
|
otelTracer?: otel.Tracer;
|
|
325
314
|
otelContext?: otel.Context;
|
|
326
|
-
|
|
315
|
+
useGlobalReactivityGraph?: boolean;
|
|
327
316
|
strictMode?: boolean;
|
|
328
317
|
}) => Promise<{
|
|
329
318
|
[Symbol.dispose]: () => Promise<void>;
|
|
@@ -346,7 +335,6 @@ export declare const makeTodoMvc: ({ otelTracer, otelContext, useGlobalDbGraph,
|
|
|
346
335
|
id: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
|
|
347
336
|
}>, false, {
|
|
348
337
|
isSingleton: false;
|
|
349
|
-
dynamicRegistration: false;
|
|
350
338
|
disableAutomaticIdColumn: false;
|
|
351
339
|
deriveMutations: {
|
|
352
340
|
enabled: true;
|
|
@@ -373,7 +361,6 @@ export declare const makeTodoMvc: ({ otelTracer, otelContext, useGlobalDbGraph,
|
|
|
373
361
|
id: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
|
|
374
362
|
}>, false, {
|
|
375
363
|
isSingleton: true;
|
|
376
|
-
dynamicRegistration: false;
|
|
377
364
|
disableAutomaticIdColumn: false;
|
|
378
365
|
deriveMutations: {
|
|
379
366
|
enabled: true;
|
|
@@ -388,7 +375,7 @@ export declare const makeTodoMvc: ({ otelTracer, otelContext, useGlobalDbGraph,
|
|
|
388
375
|
readonly id: "singleton";
|
|
389
376
|
}, never>>;
|
|
390
377
|
store: import("../../store.js").Store<import("../../store.js").BaseGraphQLContext, {
|
|
391
|
-
readonly _Type:
|
|
378
|
+
readonly _Type: import("@livestore/common/dist/schema/index.js").LiveStoreSchemaSymbol;
|
|
392
379
|
readonly _DbSchemaType: {
|
|
393
380
|
todos: DbSchema.SqliteDsl.TableDefinition<"todos", {
|
|
394
381
|
id: {
|
|
@@ -465,17 +452,12 @@ export declare const makeTodoMvc: ({ otelTracer, otelContext, useGlobalDbGraph,
|
|
|
465
452
|
}>;
|
|
466
453
|
};
|
|
467
454
|
readonly _MutationDefMapType: never;
|
|
468
|
-
readonly tables: Map<string,
|
|
469
|
-
sqliteDef: DbSchema.DefaultSqliteTableDefConstrained;
|
|
470
|
-
isSingleColumn: boolean;
|
|
471
|
-
options: DbSchema.TableOptions;
|
|
472
|
-
schema: __Schema.Schema<any, any, never>;
|
|
473
|
-
}>;
|
|
455
|
+
readonly tables: Map<string, DbSchema.TableDef>;
|
|
474
456
|
readonly mutations: import("@livestore/common/dist/schema/mutations.js").MutationDefMap;
|
|
475
457
|
readonly hash: number;
|
|
476
458
|
migrationOptions: import("@livestore/common/dist/adapter-types.js").MigrationOptions;
|
|
477
459
|
}>;
|
|
478
|
-
|
|
460
|
+
reactivityGraph: import("../../index.js").ReactivityGraph;
|
|
479
461
|
makeRenderCount: () => {
|
|
480
462
|
readonly val: number;
|
|
481
463
|
inc: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../src/__tests__/react/fixture.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,
|
|
1
|
+
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../src/__tests__/react/fixture.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBnC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeInMemoryAdapter } from '@livestore/web';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { globalReactivityGraph } from '../../global-state.js';
|
|
4
|
+
import { createStorePromise, DbSchema, makeReactivityGraph, makeSchema, ParseUtils, sql } from '../../index.js';
|
|
5
5
|
import * as LiveStoreReact from '../../react/index.js';
|
|
6
6
|
export const todos = DbSchema.table('todos', {
|
|
7
7
|
id: DbSchema.text({ primaryKey: true }),
|
|
@@ -23,8 +23,8 @@ const AppRouterSchema = DbSchema.table('AppRouter', {
|
|
|
23
23
|
export const tables = { todos, app, userInfo, AppRouterSchema };
|
|
24
24
|
export const schema = makeSchema({ tables });
|
|
25
25
|
export const parseTodos = ParseUtils.many(todos);
|
|
26
|
-
export const makeTodoMvc = async ({ otelTracer, otelContext,
|
|
27
|
-
const
|
|
26
|
+
export const makeTodoMvc = async ({ otelTracer, otelContext, useGlobalReactivityGraph = true, strictMode = process.env.REACT_STRICT_MODE !== undefined, } = {}) => {
|
|
27
|
+
const reactivityGraph = useGlobalReactivityGraph ? globalReactivityGraph : makeReactivityGraph();
|
|
28
28
|
const makeRenderCount = () => {
|
|
29
29
|
let val = 0;
|
|
30
30
|
const inc = () => {
|
|
@@ -37,16 +37,18 @@ export const makeTodoMvc = async ({ otelTracer, otelContext, useGlobalDbGraph =
|
|
|
37
37
|
inc,
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
const store = await
|
|
40
|
+
const store = await createStorePromise({
|
|
41
41
|
schema,
|
|
42
42
|
boot: (db) => db.execute(sql `INSERT OR IGNORE INTO app (id, newTodoText, filter) VALUES ('static', '', 'all');`),
|
|
43
43
|
adapter: makeInMemoryAdapter(),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
reactivityGraph,
|
|
45
|
+
otelOptions: {
|
|
46
|
+
tracer: otelTracer,
|
|
47
|
+
rootSpanContext: otelContext,
|
|
48
|
+
},
|
|
47
49
|
});
|
|
48
50
|
// TODO improve typing of `LiveStoreContext`
|
|
49
|
-
const storeContext = { store };
|
|
51
|
+
const storeContext = { stage: 'running', store };
|
|
50
52
|
const MaybeStrictMode = strictMode ? React.StrictMode : React.Fragment;
|
|
51
53
|
const wrapper = ({ children }) => (React.createElement(MaybeStrictMode, null,
|
|
52
54
|
React.createElement(LiveStoreReact.LiveStoreContext.Provider, { value: storeContext }, children)));
|
|
@@ -56,7 +58,7 @@ export const makeTodoMvc = async ({ otelTracer, otelContext, useGlobalDbGraph =
|
|
|
56
58
|
AppComponentSchema: userInfo,
|
|
57
59
|
AppRouterSchema,
|
|
58
60
|
store,
|
|
59
|
-
|
|
61
|
+
reactivityGraph,
|
|
60
62
|
makeRenderCount,
|
|
61
63
|
strictMode,
|
|
62
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../../../src/__tests__/react/fixture.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fixture.js","sourceRoot":"","sources":["../../../src/__tests__/react/fixture.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAC/G,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAA;AAetD,MAAM,CAAC,MAAM,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5C,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAA6B,CAAA;IAE3E,MAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAA;IAEtE,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAO,EAAE,EAAE,CAAC,CACrC,oBAAC,eAAe;QACd,oBAAC,cAAc,CAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC1D,QAAQ,CACgC,CAC3B,CACnB,CAAA;IAED,OAAO;QACL,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE;QACvC,OAAO;QACP,kBAAkB,EAAE,QAAQ;QAC5B,eAAe;QACf,KAAK;QACL,eAAe;QACf,eAAe;QACf,UAAU;KACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import type { BootDb, StoreAdapterFactory } from '@livestore/common';
|
|
1
|
+
import type { BootDb, BootStatus, StoreAdapterFactory, UnexpectedError } from '@livestore/common';
|
|
2
2
|
import type { LiveStoreSchema } from '@livestore/common/schema';
|
|
3
|
-
import type { Scope } from '@livestore/utils/effect';
|
|
3
|
+
import type { Cause, Scope } from '@livestore/utils/effect';
|
|
4
4
|
import { Context, Deferred, Effect, Layer } from '@livestore/utils/effect';
|
|
5
5
|
import * as otel from '@opentelemetry/api';
|
|
6
6
|
import type { GraphQLSchema } from 'graphql';
|
|
7
7
|
import type { MainDatabaseWrapper } from '../MainDatabaseWrapper.js';
|
|
8
8
|
import type { LiveQuery } from '../reactiveQueries/base-class.js';
|
|
9
|
-
import type { BaseGraphQLContext, GraphQLOptions, Store } from '../store.js';
|
|
10
|
-
export type LiveStoreContext = {
|
|
9
|
+
import type { BaseGraphQLContext, GraphQLOptions, OtelOptions, Store } from '../store.js';
|
|
10
|
+
export type LiveStoreContext = LiveStoreContextRunning | {
|
|
11
|
+
stage: 'error';
|
|
12
|
+
error: UnexpectedError | unknown;
|
|
13
|
+
} | {
|
|
14
|
+
stage: 'shutdown';
|
|
15
|
+
};
|
|
16
|
+
export type LiveStoreContextRunning = {
|
|
17
|
+
stage: 'running';
|
|
11
18
|
store: Store;
|
|
12
19
|
};
|
|
13
20
|
export type QueryDefinition = <TResult>(store: Store) => LiveQuery<TResult>;
|
|
14
21
|
export type LiveStoreCreateStoreOptions<GraphQLContext extends BaseGraphQLContext> = {
|
|
15
22
|
schema: LiveStoreSchema;
|
|
16
23
|
graphQLOptions?: GraphQLOptions<GraphQLContext>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
boot?: (db: BootDb, parentSpan: otel.Span) => unknown | Promise<unknown>;
|
|
24
|
+
otelOptions?: OtelOptions;
|
|
25
|
+
boot?: (db: BootDb, parentSpan: otel.Span) => void | Promise<void> | Effect.Effect<void, unknown, otel.Tracer>;
|
|
20
26
|
adapter: StoreAdapterFactory;
|
|
21
27
|
batchUpdates?: (run: () => void) => void;
|
|
22
28
|
disableDevtools?: boolean;
|
|
29
|
+
signal?: AbortSignal;
|
|
23
30
|
};
|
|
24
|
-
export declare const
|
|
25
|
-
export type DeferredStoreContext = Deferred.Deferred<
|
|
31
|
+
export declare const LiveStoreContextRunning: Context.Tag<LiveStoreContextRunning, LiveStoreContextRunning>;
|
|
32
|
+
export type DeferredStoreContext = Deferred.Deferred<LiveStoreContextRunning, UnexpectedError>;
|
|
26
33
|
export declare const DeferredStoreContext: Context.Tag<DeferredStoreContext, DeferredStoreContext>;
|
|
27
34
|
export type LiveStoreContextProps<GraphQLContext extends BaseGraphQLContext> = {
|
|
28
35
|
schema: LiveStoreSchema;
|
|
@@ -30,11 +37,12 @@ export type LiveStoreContextProps<GraphQLContext extends BaseGraphQLContext> = {
|
|
|
30
37
|
schema: Effect.Effect<GraphQLSchema, never, otel.Tracer>;
|
|
31
38
|
makeContext: (db: MainDatabaseWrapper) => GraphQLContext;
|
|
32
39
|
};
|
|
33
|
-
boot?: (db: BootDb) => Effect.Effect<void>;
|
|
40
|
+
boot?: (db: BootDb) => Effect.Effect<void, unknown, otel.Tracer>;
|
|
34
41
|
adapter: StoreAdapterFactory;
|
|
35
42
|
disableDevtools?: boolean;
|
|
43
|
+
onBootStatus?: (status: BootStatus) => void;
|
|
36
44
|
};
|
|
37
|
-
export declare const LiveStoreContextLayer: <GraphQLContext extends BaseGraphQLContext>(props: LiveStoreContextProps<GraphQLContext>) => Layer.Layer<
|
|
45
|
+
export declare const LiveStoreContextLayer: <GraphQLContext extends BaseGraphQLContext>(props: LiveStoreContextProps<GraphQLContext>) => Layer.Layer<LiveStoreContextRunning, UnexpectedError | Cause.TimeoutException, otel.Tracer>;
|
|
38
46
|
export declare const LiveStoreContextDeferred: Layer.Layer<DeferredStoreContext, never, never>;
|
|
39
|
-
export declare const makeLiveStoreContext: <GraphQLContext extends BaseGraphQLContext>({ schema, graphQLOptions: graphQLOptions_, boot
|
|
47
|
+
export declare const makeLiveStoreContext: <GraphQLContext extends BaseGraphQLContext>({ schema, graphQLOptions: graphQLOptions_, boot, adapter, disableDevtools, onBootStatus, }: LiveStoreContextProps<GraphQLContext>) => Effect.Effect<LiveStoreContextRunning, UnexpectedError | Cause.TimeoutException, DeferredStoreContext | Scope.Scope | otel.Tracer>;
|
|
40
48
|
//# sourceMappingURL=LiveStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveStore.d.ts","sourceRoot":"","sources":["../../src/effect/LiveStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"LiveStore.d.ts","sourceRoot":"","sources":["../../src/effect/LiveStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MA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DAGpC,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,cAAc,SAAS,kBAAkB,8FAO3E,qBAAqB,CAAC,cAAc,CAAC,KAAG,MAAM,CAAC,MAAM,CACtD,uBAAuB,EACvB,eAAe,GAAG,KAAK,CAAC,gBAAgB,EACxC,oBAAoB,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAuC/C,CAAA"}
|
package/dist/effect/LiveStore.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { Context, Deferred, Duration, Effect, Layer, OtelTracer, pipe
|
|
1
|
+
import { Context, Deferred, Duration, Effect, FiberSet, Layer, OtelTracer, pipe } from '@livestore/utils/effect';
|
|
2
2
|
import * as otel from '@opentelemetry/api';
|
|
3
3
|
import { createStore } from '../store.js';
|
|
4
|
-
export const
|
|
5
|
-
export const DeferredStoreContext = Context.GenericTag('@livestore/livestore/DeferredStoreContext');
|
|
6
|
-
export const LiveStoreContextLayer = (props) => Layer.scoped(
|
|
4
|
+
export const LiveStoreContextRunning = Context.GenericTag('@livestore/livestore/effect/LiveStoreContextRunning');
|
|
5
|
+
export const DeferredStoreContext = Context.GenericTag('@livestore/livestore/effect/DeferredStoreContext');
|
|
6
|
+
export const LiveStoreContextLayer = (props) => Layer.scoped(LiveStoreContextRunning, makeLiveStoreContext(props)).pipe(Layer.withSpan('LiveStore'), Layer.provide(LiveStoreContextDeferred));
|
|
7
7
|
export const LiveStoreContextDeferred = Layer.effect(DeferredStoreContext, Deferred.make());
|
|
8
|
-
export const makeLiveStoreContext = ({ schema, graphQLOptions: graphQLOptions_, boot
|
|
9
|
-
const runtime = yield* $(Effect.runtime());
|
|
8
|
+
export const makeLiveStoreContext = ({ schema, graphQLOptions: graphQLOptions_, boot, adapter, disableDevtools, onBootStatus, }) => pipe(Effect.gen(function* () {
|
|
10
9
|
const otelRootSpanContext = otel.context.active();
|
|
11
|
-
const otelTracer = yield*
|
|
12
|
-
const graphQLOptions = yield*
|
|
10
|
+
const otelTracer = yield* OtelTracer.Tracer;
|
|
11
|
+
const graphQLOptions = yield* graphQLOptions_
|
|
13
12
|
? Effect.all({ schema: graphQLOptions_.schema, makeContext: Effect.succeed(graphQLOptions_.makeContext) })
|
|
14
|
-
: Effect.succeed(undefined)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const store = yield* $(Effect.tryPromise(() => createStore({
|
|
13
|
+
: Effect.succeed(undefined);
|
|
14
|
+
// TODO join fiber set and close tear down parent scope in case of error (Needs refactor with Mike A)
|
|
15
|
+
const fiberSet = yield* FiberSet.make();
|
|
16
|
+
const store = yield* createStore({
|
|
19
17
|
schema,
|
|
20
18
|
graphQLOptions,
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
otelOptions: {
|
|
20
|
+
tracer: otelTracer,
|
|
21
|
+
rootSpanContext: otelRootSpanContext,
|
|
22
|
+
},
|
|
23
23
|
boot,
|
|
24
24
|
adapter,
|
|
25
25
|
disableDevtools,
|
|
26
|
-
|
|
26
|
+
fiberSet,
|
|
27
|
+
onBootStatus,
|
|
28
|
+
});
|
|
27
29
|
window.__debugLiveStore = store;
|
|
28
|
-
return { store };
|
|
29
|
-
}), Effect.tap((storeCtx) => Effect.flatMap(DeferredStoreContext, (def) => Deferred.succeed(def, storeCtx))),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}), Effect.orDie);
|
|
30
|
+
return { stage: 'running', store };
|
|
31
|
+
}), Effect.tapErrorCause((cause) => Effect.flatMap(DeferredStoreContext, (def) => Deferred.failCause(def, cause))), Effect.tap((storeCtx) => Effect.flatMap(DeferredStoreContext, (def) => Deferred.succeed(def, storeCtx))),
|
|
32
|
+
// This can take quite a while.
|
|
33
|
+
// TODO make this configurable
|
|
34
|
+
Effect.timeout(Duration.minutes(5)), Effect.withSpan('@livestore/livestore/effect:makeLiveStoreContext'));
|
|
34
35
|
//# sourceMappingURL=LiveStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveStore.js","sourceRoot":"","sources":["../../src/effect/LiveStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"LiveStore.js","sourceRoot":"","sources":["../../src/effect/LiveStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAChH,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAM1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AA+BzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,UAAU,CACvD,qDAAqD,CACtD,CAAA;AAGD,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,UAAU,CACpD,kDAAkD,CACnD,CAAA;AAgBD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAA4C,EACiD,EAAE,CAC/F,KAAK,CAAC,MAAM,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CACrE,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EAC3B,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,CACxC,CAAA;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAClD,oBAAoB,EACpB,QAAQ,CAAC,IAAI,EAA4C,CAC1D,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAA4C,EAC9E,MAAM,EACN,cAAc,EAAE,eAAe,EAC/B,IAAI,EACJ,OAAO,EACP,eAAe,EACf,YAAY,GAC0B,EAItC,EAAE,CACF,IAAI,CACF,MAAM,CAAC,GAAG,CAAC,QAAQ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AC;AACxG,+BAA+B;AAC/B,8BAA8B;AAC9B,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACnC,MAAM,CAAC,QAAQ,CAAC,kDAAkD,CAAC,CACpE,CAAA"}
|
package/dist/effect/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { LiveStoreContextLayer, LiveStoreContext, LiveStoreContextDeferred, DeferredStoreContext, type LiveStoreContextProps, } from './LiveStore.js';
|
|
1
|
+
export { LiveStoreContextLayer, LiveStoreContextRunning as LiveStoreContext, LiveStoreContextRunning, LiveStoreContextDeferred, DeferredStoreContext, type LiveStoreContextProps, } from './LiveStore.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,IAAI,gBAAgB,EAC3C,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAA"}
|
package/dist/effect/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { LiveStoreContextLayer, LiveStoreContext, LiveStoreContextDeferred, DeferredStoreContext, } from './LiveStore.js';
|
|
1
|
+
export { LiveStoreContextLayer, LiveStoreContextRunning as LiveStoreContext, LiveStoreContextRunning, LiveStoreContextDeferred, DeferredStoreContext, } from './LiveStore.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/effect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,IAAI,gBAAgB,EAC3C,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,gBAAgB,CAAA"}
|
package/dist/global-state.d.ts
CHANGED
|
@@ -10,7 +10,5 @@
|
|
|
10
10
|
* explicitly pass instances of state below into the LiveStore constructors.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
export declare const globalDbGraph: import("./reactiveQueries/base-class.js").DbGraph;
|
|
15
|
-
export declare const dynamicallyRegisteredTables: Map<string, DbSchema.TableDef>;
|
|
13
|
+
export declare const globalReactivityGraph: import("./reactiveQueries/base-class.js").ReactivityGraph;
|
|
16
14
|
//# sourceMappingURL=global-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-state.d.ts","sourceRoot":"","sources":["../src/global-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"global-state.d.ts","sourceRoot":"","sources":["../src/global-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,eAAO,MAAM,qBAAqB,2DAAwB,CAAA"}
|
package/dist/global-state.js
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* explicitly pass instances of state below into the LiveStore constructors.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
export const
|
|
15
|
-
export const dynamicallyRegisteredTables = new Map();
|
|
13
|
+
import { makeReactivityGraph } from './reactiveQueries/base-class.js';
|
|
14
|
+
export const globalReactivityGraph = makeReactivityGraph();
|
|
16
15
|
//# sourceMappingURL=global-state.js.map
|
package/dist/global-state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-state.js","sourceRoot":"","sources":["../src/global-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"global-state.js","sourceRoot":"","sources":["../src/global-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAErE,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export { Store, createStore } from './store.js';
|
|
1
|
+
export { Store, createStorePromise, createStore } from './store.js';
|
|
2
2
|
export type { BaseGraphQLContext, QueryDebugInfo, RefreshReason } from './store.js';
|
|
3
|
-
export type { QueryDefinition, LiveStoreCreateStoreOptions, LiveStoreContext } from './effect/LiveStore.js';
|
|
3
|
+
export type { QueryDefinition, LiveStoreCreateStoreOptions, LiveStoreContextRunning as LiveStoreContext, } from './effect/LiveStore.js';
|
|
4
4
|
export { MainDatabaseWrapper, emptyDebugInfo } from './MainDatabaseWrapper.js';
|
|
5
5
|
export type { GetAtom, AtomDebugInfo, RefreshDebugInfo, ReactiveGraphSnapshot, SerializedAtom, SerializedEffect, Atom, Node, Ref, Effect, } from './reactive.js';
|
|
6
6
|
export { LiveStoreJSQuery, computed } from './reactiveQueries/js.js';
|
|
7
7
|
export { LiveStoreSQLQuery, querySQL, type MapRows } from './reactiveQueries/sql.js';
|
|
8
8
|
export { LiveStoreGraphQLQuery, queryGraphQL } from './reactiveQueries/graphql.js';
|
|
9
|
-
export { type GetAtomResult, type
|
|
10
|
-
export {
|
|
9
|
+
export { type GetAtomResult, type ReactivityGraph, makeReactivityGraph, type LiveQuery, } from './reactiveQueries/base-class.js';
|
|
10
|
+
export { globalReactivityGraph } from './global-state.js';
|
|
11
11
|
export { type RowResult, type RowResultEncoded, rowQuery, deriveColQuery } from './row-query.js';
|
|
12
12
|
export * from '@livestore/common/schema';
|
|
13
|
-
export { sql, type BootDb, type InMemoryDatabase, type DebugInfo, type MutableDebugInfo } from '@livestore/common';
|
|
13
|
+
export { sql, type BootDb, type BootStatus, type InMemoryDatabase, type DebugInfo, type MutableDebugInfo, prepareBindValues, type Bindable, type PreparedBindValues, } from '@livestore/common';
|
|
14
14
|
export { SqliteAst, SqliteDsl } from 'effect-db-schema';
|
|
15
|
-
export {
|
|
16
|
-
export { isEqual } from 'lodash-es';
|
|
15
|
+
export { deepEqual } from '@livestore/utils';
|
|
17
16
|
export type { StoreAdapter as DatabaseImpl, StoreAdapterFactory as DatabaseFactory, PreparedStatement, } from '@livestore/common';
|
|
18
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEnF,YAAY,EACV,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,IAAI,gBAAgB,GAC5C,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9E,YAAY,EACV,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAClF,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,SAAS,GACf,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEhG,cAAc,0BAA0B,CAAA;AACxC,OAAO,EACL,GAAG,EACH,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,QAAQ,EACb,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,YAAY,EACV,YAAY,IAAI,YAAY,EAC5B,mBAAmB,IAAI,eAAe,EACtC,iBAAiB,GAClB,MAAM,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
export { Store, createStore } from './store.js';
|
|
1
|
+
export { Store, createStorePromise, createStore } from './store.js';
|
|
2
2
|
export { MainDatabaseWrapper, emptyDebugInfo } from './MainDatabaseWrapper.js';
|
|
3
3
|
export { LiveStoreJSQuery, computed } from './reactiveQueries/js.js';
|
|
4
4
|
export { LiveStoreSQLQuery, querySQL } from './reactiveQueries/sql.js';
|
|
5
5
|
export { LiveStoreGraphQLQuery, queryGraphQL } from './reactiveQueries/graphql.js';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { makeReactivityGraph, } from './reactiveQueries/base-class.js';
|
|
7
|
+
export { globalReactivityGraph } from './global-state.js';
|
|
8
8
|
export { rowQuery, deriveColQuery } from './row-query.js';
|
|
9
9
|
export * from '@livestore/common/schema';
|
|
10
|
-
export { sql } from '@livestore/common';
|
|
10
|
+
export { sql, prepareBindValues, } from '@livestore/common';
|
|
11
11
|
export { SqliteAst, SqliteDsl } from 'effect-db-schema';
|
|
12
|
-
export {
|
|
13
|
-
export { isEqual } from 'lodash-es';
|
|
12
|
+
export { deepEqual } from '@livestore/utils';
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AASnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAc9E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAgB,MAAM,0BAA0B,CAAA;AACpF,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAClF,OAAO,EAGL,mBAAmB,GAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EAAyC,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEhG,cAAc,0BAA0B,CAAA;AACxC,OAAO,EACL,GAAG,EAMH,iBAAiB,GAGlB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA"}
|