@livestore/solid 0.3.0-dev.18 → 0.3.0-dev.19
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/store.js +3 -3
- package/dist/store.js.map +1 -1
- package/package.json +4 -4
- package/src/store.ts +3 -3
package/dist/store.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { provideOtel, StoreInterrupted } from '@livestore/common';
|
|
2
2
|
import { createStore } from '@livestore/livestore';
|
|
3
3
|
import { LS_DEV } from '@livestore/utils';
|
|
4
|
-
import { Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect';
|
|
4
|
+
import { Cause, Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect';
|
|
5
5
|
import * as Solid from 'solid-js';
|
|
6
6
|
const interrupt = (componentScope, shutdownDeferred, error) => Effect.gen(function* () {
|
|
7
|
-
// console.log('[@livestore/livestore/
|
|
7
|
+
// console.log('[@livestore/livestore/solid] interupting', error)
|
|
8
8
|
yield* Scope.close(componentScope, Exit.fail(error));
|
|
9
9
|
yield* Deferred.fail(shutdownDeferred, error);
|
|
10
10
|
}).pipe(Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/solid] interrupting', cause)), Effect.runFork);
|
|
@@ -73,7 +73,7 @@ const setupStore = async ({ schema, storeId, graphQLOptions, boot, adapter, batc
|
|
|
73
73
|
setupDone();
|
|
74
74
|
}).pipe(Scope.extend(componentScope), Effect.forkIn(componentScope));
|
|
75
75
|
const shutdownContext = (cause) => Effect.sync(() => setContextValue({ stage: 'shutdown', cause }));
|
|
76
|
-
yield* Deferred.await(shutdownDeferred).pipe(Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/
|
|
76
|
+
yield* Deferred.await(shutdownDeferred).pipe(Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/solid] shutdown', Cause.pretty(cause))), Effect.catchTag('LiveStore.IntentionalShutdownCause', (cause) => shutdownContext(cause)), Effect.catchTag('LiveStore.StoreInterrupted', (cause) => shutdownContext(cause)), Effect.tapError((error) => Effect.sync(() => setContextValue({ stage: 'error', error }))), Effect.tapDefect((defect) => Effect.sync(() => setContextValue({ stage: 'error', error: defect }))), Effect.exit);
|
|
77
77
|
}).pipe(Effect.scoped, withSemaphore(storeId), Effect.withSpan('@livestore/solid:setupStore'), LS_DEV ? TaskTracing.withAsyncTaggingTracing((name) => console.createTask(name)) : identity, provideOtel({}), Effect.tapCauseLogPretty, Effect.annotateLogs({ thread: 'window' }), Effect.provide(Logger.prettyWithThread('window')), Logger.withMinimumLogLevel(LogLevel.Debug), Effect.runFork);
|
|
78
78
|
Solid.onCleanup(() => {
|
|
79
79
|
if (storeValue.componentScope !== undefined && storeValue.shutdownDeferred !== undefined) {
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,WAAW,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAA;AAWtH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,WAAW,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAA;AAWtH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,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4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"types": "./dist/mod.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@opentelemetry/api": "1.9.0",
|
|
14
|
-
"@livestore/common": "0.3.0-dev.
|
|
15
|
-
"@livestore/
|
|
16
|
-
"@livestore/
|
|
14
|
+
"@livestore/common": "0.3.0-dev.19",
|
|
15
|
+
"@livestore/utils": "0.3.0-dev.19",
|
|
16
|
+
"@livestore/livestore": "0.3.0-dev.19"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
package/src/store.ts
CHANGED
|
@@ -11,12 +11,12 @@ import type {
|
|
|
11
11
|
} from '@livestore/livestore'
|
|
12
12
|
import { createStore } from '@livestore/livestore'
|
|
13
13
|
import { LS_DEV } from '@livestore/utils'
|
|
14
|
-
import { Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect'
|
|
14
|
+
import { Cause, Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect'
|
|
15
15
|
import * as Solid from 'solid-js'
|
|
16
16
|
|
|
17
17
|
const interrupt = (componentScope: Scope.CloseableScope, shutdownDeferred: ShutdownDeferred, error: StoreInterrupted) =>
|
|
18
18
|
Effect.gen(function* () {
|
|
19
|
-
// console.log('[@livestore/livestore/
|
|
19
|
+
// console.log('[@livestore/livestore/solid] interupting', error)
|
|
20
20
|
yield* Scope.close(componentScope, Exit.fail(error))
|
|
21
21
|
yield* Deferred.fail(shutdownDeferred, error)
|
|
22
22
|
}).pipe(
|
|
@@ -130,7 +130,7 @@ const setupStore = async <GraphQLContext extends BaseGraphQLContext>({
|
|
|
130
130
|
Effect.sync(() => setContextValue({ stage: 'shutdown', cause }))
|
|
131
131
|
|
|
132
132
|
yield* Deferred.await(shutdownDeferred).pipe(
|
|
133
|
-
Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/
|
|
133
|
+
Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/solid] shutdown', Cause.pretty(cause))),
|
|
134
134
|
Effect.catchTag('LiveStore.IntentionalShutdownCause', (cause) => shutdownContext(cause)),
|
|
135
135
|
Effect.catchTag('LiveStore.StoreInterrupted', (cause) => shutdownContext(cause)),
|
|
136
136
|
Effect.tapError((error) => Effect.sync(() => setContextValue({ stage: 'error', error }))),
|