Effect
Version 4.0.0-beta.51
Patch Changes
-
#2049
778d2afThanks @bohdanbirdie! - AddRpcSerialization.makeMsgPackfor creating MessagePack serialization with custom msgpackr options. On Cloudflare Workers withallow_eval_during_startup(default forcompatibility_date >= 2025-06-01), pass{ useRecords: false }to prevent msgpackr’s JIT code generation vianew Function(), which is blocked during request handling. Also fixes silent error swallowing in themsgPackdecode path — non-incomplete errors are now rethrown instead of returning[]. -
#2010
4e24dcfThanks @tim-smart! - process schema properties / elements concurrently -
#2052
4b1c015Thanks @gcanti! - Schema: expandFilterOutputand addFilterIssuefor richer filter failures.The return type of a
Schema.makeFilterpredicate now supports two additional shapes:{ path, issue }whereissueisstring | SchemaIssue.Issue(previously only{ path, message: string }was accepted). Theissuearm lets you attach a fully-formedIssueat a nested path without manually constructing aPointer.ReadonlyArray<Schema.FilterIssue>to report several failures at once. An empty array is success, a single-element array is equivalent to returning that element, and multi-entry arrays are grouped into anIssue.Composite. This removes the need to importSchemaIssueand hand-build aCompositefor multi-field validators.
The single-failure shapes (
undefined,true,false,string,SchemaIssue.Issue) are unchanged.Breaking: the object shape renamed from
{ path, message }to{ path, issue }. Call sites that used the old shape must rename the field; the migration is mechanical.// beforeSchema.makeFilter((o) => ({ path: ["a"], message: "bad" }));// afterSchema.makeFilter((o) => ({ path: ["a"], issue: "bad" }));Also renamed
{ path, message }to{ path, issue }in the accepted return type ofSchemaGetter.checkEffect. -
#2047
454f8adThanks @gcanti! - FixSchemaAST.isJsonrejecting DAGs as cycles, closes #2021.The previous implementation marked every visited object in a single
seenset and never removed it, so any value that referenced the same object through two different paths (a DAG, e.g.{ x: shared, y: shared }) was treated as a cycle and returnedfalse. Cycle detection now tracks only the current recursion path (popping on exit) and memoizes fully validated subtrees, so DAGs are accepted while true cycles are still rejected. -
#2051
6754a0cThanks @tim-smart! - disable sql traces for EventLog, RunnerStorage -
#2053
90f7fd5Thanks @tim-smart! - remove use of bigint literals -
#2046
d7e1519Thanks @gcanti! - Remove theoptionsparameter fromOpenApi.fromApi.The parameter only carried
additionalProperties, but the function caches results in aWeakMapkeyed solely on theapiinstance. Passing different options across calls for the same api was silently ignored, making the parameter order-dependent and effectively single-shot. No call sites were using it, so the signature is now simplyfromApi(api). -
#2044
72a8122Thanks @tim-smart! - ensure envelope payloads are correctly encoded for notify path