@playfast/reform 1.2.0 → 1.2.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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/src/boundary/boundary.test.ts +26 -23
  3. package/src/calc/asyncCalc.invalidate.test.ts +258 -55
  4. package/src/calc/asyncCalc.test.ts +225 -85
  5. package/src/calc/asyncCalc.ts +27 -141
  6. package/src/calc/asyncCalcTypes.ts +147 -0
  7. package/src/calc/calc.test.ts +10 -11
  8. package/src/calc/calcFamily.test.ts +12 -12
  9. package/src/channel/channel.ts +8 -106
  10. package/src/channel/procedures.ts +108 -0
  11. package/src/compose/composition.ts +49 -246
  12. package/src/compose/compositionTypes.ts +249 -0
  13. package/src/event/event.fromSource.test.ts +12 -12
  14. package/src/feature/feature.ts +50 -1210
  15. package/src/feature/feature.typecheck.ts +2 -61
  16. package/src/feature/featureBinding.ts +158 -0
  17. package/src/feature/featureClass.ts +162 -0
  18. package/src/feature/featureConfig.ts +192 -0
  19. package/src/feature/featureFactory.ts +163 -0
  20. package/src/feature/featureModule.ts +136 -0
  21. package/src/feature/featureModule.typecheck.ts +63 -0
  22. package/src/feature/featureNativeTree.ts +152 -0
  23. package/src/feature/featureRequirement.ts +82 -0
  24. package/src/feature/featureVariants.ts +234 -0
  25. package/src/feature/mountFeature.ts +54 -0
  26. package/src/graph/closure.ts +45 -226
  27. package/src/graph/services.ts +95 -0
  28. package/src/graph/summary.ts +134 -0
  29. package/src/internal/queryDriver.ts +20 -89
  30. package/src/internal/queryDriverHydrate.ts +45 -0
  31. package/src/internal/queryDriverTypes.ts +8 -10
  32. package/src/internal/store.test.ts +27 -6
  33. package/src/remote/pendingQueue.ts +145 -0
  34. package/src/remote/remoteState.test.ts +28 -22
  35. package/src/remote/remoteState.ts +63 -489
  36. package/src/remote/remoteStateMake.ts +97 -0
  37. package/src/remote/remoteStateSend.ts +122 -0
  38. package/src/remote/remoteStateTypes.ts +155 -0
  39. package/src/runtime/appRuntime.activation.test.ts +9 -5
  40. package/src/runtime/appRuntime.test.ts +40 -16
  41. package/src/runtime/appRuntime.ts +17 -472
  42. package/src/runtime/capturedAppRuntime.ts +274 -0
  43. package/src/runtime/eventBudget.test.ts +38 -8
  44. package/src/runtime/featureMount.ts +94 -0
  45. package/src/runtime/hardening.test.ts +18 -4
  46. package/src/runtime/instrumentation.test.ts +49 -12
  47. package/src/runtime/loop.test.ts +51 -10
  48. package/src/runtime/runtimeHandle.ts +124 -0
  49. package/src/state/stateFamily.test.ts +25 -8
  50. package/src/testkit/flight.testkit.ts +9 -0
@@ -1,13 +1,13 @@
1
1
  import { expect, it } from '@effect/vitest'
2
- import { Duration, Effect, Exit, Layer, Option, Schema as S, Scope } from 'effect'
2
+ import { Effect, Exit, Layer, Option, Schema as S, Scope } from 'effect'
3
3
  import { Engine, Event, Reducer, State } from '../index'
4
+ import { flush } from '../testkit/flight.testkit'
4
5
 
5
6
  // `Event.liveFromSource` turns a Source *transition* into an ordinary event, so
6
7
  // a rule can be triggered by a value moving rather than by a UI dispatch. Every
7
8
  // case observes through a reducer — the framework's own writer — so what the
8
9
  // log holds is exactly what the bus carried, with no spy in the middle.
9
10
 
10
- const tick = Effect.sleep(Duration.millis(1))
11
11
 
12
12
  // One string carrying both ends of a transition: `none->0` for the initial
13
13
  // emission (nothing preceded it), `0->1` for a change.
@@ -47,17 +47,17 @@ it.live('emits nothing for the value present at construction (changes only)', ()
47
47
  const level = yield* Level.store
48
48
  const log = yield* Log.store
49
49
 
50
- yield* tick
50
+ yield* flush()
51
51
  expect(log.get()).toEqual([])
52
52
 
53
53
  level.set(1)
54
- yield* tick
54
+ yield* flush()
55
55
  expect(log.get()).toEqual(['0->1'])
56
56
 
57
57
  // Store equality is the framework's, not this adapter's: re-setting the same
58
58
  // value is not a change, so nothing notifies and nothing is emitted.
59
59
  level.set(1)
60
- yield* tick
60
+ yield* flush()
61
61
  expect(log.get()).toEqual(['0->1'])
62
62
  }).pipe(Effect.provide(TestLayer))
63
63
  })
@@ -81,13 +81,13 @@ it.live('emitInitial reports the construction value once, with no previous', ()
81
81
  const level = yield* Level.store
82
82
  const log = yield* Log.store
83
83
 
84
- yield* tick
84
+ yield* flush()
85
85
  expect(log.get()).toEqual(['none->2'])
86
86
 
87
87
  // The initial emission seeds `previous`: the next change reports the
88
88
  // construction value as its left-hand side, not another `none`.
89
89
  level.set(1)
90
- yield* tick
90
+ yield* flush()
91
91
  expect(log.get()).toEqual(['none->2', '2->1'])
92
92
  }).pipe(Effect.provide(TestLayer))
93
93
  })
@@ -121,11 +121,11 @@ it.live('a payload of Option.none() suppresses a non-qualifying transition', ()
121
121
  const log = yield* Log.store
122
122
 
123
123
  phase.set('busy')
124
- yield* tick
124
+ yield* flush()
125
125
  expect(log.get()).toEqual([])
126
126
 
127
127
  phase.set('ready')
128
- yield* tick
128
+ yield* flush()
129
129
  expect(log.get()).toEqual(['busy'])
130
130
  }).pipe(Effect.provide(TestLayer))
131
131
  })
@@ -153,7 +153,7 @@ it.live('closing the scope ends the emissions, including one already in flight',
153
153
  const log = yield* Log.store
154
154
 
155
155
  level.set(1)
156
- yield* tick
156
+ yield* flush()
157
157
  expect(log.get()).toEqual(['0->1'])
158
158
 
159
159
  // A write that already handed the listener to the notification scheduler,
@@ -162,11 +162,11 @@ it.live('closing the scope ends the emissions, including one already in flight',
162
162
  Effect.sync(() => level.set(2)),
163
163
  Scope.close(scope, Exit.void),
164
164
  )
165
- yield* tick
165
+ yield* flush()
166
166
  expect(log.get()).toEqual(['0->1'])
167
167
 
168
168
  level.set(0)
169
- yield* tick
169
+ yield* flush()
170
170
  expect(log.get()).toEqual(['0->1'])
171
171
  }).pipe(Effect.provide(TestLayer))
172
172
  })