@livestore/react 0.4.0-dev.20 → 0.4.0-dev.21
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/LiveStoreContext.d.ts +27 -0
- package/dist/LiveStoreContext.d.ts.map +1 -1
- package/dist/LiveStoreContext.js +18 -0
- package/dist/LiveStoreContext.js.map +1 -1
- package/dist/LiveStoreProvider.d.ts +9 -2
- package/dist/LiveStoreProvider.d.ts.map +1 -1
- package/dist/LiveStoreProvider.js +2 -1
- package/dist/LiveStoreProvider.js.map +1 -1
- package/dist/experimental/multi-store/StoreRegistry.d.ts +60 -16
- package/dist/experimental/multi-store/StoreRegistry.d.ts.map +1 -1
- package/dist/experimental/multi-store/StoreRegistry.js +125 -216
- package/dist/experimental/multi-store/StoreRegistry.js.map +1 -1
- package/dist/experimental/multi-store/StoreRegistry.test.js +224 -307
- package/dist/experimental/multi-store/StoreRegistry.test.js.map +1 -1
- package/dist/experimental/multi-store/types.d.ts +4 -23
- package/dist/experimental/multi-store/types.d.ts.map +1 -1
- package/dist/experimental/multi-store/useStore.d.ts +1 -1
- package/dist/experimental/multi-store/useStore.d.ts.map +1 -1
- package/dist/experimental/multi-store/useStore.js +5 -10
- package/dist/experimental/multi-store/useStore.js.map +1 -1
- package/dist/experimental/multi-store/useStore.test.js +95 -41
- package/dist/experimental/multi-store/useStore.test.js.map +1 -1
- package/dist/useClientDocument.d.ts +33 -0
- package/dist/useClientDocument.d.ts.map +1 -1
- package/dist/useClientDocument.js.map +1 -1
- package/dist/useStore.d.ts +51 -0
- package/dist/useStore.d.ts.map +1 -1
- package/dist/useStore.js +51 -0
- package/dist/useStore.js.map +1 -1
- package/package.json +6 -6
- package/src/LiveStoreContext.ts +27 -0
- package/src/LiveStoreProvider.tsx +9 -0
- package/src/experimental/multi-store/StoreRegistry.test.ts +236 -349
- package/src/experimental/multi-store/StoreRegistry.ts +171 -265
- package/src/experimental/multi-store/types.ts +31 -49
- package/src/experimental/multi-store/useStore.test.tsx +120 -48
- package/src/experimental/multi-store/useStore.ts +5 -13
- package/src/useClientDocument.ts +35 -0
- package/src/useStore.ts +51 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OtelLiveDummy, UnknownError } from '@livestore/common';
|
|
2
|
+
import { createStore } from '@livestore/livestore';
|
|
3
|
+
import { Cause, Effect, Equal, Exit, Fiber, Hash, Layer, ManagedRuntime, RcMap, Runtime, } from '@livestore/utils/effect';
|
|
2
4
|
/**
|
|
3
5
|
* Default time to keep unused stores in cache.
|
|
4
6
|
*
|
|
@@ -9,248 +11,159 @@ import { createStorePromise } from '@livestore/livestore';
|
|
|
9
11
|
*/
|
|
10
12
|
export const DEFAULT_UNUSED_CACHE_TIME = typeof window === 'undefined' ? Number.POSITIVE_INFINITY : 60_000;
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* RcMap cache key that uses storeId for equality/hashing but carries full options.
|
|
15
|
+
* This allows RcMap to deduplicate by storeId while the lookup function has access to all options.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Only `storeId` is used for equality and hashing. This means if `getOrLoadPromise` is called
|
|
19
|
+
* with different options (e.g., different `adapter`) but the same `storeId`, the cached store
|
|
20
|
+
* from the first call will be returned. This is intentional - a store's identity is determined
|
|
21
|
+
* solely by its `storeId`, and callers should not expect to get different stores by varying
|
|
22
|
+
* other options while keeping the same `storeId`.
|
|
14
23
|
*/
|
|
15
|
-
class
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
#unusedCacheTime;
|
|
20
|
-
#disposalTimeout;
|
|
21
|
-
/**
|
|
22
|
-
* Set of subscriber callbacks to notify on state changes.
|
|
23
|
-
*/
|
|
24
|
-
#subscribers = new Set();
|
|
25
|
-
constructor(storeId, cache) {
|
|
26
|
-
this.#storeId = storeId;
|
|
27
|
-
this.#cache = cache;
|
|
24
|
+
class StoreCacheKey {
|
|
25
|
+
options;
|
|
26
|
+
constructor(options) {
|
|
27
|
+
this.options = options;
|
|
28
28
|
}
|
|
29
|
-
#scheduleDisposal = () => {
|
|
30
|
-
this.#cancelDisposal();
|
|
31
|
-
const effectiveTime = this.#unusedCacheTime === undefined ? DEFAULT_UNUSED_CACHE_TIME : this.#unusedCacheTime;
|
|
32
|
-
if (effectiveTime === Number.POSITIVE_INFINITY)
|
|
33
|
-
return; // Infinity disables disposal
|
|
34
|
-
this.#disposalTimeout = setTimeout(() => {
|
|
35
|
-
this.#disposalTimeout = null;
|
|
36
|
-
// Re-check to avoid racing with a new subscription
|
|
37
|
-
if (this.#subscribers.size > 0)
|
|
38
|
-
return;
|
|
39
|
-
// Abort any in-progress loading to release resources early
|
|
40
|
-
this.#abortLoading();
|
|
41
|
-
// Transition to shutting_down state BEFORE starting async shutdown.
|
|
42
|
-
// This prevents new subscribers from receiving a store that's about to be disposed.
|
|
43
|
-
const shutdownPromise = this.#shutdown().finally(() => {
|
|
44
|
-
// Reset to idle so fresh loads can proceed, then remove from cache if still inactive
|
|
45
|
-
this.#setIdle();
|
|
46
|
-
if (this.#subscribers.size === 0)
|
|
47
|
-
this.#cache.delete(this.#storeId);
|
|
48
|
-
});
|
|
49
|
-
this.#setShuttingDown(shutdownPromise);
|
|
50
|
-
}, effectiveTime);
|
|
51
|
-
};
|
|
52
|
-
#cancelDisposal = () => {
|
|
53
|
-
if (!this.#disposalTimeout)
|
|
54
|
-
return;
|
|
55
|
-
clearTimeout(this.#disposalTimeout);
|
|
56
|
-
this.#disposalTimeout = null;
|
|
57
|
-
};
|
|
58
29
|
/**
|
|
59
|
-
*
|
|
30
|
+
* Equality is based solely on `storeId`. Other options in `CachedStoreOptions` are ignored
|
|
31
|
+
* for cache key comparison. The first options used for a given `storeId` determine the
|
|
32
|
+
* store's configuration.
|
|
60
33
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return;
|
|
64
|
-
this.#state = { status: 'loading', promise, abortController };
|
|
65
|
-
this.#notify();
|
|
34
|
+
[Equal.symbol](that) {
|
|
35
|
+
return that instanceof StoreCacheKey && this.options.storeId === that.options.storeId;
|
|
66
36
|
}
|
|
37
|
+
[Hash.symbol]() {
|
|
38
|
+
return Hash.string(this.options.storeId);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Store Registry coordinating store loading, caching, and retention
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export class StoreRegistry {
|
|
67
47
|
/**
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
#setStore = (store) => {
|
|
71
|
-
this.#state = { status: 'success', store };
|
|
72
|
-
this.#notify();
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Transitions to the error state.
|
|
48
|
+
* Reference-counted cache mapping storeId to Store instances.
|
|
49
|
+
* Stores are created on first access and disposed after `unusedCacheTime` when all references are released.
|
|
76
50
|
*/
|
|
77
|
-
#
|
|
78
|
-
this.#state = { status: 'error', error };
|
|
79
|
-
this.#notify();
|
|
80
|
-
};
|
|
51
|
+
#rcMap;
|
|
81
52
|
/**
|
|
82
|
-
*
|
|
53
|
+
* Effect runtime providing Scope and OtelTracer for all registry operations.
|
|
54
|
+
* When the runtime's scope closes, all managed stores are automatically shut down.
|
|
83
55
|
*/
|
|
84
|
-
#
|
|
85
|
-
this.#state = { status: 'shutting_down', shutdownPromise };
|
|
86
|
-
this.#notify();
|
|
87
|
-
};
|
|
56
|
+
#runtime;
|
|
88
57
|
/**
|
|
89
|
-
*
|
|
58
|
+
* In-flight loading promises keyed by storeId.
|
|
59
|
+
* Ensures concurrent `getOrLoadPromise` calls receive the same Promise reference.
|
|
90
60
|
*/
|
|
91
|
-
#
|
|
92
|
-
this.#state = { status: 'idle' };
|
|
93
|
-
// No notify needed - getOrLoad will handle the fresh load
|
|
94
|
-
};
|
|
61
|
+
#loadingPromises = new Map();
|
|
95
62
|
/**
|
|
96
|
-
*
|
|
63
|
+
* Creates a new StoreRegistry instance.
|
|
97
64
|
*
|
|
98
|
-
* @
|
|
99
|
-
* This should be called after any meaningful state change.
|
|
100
|
-
*/
|
|
101
|
-
#notify = () => {
|
|
102
|
-
for (const sub of this.#subscribers) {
|
|
103
|
-
try {
|
|
104
|
-
sub();
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
// Swallow to protect other listeners
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Subscribes to this entry's updates.
|
|
65
|
+
* @param params.defaultOptions - Default options applied to all stores managed by this registry when they are loaded.
|
|
113
66
|
*
|
|
114
|
-
* @
|
|
115
|
-
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const registry = new StoreRegistry({
|
|
70
|
+
* defaultOptions: {
|
|
71
|
+
* batchUpdates,
|
|
72
|
+
* unusedCacheTime: 30_000,
|
|
73
|
+
* }
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
116
76
|
*/
|
|
117
|
-
|
|
118
|
-
this.#
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
77
|
+
constructor(params = {}) {
|
|
78
|
+
this.#runtime =
|
|
79
|
+
params.defaultOptions?.runtime ??
|
|
80
|
+
ManagedRuntime.make(Layer.mergeAll(Layer.scope, OtelLiveDummy)).runtimeEffect.pipe(Effect.runSync);
|
|
81
|
+
this.#rcMap = RcMap.make({
|
|
82
|
+
lookup: (key) => Effect.gen(this, function* () {
|
|
83
|
+
const { options } = key;
|
|
84
|
+
return yield* createStore(options).pipe(Effect.catchAllDefect((cause) => UnknownError.make({ cause })));
|
|
85
|
+
}).pipe(Effect.withSpan(`StoreRegistry.lookup:${key.options.storeId}`)),
|
|
86
|
+
// TODO: Make idleTimeToLive vary for each store when Effect supports per-resource TTL
|
|
87
|
+
// See https://github.com/livestorejs/livestore/issues/917
|
|
88
|
+
idleTimeToLive: params.defaultOptions?.unusedCacheTime ?? DEFAULT_UNUSED_CACHE_TIME,
|
|
89
|
+
}).pipe(Runtime.runSync(this.#runtime));
|
|
90
|
+
}
|
|
127
91
|
/**
|
|
128
|
-
* Gets
|
|
92
|
+
* Gets a cached store or loads a new one, with the store lifetime scoped to the caller.
|
|
129
93
|
*
|
|
130
|
-
* @
|
|
131
|
-
* @returns
|
|
94
|
+
* @typeParam TSchema - The schema type for the store
|
|
95
|
+
* @returns An Effect that yields the store, scoped to the provided Scope
|
|
132
96
|
*
|
|
133
97
|
* @remarks
|
|
134
|
-
*
|
|
135
|
-
* -
|
|
136
|
-
*
|
|
137
|
-
* -
|
|
138
|
-
* - Schedules disposal when loading completes without active subscribers
|
|
139
|
-
*/
|
|
140
|
-
getOrLoad = (options) => {
|
|
141
|
-
if (options.unusedCacheTime !== undefined)
|
|
142
|
-
this.#unusedCacheTime = Math.max(this.#unusedCacheTime ?? 0, options.unusedCacheTime);
|
|
143
|
-
if (this.#state.status === 'success')
|
|
144
|
-
return this.#state.store;
|
|
145
|
-
if (this.#state.status === 'loading')
|
|
146
|
-
return this.#state.promise;
|
|
147
|
-
if (this.#state.status === 'error')
|
|
148
|
-
throw this.#state.error;
|
|
149
|
-
// Wait for shutdown to complete, then recursively call to load a fresh store
|
|
150
|
-
if (this.#state.status === 'shutting_down') {
|
|
151
|
-
return this.#state.shutdownPromise.then(() => this.getOrLoad(options));
|
|
152
|
-
}
|
|
153
|
-
const abortController = new AbortController();
|
|
154
|
-
const promise = createStorePromise({ ...options, signal: abortController.signal })
|
|
155
|
-
.then((store) => {
|
|
156
|
-
this.#setStore(store);
|
|
157
|
-
return store;
|
|
158
|
-
})
|
|
159
|
-
.catch((error) => {
|
|
160
|
-
this.#setError(error);
|
|
161
|
-
throw error;
|
|
162
|
-
})
|
|
163
|
-
.finally(() => {
|
|
164
|
-
// The store entry may have become unused (no subscribers) while loading the store
|
|
165
|
-
if (this.#subscribers.size === 0)
|
|
166
|
-
this.#scheduleDisposal();
|
|
167
|
-
});
|
|
168
|
-
this.#setLoading(promise, abortController);
|
|
169
|
-
return promise;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Aborts an in-progress store load.
|
|
173
|
-
*
|
|
174
|
-
* This signals the createStorePromise to cancel, releasing resources like
|
|
175
|
-
* worker threads, SQLite connections, and network requests.
|
|
98
|
+
* - Stores are kept in cache and reused while any scope holds them
|
|
99
|
+
* - When the scope closes, the reference is released; the store is disposed after `unusedCacheTime`
|
|
100
|
+
* if no other scopes retain it
|
|
101
|
+
* - Concurrent calls with the same storeId share the same store instance
|
|
176
102
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
};
|
|
182
|
-
#shutdown = async () => {
|
|
183
|
-
if (this.#state.status !== 'success')
|
|
184
|
-
return;
|
|
185
|
-
await this.#state.store.shutdownPromise().catch((reason) => {
|
|
186
|
-
console.warn(`Store ${this.#storeId} failed to shutdown cleanly during disposal:`, reason);
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* In-memory map of {@link StoreEntry} instances keyed by {@link StoreId}.
|
|
192
|
-
*
|
|
193
|
-
* @privateRemarks
|
|
194
|
-
* The cache is intentionally small; eviction and disposal timers are coordinated by the client.
|
|
195
|
-
*
|
|
196
|
-
* @internal
|
|
197
|
-
*/
|
|
198
|
-
class StoreCache {
|
|
199
|
-
#entries = new Map();
|
|
200
|
-
get = (storeId) => {
|
|
201
|
-
return this.#entries.get(storeId);
|
|
202
|
-
};
|
|
203
|
-
ensure = (storeId) => {
|
|
204
|
-
let entry = this.#entries.get(storeId);
|
|
205
|
-
if (!entry) {
|
|
206
|
-
entry = new StoreEntry(storeId, this);
|
|
207
|
-
this.#entries.set(storeId, entry);
|
|
208
|
-
}
|
|
209
|
-
return entry;
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* Removes an entry from the cache.
|
|
213
|
-
*
|
|
214
|
-
* @param storeId - The ID of the store to remove
|
|
215
|
-
*/
|
|
216
|
-
delete = (storeId) => {
|
|
217
|
-
this.#entries.delete(storeId);
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Store Registry coordinating store loading, caching, and subscription
|
|
222
|
-
*
|
|
223
|
-
* @public
|
|
224
|
-
*/
|
|
225
|
-
export class StoreRegistry {
|
|
226
|
-
#cache = new StoreCache();
|
|
227
|
-
#defaultOptions;
|
|
228
|
-
constructor({ defaultOptions = {} } = {}) {
|
|
229
|
-
this.#defaultOptions = defaultOptions;
|
|
230
|
-
}
|
|
231
|
-
#applyDefaultOptions = (options) => ({
|
|
232
|
-
...this.#defaultOptions,
|
|
233
|
-
...options,
|
|
234
|
-
});
|
|
103
|
+
getOrLoad = (options) => Effect.gen(this, function* () {
|
|
104
|
+
const key = new StoreCacheKey(options);
|
|
105
|
+
const store = yield* RcMap.get(this.#rcMap, key);
|
|
106
|
+
return store;
|
|
107
|
+
}).pipe(Effect.withSpan(`StoreRegistry.getOrLoad:${options.storeId}`));
|
|
235
108
|
/**
|
|
236
|
-
* Get or load a store, returning it directly if loaded or a promise if loading.
|
|
109
|
+
* Get or load a store, returning it directly if already loaded or a promise if loading.
|
|
237
110
|
*
|
|
238
|
-
* @typeParam TSchema - The schema
|
|
111
|
+
* @typeParam TSchema - The schema type for the store
|
|
239
112
|
* @returns The loaded store if available, or a Promise that resolves to the loaded store
|
|
240
113
|
* @throws unknown loading error
|
|
241
114
|
*
|
|
242
115
|
* @remarks
|
|
243
116
|
* - Returns the store instance directly (synchronous) when already loaded
|
|
244
117
|
* - Returns a stable Promise reference when loading is in progress or needs to be initiated
|
|
118
|
+
* - Throws with the same error instance on subsequent calls after failure
|
|
245
119
|
* - Applies default options from registry config, with call-site options taking precedence
|
|
120
|
+
* - Concurrent calls with the same storeId share the same store instance
|
|
246
121
|
*/
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
122
|
+
getOrLoadPromise = (options) => {
|
|
123
|
+
const exit = this.getOrLoad(options).pipe(Effect.scoped, Runtime.runSyncExit(this.#runtime));
|
|
124
|
+
if (Exit.isSuccess(exit))
|
|
125
|
+
return exit.value;
|
|
126
|
+
// Check if the failure is due to async work
|
|
127
|
+
const defect = Cause.dieOption(exit.cause);
|
|
128
|
+
if (defect._tag === 'Some' && Runtime.isAsyncFiberException(defect.value)) {
|
|
129
|
+
const { storeId } = options;
|
|
130
|
+
// Return cached promise if one exists (ensures concurrent calls get the same Promise reference)
|
|
131
|
+
const cached = this.#loadingPromises.get(storeId);
|
|
132
|
+
if (cached)
|
|
133
|
+
return cached;
|
|
134
|
+
// Create and cache the promise
|
|
135
|
+
const fiber = defect.value.fiber;
|
|
136
|
+
const promise = Fiber.join(fiber)
|
|
137
|
+
.pipe(Runtime.runPromise(this.#runtime))
|
|
138
|
+
.finally(() => this.#loadingPromises.delete(storeId));
|
|
139
|
+
this.#loadingPromises.set(storeId, promise);
|
|
140
|
+
return promise;
|
|
141
|
+
}
|
|
142
|
+
// Handle synchronous failure
|
|
143
|
+
throw Cause.squash(exit.cause);
|
|
251
144
|
};
|
|
252
145
|
/**
|
|
253
|
-
*
|
|
146
|
+
* Retains the store in cache until the returned release function is called.
|
|
147
|
+
*
|
|
148
|
+
* @returns A release function that, when called, removes this retention hold
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* - Multiple retains on the same store are independent; each must be released separately
|
|
152
|
+
* - If the store isn't cached yet, it will be loaded and then retained
|
|
153
|
+
*/
|
|
154
|
+
retain = (options) => {
|
|
155
|
+
const release = Effect.gen(this, function* () {
|
|
156
|
+
const key = new StoreCacheKey(options);
|
|
157
|
+
yield* RcMap.get(this.#rcMap, key);
|
|
158
|
+
// Effect.never suspends indefinitely, keeping the RcMap reference alive.
|
|
159
|
+
// When `release()` is called, the fiber is interrupted, closing the scope
|
|
160
|
+
// and releasing the RcMap entry (which may trigger disposal after idleTimeToLive).
|
|
161
|
+
yield* Effect.never;
|
|
162
|
+
}).pipe(Effect.scoped, Runtime.runCallback(this.#runtime));
|
|
163
|
+
return () => release();
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Warms the cache for a store without adding a retention.
|
|
254
167
|
*
|
|
255
168
|
* @typeParam TSchema - The schema of the store to preload
|
|
256
169
|
* @returns A promise that resolves when the loading is complete (success or failure)
|
|
@@ -261,15 +174,11 @@ export class StoreRegistry {
|
|
|
261
174
|
*/
|
|
262
175
|
preload = async (options) => {
|
|
263
176
|
try {
|
|
264
|
-
await this.
|
|
177
|
+
await this.getOrLoadPromise(options);
|
|
265
178
|
}
|
|
266
179
|
catch {
|
|
267
180
|
// Do nothing; preload is best-effort
|
|
268
181
|
}
|
|
269
182
|
};
|
|
270
|
-
subscribe = (storeId, listener) => {
|
|
271
|
-
const entry = this.#cache.ensure(storeId);
|
|
272
|
-
return entry.subscribe(listener);
|
|
273
|
-
};
|
|
274
183
|
}
|
|
275
184
|
//# sourceMappingURL=StoreRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreRegistry.js","sourceRoot":"","sources":["../../../src/experimental/multi-store/StoreRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StoreRegistry.js","sourceRoot":"","sources":["../../../src/experimental/multi-store/StoreRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAc,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,cAAc,EAEd,KAAK,EACL,OAAO,GAER,MAAM,yBAAyB,CAAA;AAGhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAy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