@reventlessdev/reventless-gwt 1.0.0-alpha.127 → 1.0.0-alpha.129
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/CHANGELOG.md +16 -0
- package/package.json +6 -6
- package/src/Projection_GWT.res +13 -3
- package/src/Projection_GWT.res.mjs +5 -1
- package/src/TestFixtures.res +5 -0
- package/src/TestFixtures.res.mjs +3 -0
- package/tests/FlowGwtTest.res +1 -1
- package/tests/FlowGwtTest.res.mjs +2 -1
- package/tests/QueryGwtTest.res +1 -1
- package/tests/QueryGwtTest.res.mjs +2 -1
- package/tests/StateViewSliceGwtTest.res +1 -1
- package/tests/StateViewSliceGwtTest.res.mjs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.0.0-alpha.129 (2026-07-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 1.0.0-alpha.128 (2026-07-26)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 1.0.0-alpha.127 (2026-07-24)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-gwt",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.129",
|
|
4
4
|
"description": "Given-When-Then DSLs and test harness for Reventless slice testing",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"sury": "11.0.0-alpha.4",
|
|
17
|
-
"@reventlessdev/rescript-effect": "0.1.0-alpha.30",
|
|
18
17
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.9",
|
|
19
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.
|
|
20
|
-
"@reventlessdev/reventless-
|
|
21
|
-
"@reventlessdev/
|
|
18
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.182",
|
|
19
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.81",
|
|
20
|
+
"@reventlessdev/rescript-effect": "0.1.0-alpha.31",
|
|
21
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.105"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"rescript": "12.3.0",
|
|
25
25
|
"sury-ppx": "11.0.0-alpha.2",
|
|
26
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
26
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.56"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"rescript": "12.3.0"
|
package/src/Projection_GWT.res
CHANGED
|
@@ -30,7 +30,9 @@ module type Spec = {
|
|
|
30
30
|
module type Projection = {
|
|
31
31
|
module Spec: Spec
|
|
32
32
|
|
|
33
|
-
let project: Spec.consumedEvent => array<
|
|
33
|
+
let project: Reventless.StateViewSlice.consumed<Spec.consumedEvent> => array<
|
|
34
|
+
Reventless.Projection.action<string, Spec.state>,
|
|
35
|
+
>
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
module type T = {
|
|
@@ -163,10 +165,18 @@ module Make = (
|
|
|
163
165
|
|
|
164
166
|
let update = async (store, events) => {
|
|
165
167
|
// Projection.project produces an array of actions per event — flatten and
|
|
166
|
-
// feed them through handleActions against the dict store.
|
|
168
|
+
// feed them through handleActions against the dict store. Each bare event is
|
|
169
|
+
// wrapped in the `consumed` envelope with the deterministic test `meta` /
|
|
170
|
+
// `recordedAt` so a projection reading `meta.time` asserts a fixed value.
|
|
167
171
|
let actions =
|
|
168
172
|
events
|
|
169
|
-
->Array.map(ev =>
|
|
173
|
+
->Array.map(ev =>
|
|
174
|
+
{
|
|
175
|
+
Reventless.StateViewSlice.event: ev,
|
|
176
|
+
meta: TestFixtures.meta,
|
|
177
|
+
recordedAt: TestFixtures.recordedAt,
|
|
178
|
+
}->Projection.project
|
|
179
|
+
)
|
|
170
180
|
->Array.flat
|
|
171
181
|
await actions->runActions({
|
|
172
182
|
load: load(store, ...),
|
|
@@ -61,7 +61,11 @@ function Make(Spec) {
|
|
|
61
61
|
};
|
|
62
62
|
let runActions = (actions, operations) => Projection$ReventlessCore.handleActions(undefined, actions, operations, Spec.subIdConfig);
|
|
63
63
|
let update = async (store, events) => {
|
|
64
|
-
let actions = events.map(ev => Projection.project(
|
|
64
|
+
let actions = events.map(ev => Projection.project({
|
|
65
|
+
event: ev,
|
|
66
|
+
meta: TestFixtures$ReventlessGwt.meta,
|
|
67
|
+
recordedAt: TestFixtures$ReventlessGwt.recordedAt
|
|
68
|
+
})).flat();
|
|
65
69
|
await runActions(actions, {
|
|
66
70
|
load: extra => Promise.resolve({
|
|
67
71
|
TAG: "Ok",
|
package/src/TestFixtures.res
CHANGED
|
@@ -8,6 +8,11 @@ let meta = {
|
|
|
8
8
|
correlationId: "correlationId",
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
// Deterministic storage timestamp for StateViewSlice projection envelopes
|
|
12
|
+
// (`consumed.recordedAt`). Distinct from `meta.time` (producer time) so a test
|
|
13
|
+
// projecting either clock asserts against an unambiguous fixed value.
|
|
14
|
+
let recordedAt = "recordedAt"
|
|
15
|
+
|
|
11
16
|
let context = {Reventless.Message.meta, id}
|
|
12
17
|
|
|
13
18
|
let statusChange = {
|
package/src/TestFixtures.res.mjs
CHANGED
package/tests/FlowGwtTest.res
CHANGED
|
@@ -138,7 +138,7 @@ module OrdersViewProjection = {
|
|
|
138
138
|
module Spec = OrdersViewSlice
|
|
139
139
|
open Reventless.Projection
|
|
140
140
|
|
|
141
|
-
let project = (event: OrdersViewSlice.consumedEvent) =>
|
|
141
|
+
let project = ({event}: Reventless.StateViewSlice.consumed<OrdersViewSlice.consumedEvent>) =>
|
|
142
142
|
switch event {
|
|
143
143
|
| OrderPlaced({orderId, item}) => [
|
|
144
144
|
Set(orderId, ({orderId, item, status: "Placed"}: OrdersViewSlice.state)),
|
package/tests/QueryGwtTest.res
CHANGED
|
@@ -123,7 +123,7 @@ module OrdersView = {
|
|
|
123
123
|
@schema
|
|
124
124
|
type consumedEvent = OrderPlaced({orderId: string, customerId: string, total: int})
|
|
125
125
|
|
|
126
|
-
let project = event =>
|
|
126
|
+
let project = ({event}: Reventless.StateViewSlice.consumed<consumedEvent>) =>
|
|
127
127
|
switch event {
|
|
128
128
|
| OrderPlaced({orderId, customerId, total}) => [
|
|
129
129
|
Reventless.Projection.Set(orderId, {orderId, customerId, total}),
|
|
@@ -29,7 +29,7 @@ module CategoriesViewProjection = {
|
|
|
29
29
|
module Spec = CategoriesView
|
|
30
30
|
open CategoriesView
|
|
31
31
|
|
|
32
|
-
let project = (event: consumedEvent) =>
|
|
32
|
+
let project = ({event}: Reventless.StateViewSlice.consumed<consumedEvent>) =>
|
|
33
33
|
switch event {
|
|
34
34
|
| CategoryAdded({categoryId, name}) => [
|
|
35
35
|
Set(categoryId, {categoryId, name, archived: false}),
|