effect-cf 0.38.0 → 0.39.0
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 +10 -0
- package/README.md +1 -1
- package/dist/index.mjs +7 -4
- package/package.json +6 -6
- package/src/DurableObjectRpcWebSocket.ts +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# effect-cf
|
|
2
2
|
|
|
3
|
+
## 0.39.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#140](https://github.com/danieljvdm/effect-cf/pull/140) [`3013c49`](https://github.com/danieljvdm/effect-cf/commit/3013c495a6e4392446a5661777f5eb0ffe4a828f) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Require the Effect 4.0.0-rc.112 family. Both packages now declare `effect@^4.0.0-rc.112`; effect-cf's SQL peers require the matching rc.112 line. Upgrade these dependencies together.
|
|
8
|
+
|
|
9
|
+
Fix Durable Object WebSocket RPC server startup with rc.112 and preserve the selected serialization's schema codecs for payloads, replies, and transport errors. JSON consumers can keep `RpcSerialization.layerJson`; no wire-format migration is required. The protocol also declares its existing ability to send server notifications. Hibernation attachments, resumable stream checkpoints, acknowledgements, and tracing behavior are unchanged.
|
|
10
|
+
|
|
11
|
+
The WebTransport socket adapter continues to use Effect's built-in RPC protocols and a framed serialization such as NDJSON. Its runtime API is unchanged.
|
|
12
|
+
|
|
3
13
|
## 0.38.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Cloudflare entrypoints and bindings as Effect services.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
npm install effect-cf "effect@^4.0.0-rc.
|
|
6
|
+
npm install effect-cf "effect@^4.0.0-rc.112"
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
The repository tests against workerd `1.20260825.1` and `@cloudflare/workers-types@5.20260825.1`. Use `compatibility_date: "2026-08-25"` in Wrangler.
|
package/dist/index.mjs
CHANGED
|
@@ -1633,6 +1633,7 @@ const layer$8 = (options = {}) => Layer.effectContext(Effect.gen(function* () {
|
|
|
1633
1633
|
const declarations = options.resumableStreams ?? [];
|
|
1634
1634
|
const durableObjectState = yield* DurableObjectState;
|
|
1635
1635
|
const serialization = yield* RpcSerialization.RpcSerialization;
|
|
1636
|
+
const encodeDefect = Schema.encodeSync(serialization.codecFor(Schema.Defect()));
|
|
1636
1637
|
const disconnects = yield* Queue.make();
|
|
1637
1638
|
const connectionsBySocket = /* @__PURE__ */ new Map();
|
|
1638
1639
|
const connectionsById = /* @__PURE__ */ new Map();
|
|
@@ -1931,7 +1932,7 @@ const layer$8 = (options = {}) => Layer.effectContext(Effect.gen(function* () {
|
|
|
1931
1932
|
connection.socket.raw.send(encoded);
|
|
1932
1933
|
return true;
|
|
1933
1934
|
} catch (cause) {
|
|
1934
|
-
delivered = RpcMessage.ResponseDefectEncoded(cause);
|
|
1935
|
+
delivered = RpcMessage.ResponseDefectEncoded(encodeDefect(cause));
|
|
1935
1936
|
const encoded = connection.parser.encode(delivered);
|
|
1936
1937
|
if (encoded === void 0) return false;
|
|
1937
1938
|
connection.socket.raw.send(encoded);
|
|
@@ -1961,7 +1962,9 @@ const layer$8 = (options = {}) => Layer.effectContext(Effect.gen(function* () {
|
|
|
1961
1962
|
initialMessage: Effect.succeedNone,
|
|
1962
1963
|
supportsAck: true,
|
|
1963
1964
|
supportsTransferables: false,
|
|
1964
|
-
supportsSpanPropagation: true
|
|
1965
|
+
supportsSpanPropagation: true,
|
|
1966
|
+
supportsNotifications: true,
|
|
1967
|
+
codecFor: serialization.codecFor
|
|
1965
1968
|
});
|
|
1966
1969
|
});
|
|
1967
1970
|
const replay = writeRequest;
|
|
@@ -2029,7 +2032,7 @@ const layer$8 = (options = {}) => Layer.effectContext(Effect.gen(function* () {
|
|
|
2029
2032
|
});
|
|
2030
2033
|
const run = writeRequest;
|
|
2031
2034
|
if (run === void 0) {
|
|
2032
|
-
yield* send(connection, RpcMessage.ResponseDefectEncoded("RPC server is not ready"));
|
|
2035
|
+
yield* send(connection, RpcMessage.ResponseDefectEncoded(encodeDefect("RPC server is not ready")));
|
|
2033
2036
|
return;
|
|
2034
2037
|
}
|
|
2035
2038
|
for (const current of decoded) {
|
|
@@ -2044,7 +2047,7 @@ const layer$8 = (options = {}) => Layer.effectContext(Effect.gen(function* () {
|
|
|
2044
2047
|
}
|
|
2045
2048
|
}).pipe(Effect.catch((cause) => {
|
|
2046
2049
|
const connection = register(socket);
|
|
2047
|
-
return Predicate.isTagged(cause, "MaxBufferSizeExceeded") ? Effect.ignore(connection.socket.close(1009, String(cause))) : send(connection, RpcMessage.ResponseDefectEncoded(cause));
|
|
2050
|
+
return Predicate.isTagged(cause, "MaxBufferSizeExceeded") ? Effect.ignore(connection.socket.close(1009, String(cause))) : send(connection, RpcMessage.ResponseDefectEncoded(encodeDefect(cause)));
|
|
2048
2051
|
})),
|
|
2049
2052
|
close: unregister,
|
|
2050
2053
|
error: resetSocket,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-cf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Effect-native primitives for Cloudflare Workers and bindings.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@cloudflare/sandbox": "0.13.0-next.738.2",
|
|
76
76
|
"@cloudflare/vitest-plugin": "catalog:",
|
|
77
77
|
"@cloudflare/workers-types": "catalog:",
|
|
78
|
-
"@effect/platform-node": "
|
|
78
|
+
"@effect/platform-node": "catalog:",
|
|
79
79
|
"@effect/sql-d1": "catalog:",
|
|
80
80
|
"@effect/sql-pg": "catalog:",
|
|
81
81
|
"@effect/sql-sqlite-do": "catalog:",
|
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
"@cloudflare/sandbox": "^0.13.0-next.738.2",
|
|
95
95
|
"@cloudflare/vitest-plugin": "^1.0.0",
|
|
96
96
|
"@cloudflare/workers-types": "^5.20260825.1",
|
|
97
|
-
"@effect/sql-d1": "^4.0.0-rc.
|
|
98
|
-
"@effect/sql-pg": "^4.0.0-rc.
|
|
99
|
-
"@effect/sql-sqlite-do": "^4.0.0-rc.
|
|
97
|
+
"@effect/sql-d1": "^4.0.0-rc.112",
|
|
98
|
+
"@effect/sql-pg": "^4.0.0-rc.112",
|
|
99
|
+
"@effect/sql-sqlite-do": "^4.0.0-rc.112",
|
|
100
100
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
101
|
-
"effect": "^4.0.0-rc.
|
|
101
|
+
"effect": "^4.0.0-rc.112"
|
|
102
102
|
},
|
|
103
103
|
"peerDependenciesMeta": {
|
|
104
104
|
"@cloudflare/computer": {
|
|
@@ -227,6 +227,7 @@ export const layer = (
|
|
|
227
227
|
const declarations = options.resumableStreams ?? [];
|
|
228
228
|
const durableObjectState = yield* DurableObjectState;
|
|
229
229
|
const serialization = yield* RpcSerialization.RpcSerialization;
|
|
230
|
+
const encodeDefect = Schema.encodeSync(serialization.codecFor(Schema.Defect()));
|
|
230
231
|
const disconnects = yield* Queue.make<number>();
|
|
231
232
|
const connectionsBySocket = new Map<WebSocket, RpcConnection>();
|
|
232
233
|
const connectionsById = new Map<number, RpcConnection>();
|
|
@@ -777,7 +778,7 @@ export const layer = (
|
|
|
777
778
|
|
|
778
779
|
return true;
|
|
779
780
|
} catch (cause) {
|
|
780
|
-
delivered = RpcMessage.ResponseDefectEncoded(cause);
|
|
781
|
+
delivered = RpcMessage.ResponseDefectEncoded(encodeDefect(cause));
|
|
781
782
|
const encoded = connection.parser.encode(delivered);
|
|
782
783
|
|
|
783
784
|
if (encoded === undefined) {
|
|
@@ -834,6 +835,8 @@ export const layer = (
|
|
|
834
835
|
supportsAck: true,
|
|
835
836
|
supportsTransferables: false,
|
|
836
837
|
supportsSpanPropagation: true,
|
|
838
|
+
supportsNotifications: true,
|
|
839
|
+
codecFor: serialization.codecFor,
|
|
837
840
|
});
|
|
838
841
|
});
|
|
839
842
|
|
|
@@ -976,7 +979,10 @@ export const layer = (
|
|
|
976
979
|
const run = writeRequest;
|
|
977
980
|
|
|
978
981
|
if (run === undefined) {
|
|
979
|
-
yield* send(
|
|
982
|
+
yield* send(
|
|
983
|
+
connection,
|
|
984
|
+
RpcMessage.ResponseDefectEncoded(encodeDefect("RPC server is not ready")),
|
|
985
|
+
);
|
|
980
986
|
|
|
981
987
|
return;
|
|
982
988
|
}
|
|
@@ -1021,7 +1027,7 @@ export const layer = (
|
|
|
1021
1027
|
|
|
1022
1028
|
return Predicate.isTagged(cause, "MaxBufferSizeExceeded")
|
|
1023
1029
|
? Effect.ignore(connection.socket.close(1009, String(cause)))
|
|
1024
|
-
: send(connection, RpcMessage.ResponseDefectEncoded(cause));
|
|
1030
|
+
: send(connection, RpcMessage.ResponseDefectEncoded(encodeDefect(cause)));
|
|
1025
1031
|
}),
|
|
1026
1032
|
),
|
|
1027
1033
|
close: unregister,
|