Releases: Effect-TS/effect
[email protected]
Minor Changes
-
#4068
abb22a4
Thanks @titouancreach! - Added encodeUriComponent/decodeUriComponent for both Encoding and Schema -
#4068
f369a89
Thanks @vinassefranche! - Add Runtime.Runtime.Context type extractor -
#4068
642376c
Thanks @tim-smart! - add non-traced overload to Effect.fn -
#4068
3d2b7a7
Thanks @mikearnaldi! - Update fast-check to latest version -
#4068
73f9c6f
Thanks @wewelll! - add DateTimeUtcFromDate schema -
#4068
17cb451
Thanks @fubhy! - Added support forsecond
granularity toCron
. -
#4068
d801820
Thanks @fubhy! - AddedCron.unsafeParse
and allow passing theCron.parse
time zone parameter asstring
. -
#4068
e1eeb2d
Thanks @mikearnaldi! - add Effect.fnUntraced - an untraced version of Effect.fn -
#4068
c11f3a6
Thanks @QuentinJanuel! - Add Context.mergeAll to combine multiple Contexts into one. -
#4068
618f7e0
Thanks @tim-smart! - add span annotation to disable propagation to the tracer -
#4068
c0ba834
Thanks @titouancreach! - Add Schema.headNonEmpty for Schema.NonEmptyArray
Patch Changes
- #4068
e1eeb2d
Thanks @mikearnaldi! - Carry both call-site and definition site in Effect.fn, auto-trace to anon
[email protected]
Patch Changes
-
#4176
39457d4
Thanks @mikearnaldi! - Fix Stream.scoped example -
#4181
a475cc2
Thanks @gcanti! - Schema: FixwithDecodingDefault
implementation to align with its signature (now removesundefined
from the AST).Additionally, a new constraint has been added to the signature to prevent calling
withDecodingDefault
afterwithConstructorDefault
, which previously led to the following issue:import { Schema } from "effect" const schema = Schema.Struct({ a: Schema.optional(Schema.String).pipe( Schema.withConstructorDefault(() => undefined), // this is invalidated by the following call to `withDecodingDefault` Schema.withDecodingDefault(() => "") ) })
-
#4175
199214e
Thanks @gcanti! - Schema: refactor annotations:-
Export internal
Uint8
schema -
Export internal
NonNegativeInt
schema -
Remove title annotations that are identical to identifiers
-
Avoid setting a title annotation when applying branding
-
Add more title annotations to refinements
-
Improve
toString
output and provide more precise error messages for refinements:Before
import { Schema } from "effect" const schema = Schema.Number.pipe( Schema.int({ identifier: "MyInt" }), Schema.positive() ) console.log(String(schema)) // Output: a positive number Schema.decodeUnknownSync(schema)(1.1) /* throws: ParseError: a positive number └─ From side refinement failure └─ MyInt └─ Predicate refinement failure └─ Expected MyInt, actual 1.1 */
After
toString
now combines all refinements with" & "
instead of showing only the last one.- The last message (
"Expected ..."
) now uses the extended description to make the error message clearer.
import { Schema } from "effect" const schema = Schema.Number.pipe( Schema.int({ identifier: "MyInt" }), Schema.positive() ) console.log(String(schema)) // Output: MyInt & positive // <= all the refinements Schema.decodeUnknownSync(schema)(1.1) /* throws: ParseError: MyInt & positive └─ From side refinement failure └─ MyInt └─ Predicate refinement failure └─ Expected an integer, actual 1.1 // <= extended description */
-
-
#4182
b3c160d
Thanks @mikearnaldi! - Replace absolute imports with relative ones
@effect/[email protected]
Patch Changes
-
#4068
3d2b7a7
Thanks @mikearnaldi! - Allow passing fast-check parameters to prop functionit.effect.prop( "adds context", [realNumber], ([num]) => Effect.gen(function* () { const foo = yield* Foo expect(foo).toEqual("foo") return num === num }), { fastCheck: { numRuns: 200 } } )
-
Updated dependencies [
abb22a4
,f369a89
,642376c
,3d2b7a7
,73f9c6f
,17cb451
,d801820
,e1eeb2d
,c11f3a6
,618f7e0
,c0ba834
,e1eeb2d
]:
@effect/[email protected]
@effect/[email protected]
@effect/[email protected]
@effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
39457d4
,a475cc2
,199214e
,b3c160d
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
abb22a4
,f369a89
,642376c
,3d2b7a7
,73f9c6f
,17cb451
,d801820
,e1eeb2d
,c11f3a6
,618f7e0
,c0ba834
,e1eeb2d
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
39457d4
,a475cc2
,199214e
,b3c160d
]:- [email protected]
- @effect/[email protected]
- @effect/[email protected]