@livestore/solid 0.3.0-dev.16 → 0.3.0-dev.18
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/query.d.ts.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +5 -5
- package/dist/store.js.map +1 -1
- package/package.json +5 -5
- package/src/store.ts +16 -12
- package/tmp/pack.tgz +0 -0
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,eAAO,MAAM,KAAK,GAAI,MAAM,SAAS,eAAe,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,eAAO,MAAM,KAAK,GAAI,MAAM,SAAS,eAAe,EAClD,UAAU,MAAM,EAEhB,cAAc,SAAS,CAAC,MAAM,CAAC,KAC9B,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAalC,CAAA"}
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAGlB,eAAe,EAEf,KAAK,EACN,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAGlB,eAAe,EAEf,KAAK,EACN,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AA0CjC,eAAO,MAAO,aAAa,0EAAE,gBAAgB,sEAA0D,CAAA;AA8GvG,eAAO,MAAM,QAAQ,GACnB,MAAM,SAAS,eAAe,EAC9B,cAAc,SAAS,kBAAkB,GAAG,kBAAkB,EAC9D,+BAIC,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,KAAG,OAAO,CAC7F,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAc9D,CAAA"}
|
package/dist/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { provideOtel } from '@livestore/common';
|
|
2
|
-
import { createStore
|
|
1
|
+
import { provideOtel, StoreInterrupted } from '@livestore/common';
|
|
2
|
+
import { createStore } from '@livestore/livestore';
|
|
3
3
|
import { LS_DEV } from '@livestore/utils';
|
|
4
4
|
import { Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect';
|
|
5
5
|
import * as Solid from 'solid-js';
|
|
@@ -46,7 +46,7 @@ const setupStore = async ({ schema, storeId, graphQLOptions, boot, adapter, batc
|
|
|
46
46
|
if (storeValue.componentScope !== undefined &&
|
|
47
47
|
storeValue.shutdownDeferred !== undefined &&
|
|
48
48
|
storeValue.counter === counter) {
|
|
49
|
-
interrupt(storeValue.componentScope, storeValue.shutdownDeferred, new
|
|
49
|
+
interrupt(storeValue.componentScope, storeValue.shutdownDeferred, new StoreInterrupted({ reason: 'Aborted via provided AbortController' }));
|
|
50
50
|
storeValue.componentScope = undefined;
|
|
51
51
|
storeValue.shutdownDeferred = undefined;
|
|
52
52
|
}
|
|
@@ -73,11 +73,11 @@ 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/react] shutdown', cause)), Effect.catchTag('LiveStore.IntentionalShutdownCause', (cause) => shutdownContext(cause)), Effect.catchTag('LiveStore.
|
|
76
|
+
yield* Deferred.await(shutdownDeferred).pipe(Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/react] shutdown', 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) {
|
|
80
|
-
interrupt(storeValue.componentScope, storeValue.shutdownDeferred, new StoreInterrupted());
|
|
80
|
+
interrupt(storeValue.componentScope, storeValue.shutdownDeferred, new StoreInterrupted({ reason: 'unmounting component' }));
|
|
81
81
|
storeValue.componentScope = undefined;
|
|
82
82
|
storeValue.shutdownDeferred = undefined;
|
|
83
83
|
}
|
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,EAAwB,MAAM,mBAAmB,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,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAChH,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,MAAM,SAAS,GAAG,CAAC,cAAoC,EAAE,gBAAkC,EAAE,KAAuB,EAAE,EAAE,CACtH,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,iEAAiE;IACjE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACpD,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,2CAA2C,EAAE,KAAK,CAAC,CAAC,EACpG,MAAM,CAAC,OAAO,CACf,CAAA;AAGH,MAAM,YAAY,GAAG,IAAI,GAAG,EAA+B,CAAA;AAC3D,MAAM,aAAa,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC7C,IAAI,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,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AC,aAAa,EAAQ,CAAA;IAE/C,MAAM,UAAU,CAAC;QACf,OAAO;QACP,MAAM;QACN,OAAO;QACP,SAAS,EAAE,SAAS,CAAC,OAAO;KAC7B,CAAC,CAAA;IAEF,MAAM,SAAS,CAAC,OAAO,CAAA;IAEvB,OAAO,aAA6E,CAAA;AACtF,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/solid",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -11,14 +11,14 @@
|
|
|
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/livestore": "0.3.0-dev.
|
|
16
|
-
"@livestore/utils": "0.3.0-dev.
|
|
14
|
+
"@livestore/common": "0.3.0-dev.18",
|
|
15
|
+
"@livestore/livestore": "0.3.0-dev.18",
|
|
16
|
+
"@livestore/utils": "0.3.0-dev.18"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
20
20
|
"jsdom": "^26.0.0",
|
|
21
|
-
"typescript": "^5.7.
|
|
21
|
+
"typescript": "^5.7.3",
|
|
22
22
|
"vite": "^6.1.0",
|
|
23
23
|
"vitest": "^2.1.4"
|
|
24
24
|
},
|
package/src/store.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IntentionalShutdownCause, provideOtel, type UnexpectedError } from '@livestore/common'
|
|
1
|
+
import { type IntentionalShutdownCause, provideOtel, StoreInterrupted, type UnexpectedError } from '@livestore/common'
|
|
2
2
|
import type {
|
|
3
3
|
BaseGraphQLContext,
|
|
4
4
|
BootStatus,
|
|
@@ -9,16 +9,12 @@ import type {
|
|
|
9
9
|
ShutdownDeferred,
|
|
10
10
|
Store,
|
|
11
11
|
} from '@livestore/livestore'
|
|
12
|
-
import { createStore
|
|
12
|
+
import { createStore } from '@livestore/livestore'
|
|
13
13
|
import { LS_DEV } from '@livestore/utils'
|
|
14
14
|
import { Deferred, Effect, Exit, identity, Logger, LogLevel, Scope, TaskTracing } from '@livestore/utils/effect'
|
|
15
15
|
import * as Solid from 'solid-js'
|
|
16
16
|
|
|
17
|
-
const interrupt = (
|
|
18
|
-
componentScope: Scope.CloseableScope,
|
|
19
|
-
shutdownDeferred: ShutdownDeferred,
|
|
20
|
-
error: StoreAbort | StoreInterrupted,
|
|
21
|
-
) =>
|
|
17
|
+
const interrupt = (componentScope: Scope.CloseableScope, shutdownDeferred: ShutdownDeferred, error: StoreInterrupted) =>
|
|
22
18
|
Effect.gen(function* () {
|
|
23
19
|
// console.log('[@livestore/livestore/react] interupting', error)
|
|
24
20
|
yield* Scope.close(componentScope, Exit.fail(error))
|
|
@@ -94,7 +90,11 @@ const setupStore = async <GraphQLContext extends BaseGraphQLContext>({
|
|
|
94
90
|
storeValue.shutdownDeferred !== undefined &&
|
|
95
91
|
storeValue.counter === counter
|
|
96
92
|
) {
|
|
97
|
-
interrupt(
|
|
93
|
+
interrupt(
|
|
94
|
+
storeValue.componentScope,
|
|
95
|
+
storeValue.shutdownDeferred,
|
|
96
|
+
new StoreInterrupted({ reason: 'Aborted via provided AbortController' }),
|
|
97
|
+
)
|
|
98
98
|
storeValue.componentScope = undefined
|
|
99
99
|
storeValue.shutdownDeferred = undefined
|
|
100
100
|
}
|
|
@@ -104,7 +104,7 @@ const setupStore = async <GraphQLContext extends BaseGraphQLContext>({
|
|
|
104
104
|
const componentScope = yield* Scope.make()
|
|
105
105
|
const shutdownDeferred = yield* Deferred.make<
|
|
106
106
|
void,
|
|
107
|
-
UnexpectedError | IntentionalShutdownCause |
|
|
107
|
+
UnexpectedError | IntentionalShutdownCause | StoreInterrupted
|
|
108
108
|
>()
|
|
109
109
|
|
|
110
110
|
yield* Effect.gen(function* () {
|
|
@@ -126,13 +126,13 @@ const setupStore = async <GraphQLContext extends BaseGraphQLContext>({
|
|
|
126
126
|
setupDone()
|
|
127
127
|
}).pipe(Scope.extend(componentScope), Effect.forkIn(componentScope))
|
|
128
128
|
|
|
129
|
-
const shutdownContext = (cause: IntentionalShutdownCause |
|
|
129
|
+
const shutdownContext = (cause: IntentionalShutdownCause | StoreInterrupted) =>
|
|
130
130
|
Effect.sync(() => setContextValue({ stage: 'shutdown', cause }))
|
|
131
131
|
|
|
132
132
|
yield* Deferred.await(shutdownDeferred).pipe(
|
|
133
133
|
Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/react] shutdown', cause)),
|
|
134
134
|
Effect.catchTag('LiveStore.IntentionalShutdownCause', (cause) => shutdownContext(cause)),
|
|
135
|
-
Effect.catchTag('LiveStore.
|
|
135
|
+
Effect.catchTag('LiveStore.StoreInterrupted', (cause) => shutdownContext(cause)),
|
|
136
136
|
Effect.tapError((error) => Effect.sync(() => setContextValue({ stage: 'error', error }))),
|
|
137
137
|
Effect.tapDefect((defect) => Effect.sync(() => setContextValue({ stage: 'error', error: defect }))),
|
|
138
138
|
Effect.exit,
|
|
@@ -152,7 +152,11 @@ const setupStore = async <GraphQLContext extends BaseGraphQLContext>({
|
|
|
152
152
|
|
|
153
153
|
Solid.onCleanup(() => {
|
|
154
154
|
if (storeValue.componentScope !== undefined && storeValue.shutdownDeferred !== undefined) {
|
|
155
|
-
interrupt(
|
|
155
|
+
interrupt(
|
|
156
|
+
storeValue.componentScope,
|
|
157
|
+
storeValue.shutdownDeferred,
|
|
158
|
+
new StoreInterrupted({ reason: 'unmounting component' }),
|
|
159
|
+
)
|
|
156
160
|
storeValue.componentScope = undefined
|
|
157
161
|
storeValue.shutdownDeferred = undefined
|
|
158
162
|
}
|
package/tmp/pack.tgz
ADDED
|
Binary file
|