@warp-drive/react 5.8.0-alpha.9 → 5.8.0-beta.1

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.
@@ -0,0 +1,290 @@
1
+ import { Signal } from 'signal-polyfill';
2
+ import { createContext, useMemo, useSyncExternalStore } from 'react';
3
+ import { jsxDEV } from 'react/jsx-dev-runtime';
4
+
5
+ /*
6
+ These are the runtime implementations for the javascript macros that have
7
+ runtime implementations.
8
+
9
+ Not every macro has a runtime implementation, some only make sense in the
10
+ build and always run there.
11
+
12
+ Even when we have runtime implementations, we are still careful to emit static
13
+ errors during the build wherever possible, and runtime errors when necessary,
14
+ so that you're not surprised when you switch from runtime-mode to compile-time
15
+ mode.
16
+ */
17
+
18
+ // This is here as a compile target for `getConfig` and `getOwnConfig` when
19
+ // we're in runtime mode. This is not public API to call from your own code.
20
+ function config(packageRoot) {
21
+ return runtimeConfig.packages[packageRoot];
22
+ }
23
+ function getGlobalConfig() {
24
+ return runtimeConfig.global;
25
+ }
26
+ const runtimeConfig = initializeRuntimeMacrosConfig();
27
+
28
+ // this exists to be targeted by our babel plugin
29
+ function initializeRuntimeMacrosConfig() {
30
+ return {
31
+ "packages": {},
32
+ "global": {
33
+ "@embroider/macros": {
34
+ "isTesting": false
35
+ },
36
+ "WarpDrive": {
37
+ "debug": {
38
+ "DEBUG_RELATIONSHIP_NOTIFICATIONS": false,
39
+ "LOG_CACHE": false,
40
+ "LOG_CACHE_POLICY": false,
41
+ "LOG_GRAPH": false,
42
+ "LOG_IDENTIFIERS": false,
43
+ "LOG_INSTANCE_CACHE": false,
44
+ "LOG_METRIC_COUNTS": false,
45
+ "LOG_MUTATIONS": false,
46
+ "LOG_NOTIFICATIONS": false,
47
+ "LOG_OPERATIONS": false,
48
+ "LOG_PAYLOADS": false,
49
+ "LOG_REACT_SIGNAL_INTEGRATION": false,
50
+ "LOG_REQUESTS": false,
51
+ "LOG_REQUEST_STATUS": false,
52
+ "__INTERNAL_LOG_NATIVE_MAP_SET_COUNTS": false
53
+ },
54
+ "polyfillUUID": false,
55
+ "includeDataAdapter": true,
56
+ "compatWith": "99.0",
57
+ "deprecations": {
58
+ "DEPRECATE_CATCH_ALL": false,
59
+ "DEPRECATE_COMPUTED_CHAINS": false,
60
+ "DEPRECATE_EMBER_INFLECTOR": false,
61
+ "DEPRECATE_LEGACY_IMPORTS": false,
62
+ "DEPRECATE_MANY_ARRAY_DUPLICATES": false,
63
+ "DEPRECATE_NON_STRICT_ID": false,
64
+ "DEPRECATE_NON_STRICT_TYPES": false,
65
+ "DEPRECATE_NON_UNIQUE_PAYLOADS": false,
66
+ "DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE": false,
67
+ "DEPRECATE_STORE_EXTENDS_EMBER_OBJECT": false,
68
+ "DEPRECATE_TRACKING_PACKAGE": false,
69
+ "DISABLE_7X_DEPRECATIONS": false,
70
+ "ENABLE_LEGACY_REQUEST_METHODS": false,
71
+ "ENABLE_LEGACY_SCHEMA_SERVICE": false
72
+ },
73
+ "features": {
74
+ "ENFORCE_STRICT_RESOURCE_FINALIZATION": false,
75
+ "JSON_API_CACHE_VALIDATION_ERRORS": false,
76
+ "SAMPLE_FEATURE_FLAG": false
77
+ },
78
+ "activeLogging": {
79
+ "DEBUG_RELATIONSHIP_NOTIFICATIONS": true,
80
+ "LOG_CACHE": true,
81
+ "LOG_CACHE_POLICY": true,
82
+ "LOG_GRAPH": true,
83
+ "LOG_IDENTIFIERS": true,
84
+ "LOG_INSTANCE_CACHE": true,
85
+ "LOG_METRIC_COUNTS": true,
86
+ "LOG_MUTATIONS": true,
87
+ "LOG_NOTIFICATIONS": true,
88
+ "LOG_OPERATIONS": true,
89
+ "LOG_PAYLOADS": true,
90
+ "LOG_REACT_SIGNAL_INTEGRATION": true,
91
+ "LOG_REQUESTS": true,
92
+ "LOG_REQUEST_STATUS": true,
93
+ "__INTERNAL_LOG_NATIVE_MAP_SET_COUNTS": true
94
+ },
95
+ "env": {
96
+ "TESTING": true,
97
+ "PRODUCTION": false,
98
+ "DEBUG": true,
99
+ "IS_RECORDING": false,
100
+ "IS_CI": true,
101
+ "SHOULD_RECORD": false
102
+ }
103
+ }
104
+ }
105
+ };
106
+ }
107
+ function updaterMethods() {
108
+ return {
109
+ config,
110
+ getGlobalConfig,
111
+ setConfig(packageRoot, value) {
112
+ runtimeConfig.packages[packageRoot] = value;
113
+ },
114
+ setGlobalConfig(key, value) {
115
+ runtimeConfig.global[key] = value;
116
+ }
117
+ };
118
+ }
119
+
120
+ // this is how runtime config can get injected at boot. I'm not sure yet if this
121
+ // should be public API, but we certainly need it internally to set things like
122
+ // the global fastboot.isRunning.
123
+ //
124
+ // consumers of this API push a function onto
125
+ // window._embroider_macros_runtime_config. The function is given four methods
126
+ // which allow it to read and write the per-package and global configs. The
127
+ // reason for allowing both read & write is that merging strategies are up to
128
+ // each consumers -- read first, then merge, then write.
129
+ //
130
+ // For an example user of this API, see where we generate
131
+ // embroider_macros_fastboot_init.js' in @embroider/core.
132
+ let updaters = typeof window !== 'undefined' ? window._embroider_macros_runtime_config : undefined;
133
+ if (updaters) {
134
+ let methods = updaterMethods();
135
+ for (let updater of updaters) {
136
+ updater(methods);
137
+ }
138
+ }
139
+ var _jsxFileName = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/reactive-context.tsx";
140
+ let nextFlush = null;
141
+ let watchers = [];
142
+ let watcherId = 0;
143
+ function clearWatcher(state) {
144
+ state.watcher.unwatch(...Signal.subtle.introspectSources(state.watcher));
145
+ }
146
+ function flush(state) {
147
+ state.pending = false;
148
+ if (state.destroyed) {
149
+ {
150
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
151
+ console.log(`[WarpDrive] Detected Watcher Destroyed During Notify Flush, clearing signals`);
152
+ }
153
+ }
154
+ state.snapshot = null;
155
+ clearWatcher(state);
156
+ return;
157
+ }
158
+ {
159
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
160
+ console.log(`[WarpDrive] Notifying React That WatcherContext:${state.watcherId} Has Updated`);
161
+ console.log("all signals", new Set(Signal.subtle.introspectSources(state.watcher)));
162
+ console.log("dirty signals", new Set(state.watcher.getPending()));
163
+ }
164
+ } // any time signals have changed, we notify React that our store has updated
165
+ state.snapshot = {
166
+ watcher: state.watcher
167
+ };
168
+ if (state.notifyReact) state.notifyReact();
169
+
170
+ // tell the Watcher to start watching for changes again
171
+ // by signaling that notifications have been flushed.
172
+ state.watcher.watch();
173
+ }
174
+ function _createWatcher() {
175
+ const id = watcherId++;
176
+ {
177
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
178
+ console.log(`[WarpDrive] Creating a WatcherContext:${id}`);
179
+ }
180
+ }
181
+ const state = {
182
+ watcherId: id,
183
+ pending: false,
184
+ destroyed: false,
185
+ notifyReact: null,
186
+ watcher: null,
187
+ // the extra wrapper returned here ensures that the context value for the watcher
188
+ // changes causing a re-render when the watcher is updated.
189
+ snapshot: null
190
+ };
191
+ state.watcher = new Signal.subtle.Watcher((...args) => {
192
+ {
193
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
194
+ console.log(`watcher ${state.watcherId} notified`, args, state.watcher);
195
+ }
196
+ }
197
+ if (!state.pending && !state.destroyed) {
198
+ watchers.push(state);
199
+ state.pending = true;
200
+ if (!nextFlush) {
201
+ nextFlush = new Promise(resolve => {
202
+ queueMicrotask(() => {
203
+ queueMicrotask(() => {
204
+ queueMicrotask(() => {
205
+ watchers.forEach(flush);
206
+ {
207
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
208
+ console.log("Flushed watcher:", watchers.map(w => w.watcherId));
209
+ }
210
+ }
211
+ watchers = [];
212
+ nextFlush = null;
213
+ resolve();
214
+ });
215
+ });
216
+ });
217
+ });
218
+ }
219
+ } else if (state.destroyed) {
220
+ {
221
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
222
+ console.log(`[WarpDrive] Detected Watcher Destroyed During Notify, clearing signals`);
223
+ }
224
+ } // if we are destroyed, we clear the watcher signals
225
+ // so that it does not continue to watch for changes.
226
+ state.snapshot = null;
227
+ clearWatcher(state);
228
+ }
229
+ });
230
+
231
+ // The watcher won't begin watching until we call `watcher.watch()`
232
+ state.watcher.watch();
233
+ state.snapshot = {
234
+ watcher: state.watcher
235
+ };
236
+ return state;
237
+ }
238
+ function useWatcher() {
239
+ const state = useMemo(_createWatcher, []);
240
+ return useSyncExternalStore(notifyChanged => {
241
+ {
242
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
243
+ console.log(`[WarpDrive] Subscribing to Watcher`);
244
+ }
245
+ }
246
+ state.destroyed = false;
247
+ state.notifyReact = notifyChanged;
248
+
249
+ // The watcher won't begin watching until we call `watcher.watch()`
250
+ state.watcher.watch();
251
+ return () => {
252
+ {
253
+ if (getGlobalConfig().WarpDrive.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
254
+ console.log(`[WarpDrive] Deactivating Watcher Subscription`);
255
+ }
256
+ }
257
+ state.destroyed = true;
258
+ state.notifyReact = null;
259
+ };
260
+ }, () => state.snapshot);
261
+ }
262
+
263
+ /**
264
+ * @category Contexts
265
+ */
266
+ const WatcherContext = /*#__PURE__*/createContext(null);
267
+
268
+ /**
269
+ *
270
+ * @category Components
271
+ */
272
+ function ReactiveContext({
273
+ children
274
+ }) {
275
+ const watcher = useWatcher();
276
+ /**
277
+ * Unlike other frameworks, React does not have a built-in way to provide
278
+ * a context value other than by rendering an extra component.
279
+ *
280
+ */
281
+ return /*#__PURE__*/jsxDEV(WatcherContext, {
282
+ value: watcher,
283
+ children: children
284
+ }, void 0, false, {
285
+ fileName: _jsxFileName,
286
+ lineNumber: 159,
287
+ columnNumber: 10
288
+ }, this);
289
+ }
290
+ export { ReactiveContext as R, WatcherContext as W, getGlobalConfig as g };
@@ -0,0 +1,324 @@
1
+ import { R as ReactiveContext } from "./reactive-context-DMgQ7YV_.js";
2
+ export { W as WatcherContext } from "./reactive-context-DMgQ7YV_.js";
3
+ import '@warp-drive/core';
4
+ import { useMemo, createContext, use, useRef, useEffect } from 'react';
5
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
6
+ import { createRequestSubscription } from '@warp-drive/core/reactive';
7
+ import { DISPOSE, signal } from '@warp-drive/core/signals/-leaked';
8
+ import '@warp-drive/core/request';
9
+ var _jsxFileName$1 = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/store-provider.tsx";
10
+ const StoreContext = /*#__PURE__*/createContext(null);
11
+
12
+ /**
13
+ * @category Hooks
14
+ */
15
+ function useStore() {
16
+ const store = use(StoreContext);
17
+ (test => {
18
+ if (!test) {
19
+ throw new Error("No Store provided via context. Please ensure you are using <StoreProvider> to provide a Store instance.");
20
+ }
21
+ })(store);
22
+ return store;
23
+ }
24
+ /**
25
+ * @category Components
26
+ */
27
+ function StoreProvider($props) {
28
+ const store = useMemo(() => "store" in $props ? $props.store : new $props.Store(), ["store" in $props ? $props.store : $props.Store]);
29
+ return /*#__PURE__*/jsxDEV(StoreContext, {
30
+ value: store,
31
+ children: $props.children
32
+ }, void 0, false, {
33
+ fileName: _jsxFileName$1,
34
+ lineNumber: 34,
35
+ columnNumber: 10
36
+ }, this);
37
+ }
38
+ const deferred = /* @__PURE__ */new WeakMap();
39
+ function deferDecorator(proto, prop, desc) {
40
+ let map = deferred.get(proto);
41
+ if (!map) {
42
+ map = /* @__PURE__ */new Map();
43
+ deferred.set(proto, map);
44
+ }
45
+ map.set(prop, desc);
46
+ }
47
+ function findDeferredDecorator(target, prop) {
48
+ var _a;
49
+ let cursor = target.prototype;
50
+ while (cursor) {
51
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
52
+ if (desc) {
53
+ return desc;
54
+ }
55
+ cursor = cursor.prototype;
56
+ }
57
+ }
58
+ function decorateFieldV2(prototype, prop, decorators, initializer) {
59
+ let desc = {
60
+ configurable: true,
61
+ enumerable: true,
62
+ writable: true,
63
+ initializer: null
64
+ };
65
+ if (initializer) {
66
+ desc.initializer = initializer;
67
+ }
68
+ for (let decorator of decorators) {
69
+ desc = decorator(prototype, prop, desc) || desc;
70
+ }
71
+ if (desc.initializer === void 0) {
72
+ Object.defineProperty(prototype, prop, desc);
73
+ } else {
74
+ deferDecorator(prototype, prop, desc);
75
+ }
76
+ }
77
+ function initializeDeferredDecorator(target, prop) {
78
+ let desc = findDeferredDecorator(target.constructor, prop);
79
+ if (desc) {
80
+ Object.defineProperty(target, prop, {
81
+ enumerable: desc.enumerable,
82
+ configurable: desc.configurable,
83
+ writable: desc.writable,
84
+ value: desc.initializer ? desc.initializer.call(target) : void 0
85
+ });
86
+ }
87
+ }
88
+ var _jsxFileName = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/request.tsx";
89
+ const IdleBlockMissingError = new Error("No idle block provided for <Request> component, and no query or request was provided.");
90
+ class ReactiveArgs {
91
+ static {
92
+ decorateFieldV2(this.prototype, "request", [signal]);
93
+ }
94
+ #request = (initializeDeferredDecorator(this, "request"), void 0);
95
+ static {
96
+ decorateFieldV2(this.prototype, "query", [signal]);
97
+ }
98
+ #query = (initializeDeferredDecorator(this, "query"), void 0);
99
+ static {
100
+ decorateFieldV2(this.prototype, "autorefresh", [signal]);
101
+ }
102
+ #autorefresh = (initializeDeferredDecorator(this, "autorefresh"), void 0);
103
+ static {
104
+ decorateFieldV2(this.prototype, "autorefreshThreshold", [signal]);
105
+ }
106
+ #autorefreshThreshold = (initializeDeferredDecorator(this, "autorefreshThreshold"), void 0);
107
+ static {
108
+ decorateFieldV2(this.prototype, "autorefreshBehavior", [signal]);
109
+ }
110
+ #autorefreshBehavior = (initializeDeferredDecorator(this, "autorefreshBehavior"), void 0);
111
+ }
112
+ const DefaultChrome = ({
113
+ children
114
+ }) => {
115
+ return /*#__PURE__*/jsxDEV(Fragment, {
116
+ children: children
117
+ }, void 0, false);
118
+ };
119
+ function Throw({
120
+ error
121
+ }) {
122
+ throw error;
123
+ }
124
+
125
+ /**
126
+ * The `<Request />` component is a powerful tool for managing data fetching and
127
+ * state in your React application. It provides a declarative approach to reactive
128
+ * control-flow for managing requests and state in your application.
129
+ *
130
+ * The `<Request />` component is ideal for handling "boundaries", outside which some
131
+ * state is still allowed to be unresolved and within which it MUST be resolved.
132
+ *
133
+ * ## Request States
134
+ *
135
+ * `<Request />` has five states, only one of which will be active and rendered at a time.
136
+ *
137
+ * - `idle`: The component is waiting to be given a request to monitor
138
+ * - `loading`: The request is in progress
139
+ * - `error`: The request failed
140
+ * - `content`: The request succeeded
141
+ * - `cancelled`: The request was cancelled
142
+ *
143
+ * Additionally, the `content` state has a `refresh` method that can be used to
144
+ * refresh the request in the background, which is available as a sub-state of
145
+ * the `content` state.
146
+ *
147
+ * ### Example Usage
148
+ *
149
+ * ```tsx
150
+ * import { Request } from "@warp-drive/react";
151
+ *
152
+ * export function UserPreview($props: { id: string | null }) {
153
+ * return (
154
+ * <Request
155
+ * query={findRecord('user', $props.id)}
156
+ * states={{
157
+ * idle: () => <div>Waiting for User Selection</div>,
158
+ * loading: ({ state }) => <div>Loading user data...</div>,
159
+ * cancelled: ({ error, features }) => (
160
+ * <div>
161
+ * <p>Request Cancelled</p>
162
+ * <p><button onClick={features.retry}>Start Again?</button></p>
163
+ * </div>
164
+ * ),
165
+ * error: ({ error, features }) => (
166
+ * <div>
167
+ * <p>Error: {error.message}</p>
168
+ * <p><button onClick={features.retry}>Try Again?</button></p>
169
+ * </div>
170
+ * ),
171
+ * content: ({ result, features }) => (
172
+ * <div>
173
+ * <h2>User Details</h2>
174
+ * <p>ID: {result.id}</p>
175
+ * <p>Name: {result.name}</p>
176
+ * </div>
177
+ * ),
178
+ * }}
179
+ * />
180
+ * );
181
+ * }
182
+ *
183
+ * ```
184
+ *
185
+ * @category Components
186
+ */
187
+ function Request($props) {
188
+ return /*#__PURE__*/jsxDEV(ReactiveContext, {
189
+ children: /*#__PURE__*/jsxDEV(InternalRequest, {
190
+ ...$props
191
+ }, void 0, false, {
192
+ fileName: _jsxFileName,
193
+ lineNumber: 174,
194
+ columnNumber: 7
195
+ }, this)
196
+ }, void 0, false, {
197
+ fileName: _jsxFileName,
198
+ lineNumber: 173,
199
+ columnNumber: 5
200
+ }, this);
201
+ }
202
+ function isStrictModeRender() {
203
+ const count = useRef(0);
204
+
205
+ // in debug we need to skip every second invocation
206
+ {
207
+ if (count.current++ % 2 === 1) {
208
+ return true;
209
+ }
210
+ }
211
+ return false;
212
+ }
213
+ function InternalRequest($props) {
214
+ const isStrict = isStrictModeRender();
215
+ const store = $props.store ?? useStore();
216
+ const Chrome = $props.chrome ?? DefaultChrome;
217
+ const sink = useRef(null);
218
+ const args = useRef(null);
219
+ if (!args.current) {
220
+ args.current = new ReactiveArgs();
221
+ }
222
+ Object.assign(args.current, $props);
223
+ if (sink.current && (sink.current.store !== store || $props.subscription)) {
224
+ sink.current[DISPOSE]();
225
+ sink.current = null;
226
+ }
227
+ if (!sink.current && !$props.subscription) {
228
+ sink.current = createRequestSubscription(store, args.current);
229
+ }
230
+ const initialized = useRef(null);
231
+ const effect = () => {
232
+ if (sink.current && (!initialized.current || initialized.current.disposable !== sink.current)) {
233
+ initialized.current = {
234
+ disposable: sink.current,
235
+ dispose: () => {
236
+ sink.current?.[DISPOSE]();
237
+ initialized.current = null;
238
+ sink.current = null;
239
+ }
240
+ };
241
+ }
242
+ return sink.current ? initialized.current.dispose : undefined;
243
+ };
244
+ let maybeEffect = effect;
245
+ {
246
+ if (isStrict) {
247
+ maybeEffect = () => {
248
+ if (initialized.current) {
249
+ return effect();
250
+ }
251
+ return () => {
252
+ // initialize our actual effect
253
+ effect();
254
+ // in strict mode we don't want to run the teardown
255
+ // for the second invocation
256
+ };
257
+ };
258
+ }
259
+ }
260
+ useEffect(maybeEffect, [sink.current]);
261
+ const state = $props.subscription ?? sink.current;
262
+ const slots = $props.states;
263
+ return /*#__PURE__*/jsxDEV(Chrome, {
264
+ state: state.isIdle ? null : state.reqState,
265
+ features: state.contentFeatures,
266
+ children:
267
+ // prettier-ignore
268
+ state.isIdle && slots.idle ? /*#__PURE__*/jsxDEV(slots.idle, {}, void 0, false, {
269
+ fileName: _jsxFileName,
270
+ lineNumber: 258,
271
+ columnNumber: 38
272
+ }, this) : state.isIdle ? /*#__PURE__*/jsxDEV(Throw, {
273
+ error: IdleBlockMissingError
274
+ }, void 0, false, {
275
+ fileName: _jsxFileName,
276
+ lineNumber: 259,
277
+ columnNumber: 28
278
+ }, this) : state.reqState.isLoading ? slots.loading ? /*#__PURE__*/jsxDEV(slots.loading, {
279
+ state: state.reqState.loadingState
280
+ }, void 0, false, {
281
+ fileName: _jsxFileName,
282
+ lineNumber: 260,
283
+ columnNumber: 56
284
+ }, this) : '' : state.reqState.isCancelled && slots.cancelled ? /*#__PURE__*/jsxDEV(slots.cancelled, {
285
+ error: state.reqState.reason,
286
+ features: state.errorFeatures
287
+ }, void 0, false, {
288
+ fileName: _jsxFileName,
289
+ lineNumber: 261,
290
+ columnNumber: 61
291
+ }, this) : state.reqState.isError && slots.error ? /*#__PURE__*/jsxDEV(slots.error, {
292
+ error: state.reqState.reason,
293
+ features: state.errorFeatures
294
+ }, void 0, false, {
295
+ fileName: _jsxFileName,
296
+ lineNumber: 262,
297
+ columnNumber: 53
298
+ }, this) : state.reqState.isSuccess ? slots.content ? /*#__PURE__*/jsxDEV(slots.content, {
299
+ result: state.reqState.value,
300
+ features: state.contentFeatures
301
+ }, void 0, false, {
302
+ fileName: _jsxFileName,
303
+ lineNumber: 263,
304
+ columnNumber: 56
305
+ }, this) : /*#__PURE__*/jsxDEV(Throw, {
306
+ error: new Error('No content block provided for <Request> component.')
307
+ }, void 0, false, {
308
+ fileName: _jsxFileName,
309
+ lineNumber: 263,
310
+ columnNumber: 139
311
+ }, this) : !state.reqState.isCancelled ? /*#__PURE__*/jsxDEV(Throw, {
312
+ error: state.reqState.reason
313
+ }, void 0, false, {
314
+ fileName: _jsxFileName,
315
+ lineNumber: 264,
316
+ columnNumber: 43
317
+ }, this) : '' // never
318
+ }, void 0, false, {
319
+ fileName: _jsxFileName,
320
+ lineNumber: 255,
321
+ columnNumber: 5
322
+ }, this);
323
+ }
324
+ export { ReactiveContext, Request, StoreProvider, Throw, useStore };