Update Effect to v4.0.0 - #241
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
4.0.0-rc.118→4.0.04.0.0-rc.118→4.0.0Release Notes
Effect-TS/effect (@effect/platform-node)
v4.0.0Compare Source
Patch Changes
#8598
988c467Thanks @tim-smart! - Close server WebSockets with 1000 on success, 1001 on interruption, or 1011 on failure, while preserving explicit close codes. HTTP request scopes retain the handler's failure exit through response handling and middleware.#8633
2c552f2Thanks @IMax153! - Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the4.0.0-beta.*and4.0.0-rc.*headings. To upgrade from Effect 3, follow the migration guide.Packaging and versioning
effectand every@effect/*package.@effect/platform,@effect/rpc,@effect/cluster,@effect/cli,@effect/ai,@effect/sql,@effect/workflow,@effect/experimentaland similar packages are merged intoeffect. Separate packages remain only for platforms (@effect/platform-*), SQL drivers (@effect/sql-*), AI providers (@effect/ai-*), framework bindings (@effect/atom-*), OpenTelemetry, Vitest and tooling.effect/http,effect/http-api,effect/rpc,effect/cluster,effect/workflow,effect/ai,effect/cli,effect/sqlandeffect/schemaimport fromeffect/<area>. APIs tagged@stability unstablemay have breaking changes in minor releases. APIs without a stability tag follow semver.@stability unstable, because that dependency's releases can change them. This coversNodeRedis,DenoRedis,BunRedis,@effect/platform-node/Undiciand the undici dispatcher APIs, thewsoptions and re-exports in the platform packages, driver-specific options and clients in@effect/sql-clickhouse,@effect/sql-d1,@effect/sql-libsql,@effect/sql-mssql,@effect/sql-mysql2,@effect/sql-pgliteand@effect/sql-sqlite-do, the provider clients, models and generated schemas in the@effect/ai-*packages,@effect/opentelemetry, and thevitestre-export in@effect/vitest.effecthas no runtime dependencies.@effect/platform-deno,@effect/sql-pglite,@effect/ai-openai-compat,@effect/ai-typesafe,@effect/atom-react,@effect/atom-solid,@effect/atom-vue,@effect/openapi-generatorand@effect/doctest.@effect/docgennow lives in this repository.Core
Context.Service,FiberRefis replaced byContext.Reference,Causehas a flat structure, and many combinators were renamed. See the migration guide for the full list.Effect.tx, withTxRef,TxQueue,TxHashMap,TxPubSub,TxSemaphoreand relatedTx*data types.Clockseparates wall-clock time from monotonic time.Semaphore,Latch,LayerRef,ErrorReporter,ByteSize,NewtypeandCrypto.Arbitraryis now a native property-based testing module and no longer depends on fast-check.Schema
makeconstructors on every schema, and effectful decoding with services.SchemaRepresentationpowers JSON Schema (Draft-04, Draft-07, 2020-12 and OpenAPI 3.0/3.1) import and export, TypeScript code generation, and AI structured output.SchemaBinaryprovides a compact binary codec and is the default wire format for cluster transports.Platform, HTTP and RPC
HttpApisupports typed response headers, streaming and SSE responses, the HTTPQUERYmethod,HttpApiTestfor in-memory testing, and much faster type checking for large APIs.Sockethas a pull-based reader with backpressure and STARTTLS support. Network addresses are modeled byeffect/net.@effect/platform-denoadds full Deno support. The Node, Bun, Deno and browser packages all provide the platformCryptoservice, and the browser package adds IndexedDB support.Cluster and Workflow
DurableQueueand an in-memoryWorkflowEngineare available.ShardingConfiglimits. Shutdown, entity movement and persisted replies are more reliable.SQL
@effect/sql-pguses a built-in PostgreSQL client with pipelining, prepared statements and binary codecs, and no longer depends onpg.@effect/sql-sqlite-nodeuses Node's built-innode:sqliteand requires Node 22.16 or newer.SqlErrorexposes structured reasons such asUniqueViolation.AI
effect/aiaddsEmbeddingModel, theDecisionModelclassification and rating API, dynamic tools and tool approvals.CLI, Atom, observability and testing
effect/cliadds global flags, command aliases and examples, an interactive wizard mode, and shell completions for Bash, Zsh and Fish.effect/reactivityand the@effect/atom-*bindings add SSR hydration, stale-while-revalidate atoms and serializable RPC and HttpApi queries.@effect/opentelemetryaligns logs and spans with the OpenTelemetry specification.@effect/vitestruns property tests with the nativeArbitrarymodule and supports Vitest fixtures.Requirements
@effect/vitestand@effect/doctestrequire Vitest 5.@effect/atom-reactrequires React 19.@effect/platform-denorequires Deno 2.8.3 or newer.Updated dependencies [
cbfc7b4,5a81a6f,68b6394,5250ca6,5f9c9d1,3278821,83429b4,0af6d0c,927e01e,10d8524,35ac25a,29e0aa7,8783536,df77fff,ef7d77f,035e369,f72790c,aa19472,988c467,735b77b,e5f7d12,2c552f2]:Effect-TS/effect (effect)
v4.0.0Compare Source
Patch Changes
#8580
cbfc7b4Thanks @gcanti! - RestrictSchema.brandto a single concrete identifier and requireSchema.fromBrandto use the constructor's sole brand key. ApplybrandorfromBrandrepeatedly when composing distinct brands. For enum brand keys, pass the enum member instead of its string value.#8601
5a81a6fThanks @RizgarOzan! - Prevent a staleAtom.familyfinalizer from evicting a newer cached atom.#8576
68b6394Thanks @tim-smart! - Prevent stale concurrent workflow resumes from clearing a newer completed reply. Custom message storage implementations must honor the optional expected reply ID onclearRepliesto provide this safety guarantee.#8589
5250ca6Thanks @marek-hanzal! - Fix lost synchronous successes and failures in concurrentAtom.fncalls.#8625
5f9c9d1Thanks @tim-smart! - FixMutableHashMapretaining previously used equal object keys after they are replaced or removed, including whenCacheandScopedCacherefresh entries on hits.#8619
3278821Thanks @tim-smart! - KeepQueue.takeNsuspended when only part of its requested batch is available. Previously a single offer woke the batch taker in a synchronous retry loop that starved the host.Queue.State.takersnow holdsQueue.Takerentries: callentry.resume(...)instead of calling the entry as a function.#8607
83429b4Thanks @mannyc2! - Interrupt losers inEffect.race,Effect.raceFirst,Effect.raceAllandEffect.raceAllFirstwhen the race settles or is interrupted while other effects are still starting.#8626
0af6d0cThanks @tim-smart! - TheRpcMessage.ExitEncodedinterruptfiberIdtype now admits thenullemitted by JSON encoding. Consumers reading encoded interrupts should handlenullalongsideundefined.#8614
927e01eThanks @gcanti! - FixSchemaRepresentation.toCodeDocumentto preserve the grouping of branded union types in generated TypeScript code.#8617
10d8524Thanks @gcanti! - FixSchema.toTypeandSchema.toEncodedlosing parent checks when projecting checked children without transformations. Suspended children remain opaque, and structural checks continue to be preserved.#8583
35ac25aThanks @KhraksMamtsov! -Array,Chunk,Effect, andRecordpartition, theirseparatehelpers, andOption.partitionMapnow return successes before failures, matchingStream.partition. Swap the tuple when moving from the previous[failures, successes]order.#8585
29e0aa7Thanks @roninjin10! - Preserve sibling and callback cleanup failures alongside interruption in concurrentEffect.forEach/Effect.all, including sharedLayer.build.#8593
8783536Thanks @tim-smart! - Fail in-flight RPC calls when a socket misses a pong, even with transient connection retries enabled. Missed pongs no longer invokeonTransientError; connection-open failures still do.#8579
df77fffThanks @jasonkuhrt! - Fix union-of-tag inference for flat RPC clients andAtomRpc.queryandAtomRpc.mutation. Payloads and results now reflect the selected RPCs instead of resolving tonever.#8628
ef7d77fThanks @gcanti! - MakeSchema.brandtype-only: brand identifiers are no longer stored in AST annotations or preserved bySchemaRepresentation. ReapplySchema.brandafter rebuilding a representation when a branded TypeScript type is required; checks added bySchema.fromBrandremain preserved. Preserve the order of equal-priority union members that share an AST when deriving JSON and string-tree codecs.#8597
035e369Thanks @Ceereals! - Speed up JIT and AOT Schema decoding of transformations whose source has checks, such as a pattern-checked string decoded to a number. Fix compiled TemplateLiteral validation to enforce oneOf parts and preserve interpreter diagnostics when templates appear in transformation chains.#8630
f72790cThanks @gcanti! - Fix duplicate references in decoded and encoded schema representations when reusing schemas through optional or mutable keys.#8555
aa19472Thanks @front-depiction! - Resolve a Schema union's candidate parsers once per union instead of on every decode, so union decoding and encoding allocate less and run faster.#8598
988c467Thanks @tim-smart! - Close server WebSockets with 1000 on success, 1001 on interruption, or 1011 on failure, while preserving explicit close codes. HTTP request scopes retain the handler's failure exit through response handling and middleware.#8632
735b77bThanks @gcanti! - AddsucceedEffect,failEffect, andverifyRoundTripEffecttoTestSchemaso assertions can use the calling Effect's services, test clock, and interruption, and mark the module and its public APIs as unstable. Preserve defects and interruption when they occur alongside schema validation failures. RenameverifyLosslessTransformationtoverifyRoundTrip; existing callers must update to the new name.#8575
e5f7d12Thanks @tim-smart! - Retry failed workflow run resets instead of acknowledging deferred completion before the run resumes.#8633
2c552f2Thanks @IMax153! - Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the4.0.0-beta.*and4.0.0-rc.*headings. To upgrade from Effect 3, follow the migration guide.Packaging and versioning
effectand every@effect/*package.@effect/platform,@effect/rpc,@effect/cluster,@effect/cli,@effect/ai,@effect/sql,@effect/workflow,@effect/experimentaland similar packages are merged intoeffect. Separate packages remain only for platforms (@effect/platform-*), SQL drivers (@effect/sql-*), AI providers (@effect/ai-*), framework bindings (@effect/atom-*), OpenTelemetry, Vitest and tooling.effect/http,effect/http-api,effect/rpc,effect/cluster,effect/workflow,effect/ai,effect/cli,effect/sqlandeffect/schemaimport fromeffect/<area>. APIs tagged@stability unstablemay have breaking changes in minor releases. APIs without a stability tag follow semver.@stability unstable, because that dependency's releases can change them. This coversNodeRedis,DenoRedis,BunRedis,@effect/platform-node/Undiciand the undici dispatcher APIs, thewsoptions and re-exports in the platform packages, driver-specific options and clients in@effect/sql-clickhouse,@effect/sql-d1,@effect/sql-libsql,@effect/sql-mssql,@effect/sql-mysql2,@effect/sql-pgliteand@effect/sql-sqlite-do, the provider clients, models and generated schemas in the@effect/ai-*packages,@effect/opentelemetry, and thevitestre-export in@effect/vitest.effecthas no runtime dependencies.@effect/platform-deno,@effect/sql-pglite,@effect/ai-openai-compat,@effect/ai-typesafe,@effect/atom-react,@effect/atom-solid,@effect/atom-vue,@effect/openapi-generatorand@effect/doctest.@effect/docgennow lives in this repository.Core
Context.Service,FiberRefis replaced byContext.Reference,Causehas a flat structure, and many combinators were renamed. See the migration guide for the full list.Effect.tx, withTxRef,TxQueue,TxHashMap,TxPubSub,TxSemaphoreand relatedTx*data types.Clockseparates wall-clock time from monotonic time.Semaphore,Latch,LayerRef,ErrorReporter,ByteSize,NewtypeandCrypto.Arbitraryis now a native property-based testing module and no longer depends on fast-check.Schema
makeconstructors on every schema, and effectful decoding with services.SchemaRepresentationpowers JSON Schema (Draft-04, Draft-07, 2020-12 and OpenAPI 3.0/3.1) import and export, TypeScript code generation, and AI structured output.SchemaBinaryprovides a compact binary codec and is the default wire format for cluster transports.Platform, HTTP and RPC
HttpApisupports typed response headers, streaming and SSE responses, the HTTPQUERYmethod,HttpApiTestfor in-memory testing, and much faster type checking for large APIs.Sockethas a pull-based reader with backpressure and STARTTLS support. Network addresses are modeled byeffect/net.@effect/platform-denoadds full Deno support. The Node, Bun, Deno and browser packages all provide the platformCryptoservice, and the browser package adds IndexedDB support.Cluster and Workflow
DurableQueueand an in-memoryWorkflowEngineare available.ShardingConfiglimits. Shutdown, entity movement and persisted replies are more reliable.SQL
@effect/sql-pguses a built-in PostgreSQL client with pipelining, prepared statements and binary codecs, and no longer depends onpg.@effect/sql-sqlite-nodeuses Node's built-innode:sqliteand requires Node 22.16 or newer.SqlErrorexposes structured reasons such asUniqueViolation.AI
effect/aiaddsEmbeddingModel, theDecisionModelclassification and rating API, dynamic tools and tool approvals.CLI, Atom, observability and testing
effect/cliadds global flags, command aliases and examples, an interactive wizard mode, and shell completions for Bash, Zsh and Fish.effect/reactivityand the@effect/atom-*bindings add SSR hydration, stale-while-revalidate atoms and serializable RPC and HttpApi queries.@effect/opentelemetryaligns logs and spans with the OpenTelemetry specification.@effect/vitestruns property tests with the nativeArbitrarymodule and supports Vitest fixtures.Requirements
@effect/vitestand@effect/doctestrequire Vitest 5.@effect/atom-reactrequires React 19.@effect/platform-denorequires Deno 2.8.3 or newer.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.