@playfast/reform 0.0.4 → 0.0.7
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/boundary/boundary.d.ts +72 -0
- package/dist/boundary/boundary.d.ts.map +1 -0
- package/dist/boundary/boundary.js +83 -0
- package/dist/boundary/boundary.js.map +1 -0
- package/dist/calc/asyncCalc.d.ts +91 -0
- package/dist/calc/asyncCalc.d.ts.map +1 -0
- package/dist/calc/asyncCalc.js +95 -0
- package/dist/calc/asyncCalc.js.map +1 -0
- package/{src/calc/asyncData.ts → dist/calc/asyncData.d.ts} +22 -53
- package/dist/calc/asyncData.d.ts.map +1 -0
- package/dist/calc/asyncData.js +34 -0
- package/dist/calc/asyncData.js.map +1 -0
- package/dist/calc/calc.d.ts +57 -0
- package/dist/calc/calc.d.ts.map +1 -0
- package/dist/calc/calc.js +58 -0
- package/dist/calc/calc.js.map +1 -0
- package/dist/calc/calcFamily.d.ts +57 -0
- package/dist/calc/calcFamily.d.ts.map +1 -0
- package/dist/calc/calcFamily.js +124 -0
- package/dist/calc/calcFamily.js.map +1 -0
- package/dist/calc/compose.d.ts +16 -0
- package/dist/calc/compose.d.ts.map +1 -0
- package/dist/calc/compose.js +7 -0
- package/dist/calc/compose.js.map +1 -0
- package/dist/channel/channel.d.ts +115 -0
- package/dist/channel/channel.d.ts.map +1 -0
- package/dist/channel/channel.js +138 -0
- package/dist/channel/channel.js.map +1 -0
- package/dist/compose/composition.d.ts +72 -0
- package/dist/compose/composition.d.ts.map +1 -0
- package/dist/compose/composition.js +46 -0
- package/dist/compose/composition.js.map +1 -0
- package/{src/compose/host.ts → dist/compose/host.d.ts} +8 -6
- package/dist/compose/host.d.ts.map +1 -0
- package/dist/compose/host.js +6 -0
- package/dist/compose/host.js.map +1 -0
- package/dist/compose/props.d.ts +13 -0
- package/dist/compose/props.d.ts.map +1 -0
- package/{src/compose/props.ts → dist/compose/props.js} +5 -3
- package/dist/compose/props.js.map +1 -0
- package/dist/compose/provide.d.ts +22 -0
- package/dist/compose/provide.d.ts.map +1 -0
- package/dist/compose/provide.js +28 -0
- package/dist/compose/provide.js.map +1 -0
- package/{src/compose/slot.ts → dist/compose/slot.d.ts} +19 -36
- package/dist/compose/slot.d.ts.map +1 -0
- package/dist/compose/slot.js +23 -0
- package/dist/compose/slot.js.map +1 -0
- package/dist/compose/ui.d.ts +135 -0
- package/dist/compose/ui.d.ts.map +1 -0
- package/dist/compose/ui.js +63 -0
- package/dist/compose/ui.js.map +1 -0
- package/dist/definition/definition.d.ts +33 -0
- package/dist/definition/definition.d.ts.map +1 -0
- package/dist/definition/definition.js +42 -0
- package/dist/definition/definition.js.map +1 -0
- package/dist/event/event.d.ts +33 -0
- package/dist/event/event.d.ts.map +1 -0
- package/dist/event/event.js +30 -0
- package/dist/event/event.js.map +1 -0
- package/dist/event/eventGroup.d.ts +9 -0
- package/dist/event/eventGroup.d.ts.map +1 -0
- package/dist/event/eventGroup.js +4 -0
- package/dist/event/eventGroup.js.map +1 -0
- package/{src/feature/feature.ts → dist/feature/feature.d.ts} +92 -178
- package/dist/feature/feature.d.ts.map +1 -0
- package/dist/feature/feature.js +98 -0
- package/dist/feature/feature.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/{src/internal/capture.ts → dist/internal/capture.d.ts} +11 -13
- package/dist/internal/capture.d.ts.map +1 -0
- package/dist/internal/capture.js +12 -0
- package/dist/internal/capture.js.map +1 -0
- package/{src/internal/ctx.ts → dist/internal/ctx.d.ts} +4 -8
- package/dist/internal/ctx.d.ts.map +1 -0
- package/dist/internal/ctx.js +2 -0
- package/dist/internal/ctx.js.map +1 -0
- package/dist/internal/errors.d.ts +89 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +102 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/inspect.d.ts +17 -0
- package/dist/internal/inspect.d.ts.map +1 -0
- package/dist/internal/inspect.js +32 -0
- package/dist/internal/inspect.js.map +1 -0
- package/dist/internal/queryDriver.d.ts +65 -0
- package/dist/internal/queryDriver.d.ts.map +1 -0
- package/dist/internal/queryDriver.js +134 -0
- package/dist/internal/queryDriver.js.map +1 -0
- package/dist/internal/reuse.d.ts +10 -0
- package/dist/internal/reuse.d.ts.map +1 -0
- package/dist/internal/reuse.js +68 -0
- package/dist/internal/reuse.js.map +1 -0
- package/dist/internal/scheduler.d.ts +47 -0
- package/dist/internal/scheduler.d.ts.map +1 -0
- package/dist/internal/scheduler.js +70 -0
- package/dist/internal/scheduler.js.map +1 -0
- package/{src/internal/seeds.ts → dist/internal/seeds.d.ts} +3 -6
- package/dist/internal/seeds.d.ts.map +1 -0
- package/dist/internal/seeds.js +17 -0
- package/dist/internal/seeds.js.map +1 -0
- package/dist/internal/sources.d.ts +39 -0
- package/dist/internal/sources.d.ts.map +1 -0
- package/dist/internal/sources.js +59 -0
- package/dist/internal/sources.js.map +1 -0
- package/dist/internal/stateRegistry.d.ts +2 -0
- package/dist/internal/stateRegistry.d.ts.map +1 -0
- package/dist/internal/stateRegistry.js +28 -0
- package/dist/internal/stateRegistry.js.map +1 -0
- package/dist/internal/store.d.ts +47 -0
- package/dist/internal/store.d.ts.map +1 -0
- package/dist/internal/store.js +73 -0
- package/dist/internal/store.js.map +1 -0
- package/{src/internal/track.ts → dist/internal/track.d.ts} +11 -15
- package/dist/internal/track.d.ts.map +1 -0
- package/dist/internal/track.js +19 -0
- package/dist/internal/track.js.map +1 -0
- package/dist/procedure/procedure.d.ts +40 -0
- package/dist/procedure/procedure.d.ts.map +1 -0
- package/dist/procedure/procedure.js +50 -0
- package/dist/procedure/procedure.js.map +1 -0
- package/dist/reducer/reducer.d.ts +44 -0
- package/dist/reducer/reducer.d.ts.map +1 -0
- package/dist/reducer/reducer.js +63 -0
- package/dist/reducer/reducer.js.map +1 -0
- package/dist/remote/remoteState.d.ts +119 -0
- package/dist/remote/remoteState.d.ts.map +1 -0
- package/dist/remote/remoteState.js +270 -0
- package/dist/remote/remoteState.js.map +1 -0
- package/dist/runtime/bus.d.ts +27 -0
- package/dist/runtime/bus.d.ts.map +1 -0
- package/{src/runtime/bus.ts → dist/runtime/bus.js} +8 -23
- package/dist/runtime/bus.js.map +1 -0
- package/dist/runtime/loop.d.ts +45 -0
- package/dist/runtime/loop.d.ts.map +1 -0
- package/dist/runtime/loop.js +117 -0
- package/dist/runtime/loop.js.map +1 -0
- package/dist/scene/scene.d.ts +44 -0
- package/dist/scene/scene.d.ts.map +1 -0
- package/dist/scene/scene.js +31 -0
- package/dist/scene/scene.js.map +1 -0
- package/dist/state/state.d.ts +37 -0
- package/dist/state/state.d.ts.map +1 -0
- package/dist/state/state.js +46 -0
- package/dist/state/state.js.map +1 -0
- package/dist/state/stateFamily.d.ts +79 -0
- package/dist/state/stateFamily.d.ts.map +1 -0
- package/dist/state/stateFamily.js +99 -0
- package/dist/state/stateFamily.js.map +1 -0
- package/dist/state/stateGroup.d.ts +50 -0
- package/dist/state/stateGroup.d.ts.map +1 -0
- package/dist/state/stateGroup.js +54 -0
- package/dist/state/stateGroup.js.map +1 -0
- package/{src/state/token.ts → dist/state/token.d.ts} +13 -21
- package/dist/state/token.d.ts.map +1 -0
- package/dist/state/token.js +20 -0
- package/dist/state/token.js.map +1 -0
- package/dist/synced/syncedStore.d.ts +51 -0
- package/dist/synced/syncedStore.d.ts.map +1 -0
- package/dist/synced/syncedStore.js +43 -0
- package/dist/synced/syncedStore.js.map +1 -0
- package/{src/ui/node.ts → dist/ui/node.d.ts} +3 -3
- package/dist/ui/node.d.ts.map +1 -0
- package/dist/ui/node.js +2 -0
- package/dist/ui/node.js.map +1 -0
- package/{src/ui/trigger.ts → dist/ui/trigger.d.ts} +2 -1
- package/dist/ui/trigger.d.ts.map +1 -0
- package/dist/ui/trigger.js +2 -0
- package/dist/ui/trigger.js.map +1 -0
- package/dist/wire/tree.d.ts +66 -0
- package/dist/wire/tree.d.ts.map +1 -0
- package/dist/wire/tree.js +60 -0
- package/dist/wire/tree.js.map +1 -0
- package/dist/wire/triggers.d.ts +44 -0
- package/dist/wire/triggers.d.ts.map +1 -0
- package/dist/wire/triggers.js +31 -0
- package/dist/wire/triggers.js.map +1 -0
- package/package.json +32 -11
- package/src/boundary/boundary.ts +0 -192
- package/src/calc/asyncCalc.ts +0 -267
- package/src/calc/calc.ts +0 -120
- package/src/calc/calcFamily.ts +0 -194
- package/src/calc/compose.ts +0 -69
- package/src/channel/channel.ts +0 -265
- package/src/compose/composition.ts +0 -112
- package/src/compose/provide.ts +0 -70
- package/src/compose/ui.ts +0 -97
- package/src/definition/definition.ts +0 -74
- package/src/event/event.ts +0 -65
- package/src/event/eventGroup.ts +0 -14
- package/src/index.ts +0 -140
- package/src/internal/errors.ts +0 -69
- package/src/internal/inspect.ts +0 -34
- package/src/internal/queryDriver.ts +0 -247
- package/src/internal/reuse.ts +0 -73
- package/src/internal/scheduler.ts +0 -91
- package/src/internal/sources.ts +0 -104
- package/src/internal/store.ts +0 -105
- package/src/procedure/procedure.ts +0 -89
- package/src/reducer/reducer.ts +0 -137
- package/src/remote/remoteState.ts +0 -571
- package/src/runtime/loop.ts +0 -169
- package/src/scene/scene.ts +0 -76
- package/src/state/state.ts +0 -91
- package/src/state/stateFamily.ts +0 -171
- package/src/state/stateGroup.ts +0 -78
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Effect, Layer } from 'effect';
|
|
2
|
+
import {} from '../runtime/loop';
|
|
3
|
+
import {} from '../internal/sources';
|
|
4
|
+
import { FeatureLoadFailed } from '../internal/errors';
|
|
5
|
+
import { definitionClass } from '../definition/definition';
|
|
6
|
+
import {} from '../compose/composition';
|
|
7
|
+
import {} from '../compose/ui';
|
|
8
|
+
import { publish } from '../runtime/bus';
|
|
9
|
+
/**
|
|
10
|
+
* Publish a feature's lazy half: pair its `requires` (a runtime tuple of shared
|
|
11
|
+
* carriers) with its `layer`. The covariant `RIn` bound does the checking — a
|
|
12
|
+
* layer that reaches for any service outside `EngineServices | ProvidedBy<requires>`
|
|
13
|
+
* is not assignable, so it fails to compile right here, next to the layer, with no
|
|
14
|
+
* cast. Listing an unused carrier is harmless; omitting a needed one is a type error.
|
|
15
|
+
*
|
|
16
|
+
* The bound also forbids a feature from *providing* `EngineServices` (they may only
|
|
17
|
+
* be open `RIn`), structurally enforcing the liveness rule: a feature can never
|
|
18
|
+
* bundle its own engine — it always shares the root's bus and registries.
|
|
19
|
+
*/
|
|
20
|
+
export const featureModule = (requires, layer) => ({ requires, layer });
|
|
21
|
+
/**
|
|
22
|
+
* Wrap a dynamic `import()` of a feature's `.live` module as an `Effect` — Reform
|
|
23
|
+
* never exposes a Promise/`await` on the feature surface. The unavoidable thenable
|
|
24
|
+
* is sealed here; a rejected import (missing chunk, network failure, module-eval
|
|
25
|
+
* throw) surfaces as a typed `FeatureLoadFailed` the host hands to
|
|
26
|
+
* `placeholder.failed`. The module's default export is its `FeatureModule`.
|
|
27
|
+
*/
|
|
28
|
+
export const lazyImport = (thunk) => Effect.tryPromise({
|
|
29
|
+
try: thunk,
|
|
30
|
+
catch: (cause) => new FeatureLoadFailed({ cause }),
|
|
31
|
+
}).pipe(Effect.map((module) => module.default));
|
|
32
|
+
/** Nominal brand identifying the value a `provide(slot, Feature)` puts under a slot tag. */
|
|
33
|
+
export const FeatureBindingTypeId = Symbol.for('reform/FeatureBinding');
|
|
34
|
+
/** Whether a slot's bound child is a lazy/eager feature (vs a plain composition). */
|
|
35
|
+
export const isFeatureBinding = (u) => typeof u === 'object' && u !== null && FeatureBindingTypeId in u;
|
|
36
|
+
/** Whether a value is a feature definition (its target shape in `provide(slot, Feature)`). */
|
|
37
|
+
export const isFeature = (u) => (typeof u === 'function' || typeof u === 'object') &&
|
|
38
|
+
u !== null &&
|
|
39
|
+
'manifest' in u &&
|
|
40
|
+
u.manifest?.kind === 'Feature';
|
|
41
|
+
/**
|
|
42
|
+
* Define a feature. The whole-app shape (this manifest, the composition, the
|
|
43
|
+
* placeholders) stays eager and reflectable; the `.live` layer in `module`/`load`
|
|
44
|
+
* is the deferred chunk. Flip `loadingStrategy` from `'default'` to `'lazy'` and
|
|
45
|
+
* the discriminated config *requires* `placeholder` — the compiler walks you to a
|
|
46
|
+
* complete code-split feature.
|
|
47
|
+
*/
|
|
48
|
+
export const make = (name, config) => {
|
|
49
|
+
const strategy = config.loadingStrategy ?? 'default';
|
|
50
|
+
const load = 'load' in config ? config.load : Effect.succeed(config.module);
|
|
51
|
+
const eagerModule = 'module' in config ? config.module : undefined;
|
|
52
|
+
const placeholder = 'placeholder' in config ? config.placeholder : undefined;
|
|
53
|
+
const manifest = {
|
|
54
|
+
kind: 'Feature',
|
|
55
|
+
name,
|
|
56
|
+
strategy,
|
|
57
|
+
composition: config.composition.manifest,
|
|
58
|
+
...(placeholder
|
|
59
|
+
? { placeholder: { loading: placeholder.loading.manifest, failed: placeholder.failed.manifest } }
|
|
60
|
+
: {}),
|
|
61
|
+
};
|
|
62
|
+
const binding = {
|
|
63
|
+
[FeatureBindingTypeId]: FeatureBindingTypeId,
|
|
64
|
+
manifest,
|
|
65
|
+
composition: config.composition,
|
|
66
|
+
strategy,
|
|
67
|
+
// The host is strategy-uniform: `default`'s `load` resolves immediately. The
|
|
68
|
+
// assignment to the erased `LoadedModule` needs no cast — see `LoadedModule`.
|
|
69
|
+
load,
|
|
70
|
+
...(placeholder ? { placeholder: { loading: placeholder.loading, failed: placeholder.failed } } : {}),
|
|
71
|
+
boot: config.boot ?? [],
|
|
72
|
+
};
|
|
73
|
+
return definitionClass({ manifest, load, binding, eagerModule });
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Mount a feature against a live engine. The renderer-neutral lifecycle, run on a
|
|
77
|
+
* per-feature `Scope`: load the module (an Effect — lazy = dynamic import; default
|
|
78
|
+
* = immediate), build its `.live` layer against the host's live `engineContext`
|
|
79
|
+
* (so its reducers/procedures register into the SHARED registries and its fibers
|
|
80
|
+
* fork onto this scope), then dispatch the feature's `boot`. Returns the merged
|
|
81
|
+
* context — engine services + the feature's own services — for the host to read
|
|
82
|
+
* the feature's composition and stores. Closing the scope disposes exactly this
|
|
83
|
+
* feature: its fibers stop and its stores are reclaimed.
|
|
84
|
+
*
|
|
85
|
+
* The single boundary cast (mirroring `buildRuntime`): `module.layer` is erased to
|
|
86
|
+
* `LoadedModule` so the host stays strategy- and type-uniform. The feature's real
|
|
87
|
+
* `RIn` was verified cast-free at `provide(slot, Feature)` and scene wiring; here
|
|
88
|
+
* we re-attach the concrete `engineContext` it builds against. `R` is the engine
|
|
89
|
+
* context's service set, supplied by the host.
|
|
90
|
+
*/
|
|
91
|
+
export const mountFeature = (binding, engineContext) => Effect.gen(function* () {
|
|
92
|
+
const { layer } = yield* binding.load;
|
|
93
|
+
const featureLayer = layer;
|
|
94
|
+
const context = yield* Layer.build(Layer.provideMerge(featureLayer, Layer.succeedContext(engineContext)));
|
|
95
|
+
yield* Effect.forEach(binding.boot, (event) => publish('High', event), { discard: true }).pipe(Effect.provide(context));
|
|
96
|
+
return context;
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../src/feature/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,KAAK,EAAc,MAAM,QAAQ,CAAA;AAChE,OAAO,EAAe,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAiB,eAAe,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAyB,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAmB,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAe,MAAM,gBAAgB,CAAA;AA6DrD;;;;;;;;;;GAUG;AACH,MAAM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AC3E,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAA;IACrC,MAAM,YAAY,GAAG,KAAuC,CAAA;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAChC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CACtE,CAAA;IACD,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAC5F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CACxB,CAAA;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export * as State from './state/state';
|
|
2
|
+
export * as StateGroup from './state/stateGroup';
|
|
3
|
+
export * as StateFamily from './state/stateFamily';
|
|
4
|
+
export { StateToken } from './state/token';
|
|
5
|
+
export type { AnySource, Source } from './state/token';
|
|
6
|
+
export * as Event from './event/event';
|
|
7
|
+
export type { EventOf } from './event/event';
|
|
8
|
+
export * as EventGroup from './event/eventGroup';
|
|
9
|
+
export * as Reducer from './reducer/reducer';
|
|
10
|
+
export * as Calc from './calc/calc';
|
|
11
|
+
export * as CalcFamily from './calc/calcFamily';
|
|
12
|
+
export * as AsyncCalc from './calc/asyncCalc';
|
|
13
|
+
export { composeCalcs } from './calc/compose';
|
|
14
|
+
export type { InputsObject, InputStores, InvalidateBy } from './internal/sources';
|
|
15
|
+
export { AsyncData, type AsyncError, type AsyncIdle, type AsyncLoading, type AsyncSuccess, } from './calc/asyncData';
|
|
16
|
+
export * as RemoteState from './remote/remoteState';
|
|
17
|
+
export type { FailedIntent, PendingIntent, RemoteStateClass } from './remote/remoteState';
|
|
18
|
+
export * as SyncedStore from './synced/syncedStore';
|
|
19
|
+
export type { SyncedSource, SyncedStoreClass } from './synced/syncedStore';
|
|
20
|
+
export * as Boundary from './boundary/boundary';
|
|
21
|
+
export type { BoundaryErrored, BoundaryPending, BoundaryReady, BoundaryState, } from './boundary/boundary';
|
|
22
|
+
export * as Procedure from './procedure/procedure';
|
|
23
|
+
export * as Channel from './channel/channel';
|
|
24
|
+
export * as Composition from './compose/composition';
|
|
25
|
+
export type { CompositionClass, CompositionService, RenderEnv, } from './compose/composition';
|
|
26
|
+
export { Props } from './compose/props';
|
|
27
|
+
export { isSlot, type Node, slot, type SlotClass, type SlotInstance, type SlotProps, SlotTypeId, } from './compose/slot';
|
|
28
|
+
export { CurrentSlots, type SlotHost } from './compose/host';
|
|
29
|
+
export * as Ui from './compose/ui';
|
|
30
|
+
export { type DerivedContract, isUi, type LogicView, type MadeView, ui, type UiClass, type UiContract, type UiManifest, UiTypeId, UiViewContract, type ViewImpl, type WireSchemas, type WiredUi, type WiredUiManifest, } from './compose/ui';
|
|
31
|
+
export { provide } from './compose/provide';
|
|
32
|
+
export type { Trigger } from './ui/trigger';
|
|
33
|
+
export * as Wire from './wire/tree';
|
|
34
|
+
export type { WireNode, WirePatch, WireProp, WireTree } from './wire/tree';
|
|
35
|
+
export * as Triggers from './wire/triggers';
|
|
36
|
+
export { TriggerRegistry, type TriggerHandle, type TriggerRegistryApi, UnknownTrigger, } from './wire/triggers';
|
|
37
|
+
export * as Feature from './feature/feature';
|
|
38
|
+
export { type EngineServices, type FailedProps, type FeatureBinding, FeatureBindingTypeId, type FeatureClass, type FeatureManifest, featureModule, type FeatureModule, isFeature, isFeatureBinding, lazyImport, type LoadedModule, mountFeature, type Placeholders, type ProvidedBy, type RequireCarrier, } from './feature/feature';
|
|
39
|
+
export { type SlotChild } from './compose/slot';
|
|
40
|
+
export { isScene, type MountedServices, type Scene, scene, seedScene } from './scene/scene';
|
|
41
|
+
export { Bus, type Envelope, type Priority, publish, type Tagged } from './runtime/bus';
|
|
42
|
+
export { Engine, type ReducerEntry, Reducers } from './runtime/loop';
|
|
43
|
+
export { type ChannelClass, type ChannelPolicy, type ChannelRuntime, Channels, type ProcedureEntry, Procedures, } from './channel/channel';
|
|
44
|
+
export { CurrentTracker, type Subscribable, type Tracker } from './internal/track';
|
|
45
|
+
export { CaptureSink, type CaptureSinkApi, type UiCapture } from './internal/capture';
|
|
46
|
+
export { AsyncReducer, AsyncSceneLayer, DuplicateRegistration, FeatureLoadFailed, forceSync, InvalidProvideTarget, SlotRenderingUnavailable, UnknownGroupState, } from './internal/errors';
|
|
47
|
+
export { defaultScheduler, makeScheduler, Notifications, notificationsLayer, resolveScheduler, type Scheduler, } from './internal/scheduler';
|
|
48
|
+
export { makeStore, type Store } from './internal/store';
|
|
49
|
+
export type { FamilyStore } from './state/stateFamily';
|
|
50
|
+
export { type Kind, type Manifest, yieldableClass } from './definition/definition';
|
|
51
|
+
export { readTracked } from './internal/track';
|
|
52
|
+
export { sameKey, wireSources, type WiredSources } from './internal/sources';
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAItC,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAA;A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,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AACvF,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,cAAc,EACnB,UAAU,GACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,SAAS,GACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAKtD,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Reform core — the renderer-neutral primitives and runtime.
|
|
2
|
+
// Definitions (`X.make`) are separate from implementations (`.live`)
|
|
3
|
+
// throughout, and nothing self-registers on import (principle #1, #6).
|
|
4
|
+
export * as State from './state/state';
|
|
5
|
+
export * as StateGroup from './state/stateGroup';
|
|
6
|
+
export * as StateFamily from './state/stateFamily';
|
|
7
|
+
export { StateToken } from './state/token';
|
|
8
|
+
export * as Event from './event/event';
|
|
9
|
+
export * as EventGroup from './event/eventGroup';
|
|
10
|
+
export * as Reducer from './reducer/reducer';
|
|
11
|
+
export * as Calc from './calc/calc';
|
|
12
|
+
export * as CalcFamily from './calc/calcFamily';
|
|
13
|
+
export * as AsyncCalc from './calc/asyncCalc';
|
|
14
|
+
export { composeCalcs } from './calc/compose';
|
|
15
|
+
export { AsyncData, } from './calc/asyncData';
|
|
16
|
+
export * as RemoteState from './remote/remoteState';
|
|
17
|
+
export * as SyncedStore from './synced/syncedStore';
|
|
18
|
+
export * as Boundary from './boundary/boundary';
|
|
19
|
+
export * as Procedure from './procedure/procedure';
|
|
20
|
+
export * as Channel from './channel/channel';
|
|
21
|
+
export * as Composition from './compose/composition';
|
|
22
|
+
export { Props } from './compose/props';
|
|
23
|
+
export { isSlot, slot, SlotTypeId, } from './compose/slot';
|
|
24
|
+
export { CurrentSlots } from './compose/host';
|
|
25
|
+
export * as Ui from './compose/ui';
|
|
26
|
+
export { isUi, ui, UiTypeId, UiViewContract, } from './compose/ui';
|
|
27
|
+
export { provide } from './compose/provide';
|
|
28
|
+
// Wire: the serializable rendered-tree model + pure diff/apply the remote
|
|
29
|
+
// transport sends over the wire and the client folds back. See REMOTE_UI.md §3.
|
|
30
|
+
export * as Wire from './wire/tree';
|
|
31
|
+
// Triggers: the server-side handle registry bridging client trigger invocations
|
|
32
|
+
// back to live triggers, decoding payloads via the event schema. See REMOTE_UI.md §4.
|
|
33
|
+
export * as Triggers from './wire/triggers';
|
|
34
|
+
export { TriggerRegistry, UnknownTrigger, } from './wire/triggers';
|
|
35
|
+
// Feature: the lazy/eager code-split unit. Definitions stay eager and reflectable;
|
|
36
|
+
// the heavy `.live` layer loads on demand (an Effect, never a Promise). See LAZY.md.
|
|
37
|
+
export * as Feature from './feature/feature';
|
|
38
|
+
export { FeatureBindingTypeId, featureModule, isFeature, isFeatureBinding, lazyImport, mountFeature, } from './feature/feature';
|
|
39
|
+
export {} from './compose/slot';
|
|
40
|
+
// A scene bundles a composition with the closed wiring that runs it — the single
|
|
41
|
+
// handle the react host, proofs, and the dev tool all consume.
|
|
42
|
+
export { isScene, scene, seedScene } from './scene/scene';
|
|
43
|
+
// Runtime surface for hosts (`@reform/react`) and headless tests.
|
|
44
|
+
export { Bus, publish } from './runtime/bus';
|
|
45
|
+
export { Engine, Reducers } from './runtime/loop';
|
|
46
|
+
export { Channels, Procedures, } from './channel/channel';
|
|
47
|
+
export { CurrentTracker } from './internal/track';
|
|
48
|
+
export { CaptureSink } from './internal/capture';
|
|
49
|
+
export { AsyncReducer, AsyncSceneLayer, DuplicateRegistration, FeatureLoadFailed, forceSync, InvalidProvideTarget, SlotRenderingUnavailable, UnknownGroupState, } from './internal/errors';
|
|
50
|
+
// Notification scheduler: hosts that need per-runtime isolation (concurrent SSR,
|
|
51
|
+
// multiple mounted roots) provide `Notifications` upstream of their state layers;
|
|
52
|
+
// everything else coalesces on the process-wide default.
|
|
53
|
+
export { defaultScheduler, makeScheduler, Notifications, notificationsLayer, resolveScheduler, } from './internal/scheduler';
|
|
54
|
+
export { makeStore } from './internal/store';
|
|
55
|
+
// Primitive-authoring toolkit — exported for first-party companion packages
|
|
56
|
+
// (e.g. `@playfast/reform-db`, `@playfast/reform-resource`) that build their own
|
|
57
|
+
// first-class `Source`s which must participate in dependency tracking and
|
|
58
|
+
// reflection exactly like a `Calc`.
|
|
59
|
+
export { yieldableClass } from './definition/definition';
|
|
60
|
+
export { readTracked } from './internal/track';
|
|
61
|
+
export { sameKey, wireSources } from './internal/sources';
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[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,0EAA0E;AAC1E,oCAAoC;AACpC,OAAO,EAA4B,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAqB,MAAM,oBAAoB,CAAA"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { Context } from 'effect'
|
|
2
|
-
import type { Trigger } from '../ui/trigger'
|
|
3
|
-
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import type { Trigger } from '../ui/trigger';
|
|
4
3
|
/**
|
|
5
4
|
* A single rendered UI node's observable surface: which contract rendered, the
|
|
6
5
|
* props it received, and the event triggers it was handed. This is exactly what
|
|
7
6
|
* a headless inspector (the proof facade, the dev tool) needs — no DOM, no JSX.
|
|
8
7
|
*/
|
|
9
8
|
export interface UiCapture {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly props: unknown;
|
|
11
|
+
readonly events: Record<string, Trigger<unknown>>;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
/** Where captured renders are reported, when a capturing host is present. */
|
|
16
14
|
export interface CaptureSinkApi {
|
|
17
|
-
|
|
15
|
+
record(capture: UiCapture): void;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
/**
|
|
21
18
|
* An OPTIONAL service. Core's `ui` read consults it via `serviceOption`: when a
|
|
22
19
|
* capturing host provides it (proofs, the dev tool), every resolved view reports
|
|
@@ -24,7 +21,8 @@ export interface CaptureSinkApi {
|
|
|
24
21
|
* replacing any presentation. Production never provides it, so nothing is
|
|
25
22
|
* recorded and there is no cost beyond one `serviceOption` lookup per render.
|
|
26
23
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
declare const CaptureSinkBase: Context.TagClass<CaptureSink, 'reform/internal/CaptureSink', CaptureSinkApi>;
|
|
25
|
+
export declare class CaptureSink extends CaptureSinkBase {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/internal/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;CAClD;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;CACjC;AAED;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,6BAA6B,EAAE,cAAc,CACvB,CAAA;AAE3E,qBAAa,WAAY,SAAQ,eAAe;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
/**
|
|
3
|
+
* An OPTIONAL service. Core's `ui` read consults it via `serviceOption`: when a
|
|
4
|
+
* capturing host provides it (proofs, the dev tool), every resolved view reports
|
|
5
|
+
* its `(props, events)` before rendering, giving a faithful tree without
|
|
6
|
+
* replacing any presentation. Production never provides it, so nothing is
|
|
7
|
+
* recorded and there is no cost beyond one `serviceOption` lookup per render.
|
|
8
|
+
*/
|
|
9
|
+
const CaptureSinkBase = Context.Tag('reform/internal/CaptureSink')();
|
|
10
|
+
export class CaptureSink extends CaptureSinkBase {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=capture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/internal/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAmBhC;;;;;;GAMG;AACH,MAAM,eAAe,GACnB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,EAA+B,CAAA;AAE3E,MAAM,OAAO,WAAY,SAAQ,eAAe;CAAG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Effect } from 'effect'
|
|
2
|
-
import type { YieldWrap } from 'effect/Utils'
|
|
3
|
-
|
|
1
|
+
import type { Effect } from 'effect';
|
|
2
|
+
import type { YieldWrap } from 'effect/Utils';
|
|
4
3
|
/**
|
|
5
4
|
* The context (`R`) a generator body requires, recovered from the effects it
|
|
6
5
|
* yields. Shared by `Composition.live` and `Procedure.live`, whose bodies are
|
|
@@ -9,8 +8,5 @@ import type { YieldWrap } from 'effect/Utils'
|
|
|
9
8
|
* A body that never yields (`Eff = never`) requires nothing — guard that case
|
|
10
9
|
* first, or `infer R` resolves to `unknown` and leaks into the layer's `RIn`.
|
|
11
10
|
*/
|
|
12
|
-
export type Ctx<Eff> = [Eff] extends [never]
|
|
13
|
-
|
|
14
|
-
: [Eff] extends [YieldWrap<Effect.Effect<any, any, infer R>>]
|
|
15
|
-
? R
|
|
16
|
-
: never
|
|
11
|
+
export type Ctx<Eff> = [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<any, any, infer R>>] ? R : never;
|
|
12
|
+
//# sourceMappingURL=ctx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctx.d.ts","sourceRoot":"","sources":["../../src/internal/ctx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GACxC,KAAK,GACL,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GACzD,CAAC,GACD,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctx.js","sourceRoot":"","sources":["../../src/internal/ctx.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Cause } from 'effect';
|
|
2
|
+
/**
|
|
3
|
+
* Tagged errors for the framework's synchronous boundaries. Even when thrown
|
|
4
|
+
* (React render, layer build, reflection), an error carries a `_tag` and its
|
|
5
|
+
* structured fields — never a bare `Error` — so callers and tooling can match on
|
|
6
|
+
* it. `Data.TaggedError` subclasses are real `Error`s, so `throw` still works.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The constructor shape `Data.TaggedError(tag)<A>` produces, named so the
|
|
10
|
+
* generated `.d.ts` can describe the `extends` base under `isolatedDeclarations`
|
|
11
|
+
* (which forbids an inferred expression in an extends clause).
|
|
12
|
+
*/
|
|
13
|
+
type TaggedErrorClass<Tag extends string, A extends Record<string, unknown>> = new (args: A) => Cause.YieldableError & {
|
|
14
|
+
readonly _tag: Tag;
|
|
15
|
+
} & Readonly<A>;
|
|
16
|
+
/** The fieldless variant — a `Data.TaggedError(tag)<{}>` constructor. */
|
|
17
|
+
type EmptyTaggedErrorClass<Tag extends string> = new () => Cause.YieldableError & {
|
|
18
|
+
readonly _tag: Tag;
|
|
19
|
+
};
|
|
20
|
+
declare const SlotRenderingUnavailableBase: TaggedErrorClass<'reform/SlotRenderingUnavailable', {
|
|
21
|
+
readonly slot: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** A `<slots.X/>` was rendered without a render-target host to realize it. */
|
|
24
|
+
export declare class SlotRenderingUnavailable extends SlotRenderingUnavailableBase {
|
|
25
|
+
get message(): string;
|
|
26
|
+
}
|
|
27
|
+
declare const InvalidProvideTargetBase: EmptyTaggedErrorClass<'reform/InvalidProvideTarget'>;
|
|
28
|
+
/** `provide(target, …)` was handed something that is neither a ui contract nor a slot. */
|
|
29
|
+
export declare class InvalidProvideTarget extends InvalidProvideTargetBase {
|
|
30
|
+
get message(): string;
|
|
31
|
+
}
|
|
32
|
+
declare const UnknownGroupStateBase: TaggedErrorClass<'reform/UnknownGroupState', {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
}>;
|
|
35
|
+
/** `StateGroup.select(group, name)` named a state the group does not contain. */
|
|
36
|
+
export declare class UnknownGroupState extends UnknownGroupStateBase {
|
|
37
|
+
get message(): string;
|
|
38
|
+
}
|
|
39
|
+
declare const FeatureLoadFailedBase: TaggedErrorClass<'reform/FeatureLoadFailed', {
|
|
40
|
+
readonly cause: unknown;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* A lazy `Feature`'s `load` Effect failed — the dynamic `import()` rejected (a
|
|
44
|
+
* missing chunk, a network failure, a module-eval throw). Surfaced as a typed
|
|
45
|
+
* failure the host hands to the feature's `placeholder.failed`, never a bare
|
|
46
|
+
* rejection. `cause` is the original rejection value.
|
|
47
|
+
*/
|
|
48
|
+
export declare class FeatureLoadFailed extends FeatureLoadFailedBase {
|
|
49
|
+
get message(): string;
|
|
50
|
+
}
|
|
51
|
+
declare const AsyncReducerBase: EmptyTaggedErrorClass<'reform/AsyncReducer'>;
|
|
52
|
+
/** A reducer fold returned a thenable — folds must be pure synchronous writes. */
|
|
53
|
+
export declare class AsyncReducer extends AsyncReducerBase {
|
|
54
|
+
get message(): string;
|
|
55
|
+
}
|
|
56
|
+
declare const AsyncSceneLayerBase: EmptyTaggedErrorClass<'reform/AsyncSceneLayer'>;
|
|
57
|
+
/**
|
|
58
|
+
* A scene layer performed async work during reform's synchronous layer build.
|
|
59
|
+
* Reform materialises a scene's layer graph with `runSync` so the first frame
|
|
60
|
+
* renders synchronously (D2); a `Layer.effect`/`scoped` whose acquire suspends
|
|
61
|
+
* (HTTP, opening a DB, `Effect.sleep`) makes that `runSync` throw Effect's opaque
|
|
62
|
+
* `AsyncFiberException`. `forceSync` catches it and rethrows this, which names the
|
|
63
|
+
* cause and the sanctioned fix instead of pointing at Effect internals.
|
|
64
|
+
*/
|
|
65
|
+
export declare class AsyncSceneLayer extends AsyncSceneLayerBase {
|
|
66
|
+
get message(): string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Run a synchronous runtime read (the scene layer build / context capture) and
|
|
70
|
+
* translate Effect's async-fiber defect into `AsyncSceneLayer`; any other throw
|
|
71
|
+
* passes through unchanged. The single home for the sync-build boundary, shared by
|
|
72
|
+
* the React host and the remote server.
|
|
73
|
+
*/
|
|
74
|
+
export declare const forceSync: <A>(thunk: () => A) => A;
|
|
75
|
+
declare const DuplicateRegistrationBase: TaggedErrorClass<'reform/DuplicateRegistration', {
|
|
76
|
+
readonly kind: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Two distinct primitives were registered under one name into the same runtime —
|
|
81
|
+
* a silent footgun, since names key DI tags and channel lanes. Thrown for a
|
|
82
|
+
* channel name reused with a different policy (the second would otherwise be
|
|
83
|
+
* dropped). Reducer/procedure name clashes are warned (logged), not thrown.
|
|
84
|
+
*/
|
|
85
|
+
export declare class DuplicateRegistration extends DuplicateRegistrationBase {
|
|
86
|
+
get message(): string;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/internal/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAyB,MAAM,QAAQ,CAAA;AAErD;;;;;GAKG;AAEH;;;;GAIG;AACH,KAAK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EAAE,qBAAqB,CAAC,qBAAqB,CACtB,CAAA;AAE7C,kFAAkF;AAClF,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED,QAAA,MAAM,mBAAmB,EAAE,qBAAqB,CAAC,wBAAwB,CACzB,CAAA;AAEhD;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD,IAAa,OAAO,IAAI,MAAM,CAQ7B;CACF;AAeD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,MAAM,CAAC,KAAG,CAO7C,CAAA;AAED,QAAA,MAAM,yBAAyB,EAAE,gBAAgB,CAC/C,8BAA8B,EAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CACoD,CAAA;AAEtG;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,yBAAyB;IAClE,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Cause, Data, Option, Runtime } from 'effect';
|
|
2
|
+
const SlotRenderingUnavailableBase = (Data.TaggedError('reform/SlotRenderingUnavailable'));
|
|
3
|
+
/** A `<slots.X/>` was rendered without a render-target host to realize it. */
|
|
4
|
+
export class SlotRenderingUnavailable extends SlotRenderingUnavailableBase {
|
|
5
|
+
get message() {
|
|
6
|
+
return `reform: rendering slot '${this.slot}' requires @reform/react`;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
const InvalidProvideTargetBase = (Data.TaggedError('reform/InvalidProvideTarget'));
|
|
10
|
+
/** `provide(target, …)` was handed something that is neither a ui contract nor a slot. */
|
|
11
|
+
export class InvalidProvideTarget extends InvalidProvideTargetBase {
|
|
12
|
+
get message() {
|
|
13
|
+
return 'reform: provide target is neither a ui contract nor a slot';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const UnknownGroupStateBase = (Data.TaggedError('reform/UnknownGroupState'));
|
|
17
|
+
/** `StateGroup.select(group, name)` named a state the group does not contain. */
|
|
18
|
+
export class UnknownGroupState extends UnknownGroupStateBase {
|
|
19
|
+
get message() {
|
|
20
|
+
return `reform: unknown state '${this.name}' in group`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const FeatureLoadFailedBase = (Data.TaggedError('reform/FeatureLoadFailed'));
|
|
24
|
+
/**
|
|
25
|
+
* A lazy `Feature`'s `load` Effect failed — the dynamic `import()` rejected (a
|
|
26
|
+
* missing chunk, a network failure, a module-eval throw). Surfaced as a typed
|
|
27
|
+
* failure the host hands to the feature's `placeholder.failed`, never a bare
|
|
28
|
+
* rejection. `cause` is the original rejection value.
|
|
29
|
+
*/
|
|
30
|
+
export class FeatureLoadFailed extends FeatureLoadFailedBase {
|
|
31
|
+
get message() {
|
|
32
|
+
return `reform: a feature failed to load (${String(this.cause)})`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const AsyncReducerBase = (Data.TaggedError('reform/AsyncReducer'));
|
|
36
|
+
/** A reducer fold returned a thenable — folds must be pure synchronous writes. */
|
|
37
|
+
export class AsyncReducer extends AsyncReducerBase {
|
|
38
|
+
get message() {
|
|
39
|
+
return 'reform: a reducer fold must be synchronous (it returned a Promise)';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const AsyncSceneLayerBase = (Data.TaggedError('reform/AsyncSceneLayer'));
|
|
43
|
+
/**
|
|
44
|
+
* A scene layer performed async work during reform's synchronous layer build.
|
|
45
|
+
* Reform materialises a scene's layer graph with `runSync` so the first frame
|
|
46
|
+
* renders synchronously (D2); a `Layer.effect`/`scoped` whose acquire suspends
|
|
47
|
+
* (HTTP, opening a DB, `Effect.sleep`) makes that `runSync` throw Effect's opaque
|
|
48
|
+
* `AsyncFiberException`. `forceSync` catches it and rethrows this, which names the
|
|
49
|
+
* cause and the sanctioned fix instead of pointing at Effect internals.
|
|
50
|
+
*/
|
|
51
|
+
export class AsyncSceneLayer extends AsyncSceneLayerBase {
|
|
52
|
+
get message() {
|
|
53
|
+
return ('reform: a scene layer performed async work while building. Reform builds the ' +
|
|
54
|
+
'scene synchronously so the first frame can render — a layer acquire must be ' +
|
|
55
|
+
'synchronous (Layer.sync/Layer.succeed). For async setup (open a connection, ' +
|
|
56
|
+
'fetch config), use Resource.live from @playfast/reform-resource, which builds ' +
|
|
57
|
+
'synchronously and resolves in the background.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether a thrown value is Effect's "ran async under runSync" defect. `runSync`
|
|
62
|
+
* throws the bare `AsyncFiberException`; a `ManagedRuntime.runSync` whose layer
|
|
63
|
+
* build suspends instead throws a `FiberFailure` carrying it as a `Die`, so both
|
|
64
|
+
* shapes are checked.
|
|
65
|
+
*/
|
|
66
|
+
const isAsyncBuildDefect = (error) => {
|
|
67
|
+
if (Runtime.isAsyncFiberException(error))
|
|
68
|
+
return true;
|
|
69
|
+
if (!Runtime.isFiberFailure(error))
|
|
70
|
+
return false;
|
|
71
|
+
const die = Cause.dieOption(error[Runtime.FiberFailureCauseId]);
|
|
72
|
+
return Option.isSome(die) && Runtime.isAsyncFiberException(die.value);
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Run a synchronous runtime read (the scene layer build / context capture) and
|
|
76
|
+
* translate Effect's async-fiber defect into `AsyncSceneLayer`; any other throw
|
|
77
|
+
* passes through unchanged. The single home for the sync-build boundary, shared by
|
|
78
|
+
* the React host and the remote server.
|
|
79
|
+
*/
|
|
80
|
+
export const forceSync = (thunk) => {
|
|
81
|
+
try {
|
|
82
|
+
return thunk();
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (isAsyncBuildDefect(error))
|
|
86
|
+
throw new AsyncSceneLayer();
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const DuplicateRegistrationBase = (Data.TaggedError('reform/DuplicateRegistration'));
|
|
91
|
+
/**
|
|
92
|
+
* Two distinct primitives were registered under one name into the same runtime —
|
|
93
|
+
* a silent footgun, since names key DI tags and channel lanes. Thrown for a
|
|
94
|
+
* channel name reused with a different policy (the second would otherwise be
|
|
95
|
+
* dropped). Reducer/procedure name clashes are warned (logged), not thrown.
|
|
96
|
+
*/
|
|
97
|
+
export class DuplicateRegistration extends DuplicateRegistrationBase {
|
|
98
|
+
get message() {
|
|
99
|
+
return `reform: duplicate ${this.kind} registered under name '${this.name}'`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/internal/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAqBrD,MAAM,4BAA4B,GAG9B,CAAA,IAAI,CAAC,WAAW,CAAC,iCAAiC,CAA4B,CAAA,CAAA;AAElF,8EAA8E;AAC9E,MAAM,OAAO,wBAAyB,SAAQ,4BAA4B;IACxE,IAAa,OAAO;QAClB,OAAO,2BAA2B,IAAI,CAAC,IAAI,0BAA0B,CAAA;IACvE,CAAC;CACF;AAED,MAAM,wBAAwB,GAC5B,CAAA,IAAI,CAAC,WAAW,CAAC,6BAA6B,CAAK,CAAA,CAAA;AAErD,0FAA0F;AAC1F,MAAM,OAAO,oBAAqB,SAAQ,wBAAwB;IAChE,IAAa,OAAO;QAClB,OAAO,4DAA4D,CAAA;IACrE,CAAC;CACF;AAED,MAAM,qBAAqB,GACzB,CAAA,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAA4B,CAAA,CAAA;AAEzE,iFAAiF;AACjF,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,IAAa,OAAO;QAClB,OAAO,0BAA0B,IAAI,CAAC,IAAI,YAAY,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S,GAAG,CAAI,KAAc,EAAK,EAAE;IAChD,IAAI,CAAC;QACH,OAAO,KAAK,EAAE,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,kBAAkB,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,eAAe,EAAE,CAAA;QAC1D,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED,MAAM,yBAAyB,GAG3B,CAAA,IAAI,CAAC,WAAW,CAAC,8BAA8B,CAAmD,CAAA,CAAA;AAEtG;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,yBAAyB;IAClE,IAAa,OAAO;QAClB,OAAO,qBAAqB,IAAI,CAAC,IAAI,2BAA2B,IAAI,CAAC,IAAI,GAAG,CAAA;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Inspectable, NodeInspectSymbol } from 'effect/Inspectable';
|
|
2
|
+
export { type Inspectable, NodeInspectSymbol };
|
|
3
|
+
/**
|
|
4
|
+
* The `Inspectable` trio built around a `toJSON`, so every reform value prints
|
|
5
|
+
* like an Effect value — `_id`-tagged JSON under `console.log`, Node's
|
|
6
|
+
* inspector, `JSON.stringify`, and `String(...)` — instead of `[object Object]`.
|
|
7
|
+
* Mirrors Effect's `BaseProto` / `Inspectable.Class` (`Inspectable.ts:170`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const inspectable: (toJSON: () => unknown) => Inspectable;
|
|
10
|
+
/**
|
|
11
|
+
* Attach the `Inspectable` trio to an existing object as *non-enumerable* own
|
|
12
|
+
* properties (so they don't show up in `Object.keys`/`for…in` over a definition
|
|
13
|
+
* class). Used where the value is built by other means — the definition classes,
|
|
14
|
+
* whose statics are merged in separately.
|
|
15
|
+
*/
|
|
16
|
+
export declare const attachInspectable: <T extends object>(target: T, toJSON: () => unknown) => T;
|
|
17
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/internal/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,OAAO,KAAG,WAIlD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,MAAM,OAAO,KAAG,CAWtF,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { format, NodeInspectSymbol } from 'effect/Inspectable';
|
|
2
|
+
export { NodeInspectSymbol };
|
|
3
|
+
/**
|
|
4
|
+
* The `Inspectable` trio built around a `toJSON`, so every reform value prints
|
|
5
|
+
* like an Effect value — `_id`-tagged JSON under `console.log`, Node's
|
|
6
|
+
* inspector, `JSON.stringify`, and `String(...)` — instead of `[object Object]`.
|
|
7
|
+
* Mirrors Effect's `BaseProto` / `Inspectable.Class` (`Inspectable.ts:170`).
|
|
8
|
+
*/
|
|
9
|
+
export const inspectable = (toJSON) => ({
|
|
10
|
+
toJSON,
|
|
11
|
+
toString: () => format(toJSON()),
|
|
12
|
+
[NodeInspectSymbol]: () => toJSON(),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Attach the `Inspectable` trio to an existing object as *non-enumerable* own
|
|
16
|
+
* properties (so they don't show up in `Object.keys`/`for…in` over a definition
|
|
17
|
+
* class). Used where the value is built by other means — the definition classes,
|
|
18
|
+
* whose statics are merged in separately.
|
|
19
|
+
*/
|
|
20
|
+
export const attachInspectable = (target, toJSON) => {
|
|
21
|
+
const trio = inspectable(toJSON);
|
|
22
|
+
for (const key of Reflect.ownKeys(trio)) {
|
|
23
|
+
Object.defineProperty(target, key, {
|
|
24
|
+
value: trio[key],
|
|
25
|
+
enumerable: false,
|
|
26
|
+
writable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/internal/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,OAAO,EAAoB,iBAAiB,EAAE,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAqB,EAAe,EAAE,CAAC,CAAC;IAClE,MAAM;IACN,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE;CACpC,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAmB,MAAS,EAAE,MAAqB,EAAK,EAAE;IACzF,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAA4C,CAAA;IAC3E,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YACjC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;YAChB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|