Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.2.5
->3.13.1
Release Notes
Effect-TS/effect (effect)
v3.13.1
Compare Source
Patch Changes
b56a211
Thanks @FizzyElt! - fix Option filterMap examplev3.13.0
Compare Source
Minor Changes
#4280
8baef83
Thanks @tim-smart! - add Promise based apis to Fiber{Handle,Set,Map} modules#4280
655bfe2
Thanks @gcanti! - AddEffect.transposeOption
, closes #3142.Converts an
Option
of anEffect
into anEffect
of anOption
.Details
This function transforms an
Option<Effect<A, E, R>>
into anEffect<Option<A>, E, R>
. If theOption
isNone
, the resultingEffect
will immediately succeed with a
None
value. If theOption
isSome
, theinner
Effect
will be executed, and its result wrapped in aSome
.Example
#4280
d90cbc2
Thanks @indietyp! - AddEffect.whenLogLevel
, which conditionally executes an effect if the specified log level is enabled#4280
75632bd
Thanks @tim-smart! - add RcMap.touch, for reseting the idle timeout for an item#4280
c874a2e
Thanks @LaureRC! - Add HashMap.some#4280
bf865e5
Thanks @tim-smart! - allow accessing args in Effect.fn pipe#4280
f98b2b7
Thanks @tim-smart! - add RcMap.invalidate api, for removing a resource from an RcMap#4280
de8ce92
Thanks @mikearnaldi! - Add Layer.updateService mirroring Effect.updateService#4280
db426a5
Thanks @KhraksMamtsov! -Differ
implementsPipeable
#4280
6862444
Thanks @thewilkybarkid! - Make it easy to convert a DateTime.Zoned to a DateTime.Utc#4280
5fc8a90
Thanks @gcanti! - Add missingEither.void
constructor.#4280
546a492
Thanks @vinassefranche! - AddHashMap.toValues
andHashSet.toValues
getters#4280
65c4796
Thanks @tim-smart! - add {FiberHandle,FiberSet,FiberMap}.awaitEmpty apis#4280
9760fdc
Thanks @gcanti! - Schema: AddstandardSchemaV1
API to Generate a Standard Schema v1.Example
#4280
5b471e7
Thanks @fubhy! - AddedDuration.formatIso
andDuration.fromIso
for formatting and parsing ISO8601 durations.#4280
4f810cc
Thanks @tim-smart! - add Effect.filterEffect* apisEffect.filterEffectOrElse
Filters an effect with an effectful predicate, falling back to an alternative
effect if the predicate fails.
Effect.filterEffectOrFail
Filters an effect with an effectful predicate, failing with a custom error if the predicate fails.
Patch Changes
cf8b2dd
Thanks @KhraksMamtsov! -Trie<out A>
type annotations have been aligned. The type parameter was made covariant because the structure is immutable.v3.12.12
Compare Source
Patch Changes
#4440
4018eae
Thanks @gcanti! - Schema: add missing support for tuple annotations inTaggedRequest
.#4439
543d36d
Thanks @gcanti! - Schedule: fix unsafetapOutput
signature.Previously,
tapOutput
allowed using an output type that wasn't properly inferred, leading to potential runtime errors. Now, TypeScript correctly detects mismatches at compile time, preventing unexpected crashes.Before (Unsafe, Causes Runtime Error)
After (Safe, Catches Type Error at Compile Time)
#4447
f70a65a
Thanks @gcanti! - Preserve functionlength
property inEffect.fn
/Effect.fnUntraced
, closes #4435Previously, functions created with
Effect.fn
andEffect.fnUntraced
always had a.length
of0
, regardless of their actual number of parameters. This has been fixed so that thelength
property correctly reflects the expected number of arguments.Before
After
#4422
ba409f6
Thanks @mikearnaldi! - Fix Context.Tag inference using explicit generics#4432
3d2e356
Thanks @tim-smart! - use Map for Scope finalizers, to ensure they are always addedv3.12.11
Compare Source
Patch Changes
#4430
b6a032f
Thanks @tim-smart! - ensure Channel executor catches defects in doneHalt#4426
42ddd5f
Thanks @gcanti! - Schema: add missingdescription
annotation toBooleanFromString
.#4404
2fe447c
Thanks @gcanti! - UpdateforEach
function inChunk
to include missing index parameter.v3.12.10
Compare Source
Patch Changes
#4412
e30f132
Thanks @KhraksMamtsov! - Fix STM unification#4403
33fa667
Thanks @gcanti! - Duration: fixformat
output when the input is zero.Before
After
#4411
87f5f28
Thanks @gcanti! - EnhanceTagClass
andReferenceClass
to enforcekey
type narrowing, closes #4409.The
key
property inTagClass
andReferenceClass
now correctly retains its specific string value, just like inEffect.Service
#4397
4dbd170
Thanks @thewilkybarkid! - Make Array.makeBy dualv3.12.9
Compare Source
Patch Changes
1b4a4e9
Thanks @gcanti! - Fix internal import in Schema.ts, closes #4391v3.12.8
Compare Source
Patch Changes
#4341
766113c
Thanks @fubhy! - ImproveDuration.decode
Handling of High-Resolution Timereadonly
modifier to[seconds: number, nanos: number]
inDurationInput
to prevent accidental modifications.-Infinity
andNaN
when they appear in the tuple representation of duration.#4333
712277f
Thanks @gcanti! - Cron:unsafeParse
now throws a more informative error instead of a generic one#4387
f269122
Thanks @KhraksMamtsov! - A more precise signature has been applied forEffect.schedule
#4351
430c846
Thanks @tim-smart! - fix Layer.scope types to correctly use the Scope tag identifier#4344
7b03057
Thanks @IMax153! - ExposeSchedule.isSchedule
#4313
a9c94c8
Thanks @gcanti! - Schema: UpdateDuration
Encoding to a Tagged Union Format.This changeset fixes the
Duration
schema to support all possible duration types, including finite, infinite, and nanosecond durations. The encoding format has been updated from a tuple (readonly [seconds: number, nanos: number]
) to a tagged union.This update introduces a change to the encoding format. The previous tuple representation is replaced with a more expressive tagged union, which accommodates all duration types:
Rationale
The
Duration
schema is primarily used to encode durations for transmission. The new tagged union format ensures clear and precise encoding for:Duration.infinity
.Example
#4331
107e6f0
Thanks @gcanti! - Schema: Improve encoding inDefect
and add test for array-based defects.#4329
65c11b9
Thanks @gcanti! - Schema: UpdateitemsCount
to allow0
as a valid argument, closes #4328.#4330
e386d2f
Thanks @gcanti! - Add missing overload forOption.as
.#4352
9172efb
Thanks @tim-smart! - optimize Stream.toReadableStreamv3.12.7
Compare Source
Patch Changes
8dff1d1
Thanks @KhraksMamtsov! - Fix: Cannot find name 'MissingSelfGeneric'.v3.12.6
Compare Source
Patch Changes
#4307
289c13b
Thanks @gcanti! - Schema: Enhance error messages for discriminated unions.Before
After
#4298
8b4e75d
Thanks @KhraksMamtsov! - Added type-level validation for theEffect.Service
function to ensure theSelf
generic parameter is provided. If the generic is missing, theMissingSelfGeneric
type will be returned, indicating that the generic parameter must be specified. This improves type safety and prevents misuse of theEffect.Service
function.#4292
fc5e0f0
Thanks @gcanti! - ImproveUnknownException
error messagesUnknownException
error messages now include the name of the Effect api thatcreated the error.
#4309
004fd2b
Thanks @gcanti! - Schema: Enforce Finite Durations inDurationFromNanos
.This update ensures that
DurationFromNanos
only accepts finite durations. Previously, the schema did not explicitly enforce this constraint.A filter has been added to validate that the duration is finite.
#4314
b2a31be
Thanks @gcanti! - Duration: makeDurationValue
properties readonly.#4287
5514d05
Thanks @gcanti! - Array: FixEither
import and correctpartition
example.#4301
bf5f0ae
Thanks @gcanti! - Schema: FixBigIntFromNumber
to enforce upper and lower bounds.This update ensures the
BigIntFromNumber
schema adheres to safe integer limits by applying the following bounds:#4228
3b19bcf
Thanks @fubhy! - Fixed conflictingParseError
tags betweenCron
andSchema
#4294
b064b3b
Thanks @tim-smart! - ensure cause is rendered in FiberFailure#4307
289c13b
Thanks @gcanti! - Schema: Add Support for Infinity inDuration
.This update adds support for encoding
Duration.infinity
inSchema.Duration
.Before
Attempting to encode
Duration.infinity
resulted in aParseError
due to the lack of support forInfinity
inSchema.Duration
:After
The updated behavior successfully encodes
Duration.infinity
as[ -1, 0 ]
:#4300
f474678
Thanks @gcanti! - Schema: updatepluck
type signature to respect optional fields.Before
After
#4296
ee187d0
Thanks @gcanti! - fix: updateCause.isCause
type from 'never' to 'unknown'v3.12.5
Compare Source
Patch Changes
#4273
a8b0ddb
Thanks @gcanti! - Arbitrary: Fix bug adjusting array constraints for schemas with fixed and rest elementsThis fix ensures that when a schema includes both fixed elements and a rest element, the constraints for the array are correctly adjusted. The adjustment now subtracts the number of values generated by the fixed elements from the overall constraints.
#4259
507d546
Thanks @gcanti! - Schema: improve error messages for invalid transformationsBefore
After
#4273
a8b0ddb
Thanks @gcanti! - Schema: Extend Support for Array filters, closes #4269.Added support for
minItems
,maxItems
, anditemsCount
to all schemas whereA
extendsReadonlyArray
, includingNonEmptyArray
.Example
#4257
8db239b
Thanks @gcanti! - Schema: CorrectBigInt
andBigIntFromNumber
identifier annotations to follow naming conventions#4276
84a0911
Thanks @tim-smart! - fix formatting of time zone offsets that round to 60 minutes#4276
84a0911
Thanks @tim-smart! - ensure DateTimeZonedFromSelf arbitrary generates in the range supported by the time zone database#4267
3179a9f
Thanks @tim-smart! - ensure DateTime.Zoned produces valid dates#4264
6cb9b76
Thanks @gcanti! - Relocate theIssue
definition fromplatform/HttpApiError
toSchema
(renamed asArrayFormatterIssue
).#4266
1fcbe55
Thanks @gcanti! - Schema: Replace theTimeZoneFromSelf
interface with a class definition and fix the arbitraries forDateTimeUtcFromSelf
andDateTimeZonedFromSelf
(fc.date({ noInvalidDate: true })
).#4279
d9a63d9
Thanks @tim-smart! - improve performance of Effect.forkInv3.12.4
Compare Source
Patch Changes
#4231
5b50ea4
Thanks @KhraksMamtsov! - fixLayer.retry
andMetricPolling.retry
signatures#4253
c170a68
Thanks @sukovanej! - Use non-enumerable properties for mutable fields ofDateTime
objects.#4255
a66c2eb
Thanks @sukovanej! - Improve DateTime type preservationv3.12.3
Compare Source
Patch Changes
#4244
d7dac48
Thanks @gcanti! - Improve pattern handling by merging multiple patterns into a union, closes #4243.Previously, the algorithm always prioritized the first pattern when multiple patterns were encountered.
This fix introduces a merging strategy that combines patterns into a union (e.g.,
(?:${pattern1})|(?:${pattern2})
). By doing so, all patterns have an equal chance to generate values when usingFastCheck.stringMatching
.Example
#4252
1d7fd2b
Thanks @gcanti! - Fix: CorrectArbitrary.make
to support nestedTemplateLiteral
s.Previously,
Arbitrary.make
did not properly handle nestedTemplateLiteral
schemas, resulting in incorrect or empty outputs. This fix ensures that nested template literals are processed correctly, producing valid arbitrary values.Before
After
#4252
1d7fd2b
Thanks @gcanti! - Fix: AllowSchema.TemplateLiteral
to handle strings with linebreaks, closes #4251.Before
After
v3.12.2
Compare Source
Patch Changes
#4220
734af82
Thanks @KhraksMamtsov! - fix inference for contravariant type-parameters#4212
b63c780
Thanks @KhraksMamtsov! - RefineEffect.validateAll
return type to useNonEmptyArray
for errors.This refinement is possible because
Effect.validateAll
guarantees that when the input iterable is non-empty, any validation failure will produce at least one error. In such cases, the errors are inherently non-empty, making it safe and accurate to represent them using aNonEmptyArray
type. This change aligns the return type with the function's actual behavior, improving type safety and making the API more predictable for developers.#4219
c640d77
Thanks @whoisandy! - fix: ManagedRuntime.Context to work when Context is of type never#4236
0def088
Thanks @tim-smart! - fix color option for Logger.prettyLoggerv3.12.1
Compare Source
Patch Changes
#4194
302b57d
Thanks @KhraksMamtsov! - take concurrentFinalizers option in account inEffect.all
combinator#4202
0988083
Thanks @mikearnaldi! - Remove internal EffectError make sure errors are raised with Effect.fail in Effect.try#4185
8b46be6
Thanks @jessekelly881! - fixed incorrect type declaration in LibsqlClient.layer#4189
bfe8027
Thanks @tim-smart! - ensure Effect.timeoutTo sleep is interrupted#4190
16dd657
Thanks @IMax153! - extendIterableIterator
instead ofGenerator
inSingleShotGen
#4196
39db211
Thanks @mikearnaldi! - Avoid putting symbols in global to fix incompatibility with Temporal Sandbox.After speaking with James Watkins-Harvey we realized current Effect escapes the Temporal Worker sandbox that doesn't look for symbols when restoring global context in the isolate they create leading to memory leaks.
v3.12.0
Compare Source
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.NonEmptyArrayPatch Changes
e1eeb2d
Thanks @mikearnaldi! - Carry both call-site and definition site in Effect.fn, auto-trace to anonv3.11.10
Compare Source
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:#4175
199214e
Thanks @gcanti! - Schema: refactor annotations:Export internal
Uint8
schemaExport internal
NonNegativeInt
schemaRemove 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
After
toString
now combines all refinements with" & "
instead of showing only the last one."Expected ..."
) now uses the extended description to make the error message clearer.#4182
b3c160d
Thanks @mikearnaldi! - Replace absolute imports with relative onesv3.11.9
Compare Source
Patch Changes
#4113
1c08a0b
Thanks @thewilkybarkid! - Schema: Support template literals inSchema.Config
.Example
#4174
1ce703b
Thanks @gcanti! - Schema: Add support forTemplateLiteral
parameters inTemplateLiteral
, closes #4166.This update also adds support for
TemplateLiteral
andTemplateLiteralParser
parameters inTemplateLiteralParser
.Before
After
#4174
1ce703b
Thanks @gcanti! - Schema: Fix bug inTemplateLiteralParser
where unions of numeric literals were not coerced correctly.Before
After
v3.11.8
Compare Source
Patch Changes
1a6b52d
Thanks @gcanti! - Arbitrary: optimize date-based refinementsv3.11.7
Compare Source
Patch Changes
#4137
2408616
Thanks @gcanti! - Arbitrary: fix bug where refinements in declarations raised an incorrect missing annotation error, closes #4136#4138
cec0b4d
Thanks @gcanti! - JSONSchema: ignore never members in unions.Before
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.