@playfast/reform-remote-web 0.0.3 → 0.0.4
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/package.json +1 -1
- package/src/client.test.ts +6 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playfast/reform-remote-web",
|
|
3
3
|
"playbook": "./playbook",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Browser/web WebSocket client transport for reform-remote — streams a server-run reform scene to a thin renderer.",
|
|
7
7
|
"keywords": [
|
package/src/client.test.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
State,
|
|
12
12
|
StateGroup,
|
|
13
13
|
Ui,
|
|
14
|
+
mount,
|
|
14
15
|
provide,
|
|
15
16
|
scene,
|
|
16
17
|
ui,
|
|
@@ -19,6 +20,10 @@ import { connect, remoteViews } from '@playfast/reform-remote'
|
|
|
19
20
|
import { type NodeWebSocketServer, serveNodeWebSocket } from '@playfast/reform-remote-node'
|
|
20
21
|
import { createWebSocketClientTransport } from './index'
|
|
21
22
|
|
|
23
|
+
// Real loopback round-trip (ws server + live client, incl. reconnect): headroom so the
|
|
24
|
+
// full parallel suite can't starve it past the 5s default (30s still fails a real hang).
|
|
25
|
+
vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 })
|
|
26
|
+
|
|
22
27
|
// Self-contained counter scene for the server end of the round-trip.
|
|
23
28
|
class Count extends State.make('count', S.Number) {}
|
|
24
29
|
class Counters extends StateGroup.make(Count) {}
|
|
@@ -39,7 +44,7 @@ const counterScene = () => {
|
|
|
39
44
|
Composition.live(Counter, function* () {
|
|
40
45
|
const count = yield* StateGroup.select(Counters, 'count')
|
|
41
46
|
const bump = yield* Event.trigger(Bumped)
|
|
42
|
-
return (
|
|
47
|
+
return mount({ props: { count }, slots: {}, events: { bump } })
|
|
43
48
|
}),
|
|
44
49
|
Reducer.live(Bump, (n, event) => n + event.by),
|
|
45
50
|
).pipe(Layer.provideMerge(presentation), Layer.provideMerge(Engine))
|