github Effect-TS/effect effect@4.2.1

Thanks to these issue reporters

Patch Changes

  • #11525 137488f - Fix Arbitrary.checkEffect getting stuck at size zero when filtering inputs such as nonblank strings.

    Speed up generation and shrinking of strings constrained by regular expressions by reusing the lengths a pattern can match.

    Speed up generation of large records by tracking the keys already generated.

  • #11529 185e1b2 - Fix Array.sort, Array.sortBy, Chunk.sort, Chunk.sortWith, and TxPriorityQueue to honor the supplied ordering for undefined elements. Calling Array.sortBy() without orders now preserves the position of undefined.

  • #11383 9fadb28 - Add AtomRegistry.has to check for a staged or initialized value by atom or serialization key without evaluating the atom. Use get.registry and self in Atom.withServerValue callbacks to check availability before reading.

  • #11616 7c1bea3 - Keep only value and scale enumerable on a BigDecimal, even after formatting or normalization. Recursive property walks such as Prisma argument cloning no longer encounter the cache's circular reference.

  • #11363 5f90ce2 - Preserve keyboard focus when a bound UI child moves to an earlier slot and leaves its previous container empty.

  • #11639 689c02a - Fix BrowserRouter stopping short of the saved scroll position on back and forward while web fonts load. It now scrolls there again once they load, unless the reader, the page or a navigation moves on.

  • #11638 752afdf - BrowserRouter restores the scroll position after a reload and on back or forward from another document.

  • #11550 ac42f3e - Fix lost invalidations and duplicate lookups when Cache.get or Cache.refresh starts a lookup.

  • #11527 55a72c3 - CLI orElse and orElseResult now report invalid primary input instead of using a default when the alternate parameter is absent.

  • #11548 a2c046d - Include enabled built-in flags, such as --help and --version, and declared global flags in effect/cli shell completions for root commands and subcommands. Built-in suggestions respect CliConfig.builtIns.

  • #11530 380deae - Report a CliError.ValidationError with the validation message instead of a defect when filter, filterMap, mapTryCatch, or withSchema rejects the selected value of flags or arguments combined with orElse.

  • #11570 4a73ee7 - Fix Collapsible snapping shut instead of transitioning its height when closing under HtmlScheduler load.

  • #11576 5925eab - Preserve keyboard highlighting in Combobox and Autocomplete when the list opens or scrolls under a stationary pointer. Moving the pointer over the list enables hover highlighting again.

  • #11354 ede8aff - Fix DateField swapping the day and month when pasting a displayed date with localized digits in yyyy-dd-mm locales. The display now uses slashes to avoid ambiguity with ISO input, which remains supported.

  • #11345 da11bcf - Fix DateTime.endOf returning a timestamp in the next period when a forward time zone transition skips the period’s final wall-clock millisecond. It now returns the last instant before the gap.

  • #11524 9e4f4d8 - Fix DateTime.format to use the DateTime's zone when timeZone is undefined.

  • #11611 c44cb5d - Fix DateTime.make and DateTime.makeUnsafe failing on zoneless 12-hour time strings such as "1/15/2024 10:00 PM", which are now read as UTC.

  • #11544 1d2503c - Reject out-of-range and malformed numeric UTC offsets in DateTime.zoneFromString.

  • #11380 9ec4335 - Fix a Dialog or Drawer drawn under a closed Dialog or Drawer, such as one wrapping the app shell, losing its backdrop. It now nests only while a dialog above it is open, and a Drawer with nested: false is no longer counted by its parent.

  • #11528 9b0318b - Keep Tab and Shift+Tab inside a focus-trapping Dialog when focus is on static content, such as a non-tabbable initialFocus element.

  • #11581 d29a7ff - Close a direct Subscription that stops itself during attach, preventing it from starting and leaking resources.

  • #11632 db738d6 - Stop an element's onMount when a render drops it while a headless part's mount stays.

  • #11384 944a57d - Add Replier.withParentSpan so Entity.toLayerQueue handlers can run work under a dequeued request's RPC server span.

  • #11445 974e748 - Equal.equals and Hash.hash now compare and hash DOM nodes and ranges by reference instead of walking the document.

  • #11326 3041a0e - Add experimental FiberDiagnostics to inspect live fibers, their parents and waits, and defects from fibers without observed waiters. It also counts lifecycle events, reports quiet periods, and lets finishing fibers settle before inspection.

  • #11523 130f0a7 - Fix ResizeObserver loop errors in WebKit when a popup positioned by Positioning.trackPosition resizes and flips with a CSS height cap.

  • #11374 970aefa - Fix VirtualList emitting ResizeObserver loop completed with undelivered notifications. on mount.

  • #11493 0b68f84 - TypeScript now rejects providers with events in Component.provide, which has no event handlers. Place these providers in a view with onEmit.

  • #11357 7adc41d - Keep finalized HashMap snapshots unchanged after later updates or removals in the source batch.

  • #11424 ec88772 - HtmlHead.link now omits nonce and event attributes supplied through extra runtime keys. The html.data and body.data records now emit only valid data-* attributes, excluding the host-managed data-eui marker.

  • #11546 e240163 - Fix controlled <textarea> fields becoming blank after SSR hydration with HtmlHydrate, so displayed text and form submissions retain the model's value.

  • #11572 89a9b77 - Preserve user edits to controlled form fields in effect/ui/html while hydration waits for a component's Layer, and deliver those edits to its event handlers when the Layer is ready.

  • #11545 04cf7e7 - HtmlLocator role queries now exclude content inside a closed <details> outside its first <summary> child. Pass { hidden: true } to include collapsed content.

  • #11633 4bc9081 - Add HtmlMount.OnScreen to effect/ui/html, a mount that reports whether an element is on screen as it enters and leaves the viewport.

  • #11565 0cea0d5 - Move focus into dialogs opened with .modal(true) or .open(true) in TestHtmlHost and HtmlPlay, so press reaches their key handlers. Restore the previously focused element on close when it remains focusable; non-modal dialogs restore focus only if focus is still inside them.

  • #11448 dee39a3 - HtmlServer.document now adds the CSP nonce, from HtmlServer.Nonce through the new Rendered.nonce or from { nonce } ("" suppresses it), to the hydration state script, and replaces noncePlaceholder in the template with it. virtual:effect/ui/document defaults noncePlaceholder to Vite's html.cspNonce, while direct callers pass their own.

  • #11427 c4c4718 - Fix HtmlServer output for SVG and MathML so the browser preserves text in elements such as style and script. Elements such as source now have closing tags, preventing later siblings from becoming their children.

  • #11514 146d80b - Fix HtmlServerVite builds with serverOutDir so requests for a non-prerendered / reach the server handler on hosts that serve static files first.

  • #11426 f24695a - Html.style() now omits properties whose names contain ASCII characters other than letters, digits, - and _, including CSS escapes, so a key can no longer add declarations.

  • #11536 097a8ce - Add a raw option to HttpServerResponse.fromWeb that hands the original ReadableStream to the runtime instead of converting it through an Effect stream.

  • #11551 7a6a937 - Fix HttpApiClient payload encoding so HttpApiSchema.NoContent sends an empty body only when the payload is omitted.

  • #11620 1ceb7ba - Fix UI hydration to preserve server-rendered nodes while a Feature's Layer or a lazy child's module loads, avoiding fallback flashes and duplicate content.

  • #11549 3934b5d - Fix HtmlHydrate so pre-hydration edits to uncontrolled form fields reach their event handlers whether adoption is immediate or waits for a Layer.

  • #11420 5a0b59a - Close the source iterator when iteration over Iterable.map stops early, so generator finally blocks run.

  • #11543 15a81d7 - JSON-RPC serializers now encode connection-level defects with id: null and the standard -32603 "Internal error" code.

  • #11325 b8f21e3 - Show a focus ring when effect/ui/kit components move focus after switching from pointer to keyboard input. For example, pressing Enter on a hovered menu item now shows a focus ring on the button focused in the dialog it opens.

  • #11629 434d16c - Select, Menu and Combobox no longer handle or cancel keys held with Alt, Ctrl or Meta, such as Alt+ArrowLeft or Ctrl+Escape, so browser and app shortcuts keep working.

  • #11636 1f5711f - A required effect/ui/kit Checkbox, Switch or RadioGroup now blocks native form submission until checked or picked, and a Switch disabled after its root part, such as by a disabled Field, now disables its button and submits nothing.

  • #11485 024ae7a - Fix initially open modal Dialogs inside Component.lazy ignoring pointer input. The lazy child's beforeCommit mounts now start after its nodes are placed in the document.

  • #11567 e3e47f5 - Speed up Markdown parsing for deeply nested lists with long runs of indentation.

  • #11627 0d15b29 - Keep a bare email address as plain text in Markdown when its @ is escaped with a backslash or a character reference.

  • #11575 807d198 - Omit HTML comments outside code in MarkdownParser, so strict parsing accepts them and lenient parsing no longer displays them as text.

  • #11404 17508cf - Add inline Markdown islands such as :Name[label]{key="value"} in prose and table cells through the inlineIslands option in MarkdownParser, MarkdownVite and Markdown.view. Update explicit island-content annotations from ReadonlyArray<View.Content<Msg>> to Markdown.InlineContent<Msg>, and replace ::Name{...} inside prose or table cells with :Name{...} because strict parsing now rejects block islands there.

  • #11628 e57c473 - MarkdownParser keeps content made only of Unicode spaces such as U+00A0, trimming only spaces and tabs as CommonMark does.

  • #11430 685a5ae - Fix quadratic Markdown parsing on long words and whitespace runs, unclosed constructs, and repeated autolink candidates. Link destinations with more than 32 levels of nested parentheses now remain plain text.

  • #11428 6846b34 - Limit Markdown block and inline nesting to 100 levels in total to prevent stack overflows. parseMarkdown throws a line-aware ParseError beyond the limit; parseMarkdownLenient reports the line and recovers the excess syntax as text.

  • #11603 7759c84 - Fix code block and island occurrence indices in Markdown.view and Markdown.viewBlocks when an earlier enclosing island has no registered view.

  • #11388 43a8e28 - Use ordered { files, schema } rules in MarkdownVite's frontmatter option to validate blog posts and docs pages with different schemas. The first rule that selects a file applies.

  • #11560 c92741f - Preserve metadata in MCP elicitation forms so clients receive enum option descriptions and extension fields such as x-openai-thumbnail.

  • #11561 7824816 - On MCP 2026-07-28, McpTest.callTool and McpTest.getPrompt now fail with McpSchema.InputRequired instead of a decoding defect when a handler pauses for input. Callers can resume by passing inputResponses and the unchanged requestState.

  • #11618 173fad8 - Stop Menu items from registering pointerenter and pointerleave handlers when highlightItemOnHover is false.

  • #11555 c7af8a1 - Allow Enter, Space, or the opening arrow key on a hover-opened Menu submenu's trigger to focus its first enabled item. The submenu stays open when the pointer leaves.

  • #11522 c636378 - Menu typeahead now focuses disabled items, just like arrow-key navigation. Disabled items still cannot be picked.

  • #11372 7673e7f - Fix MessageLog encoding so cyclic references in Schema.Any values appear as placeholders in DevTools. Serializable sibling fields and subsequent batch entries still reach DevTools.

  • #11323 d3449a2 - Keep focus inside a modal Dialog when a press outside its popup, such as on the backdrop, would otherwise move focus to the page body.

  • #11431 16a1f55 - Fix lost shared state updates when a subtree moves under a different parent element. Nested Dialog and Drawer counts now stay accurate after the move.

  • #11419 75fac0b - Fix Number.round changing large integers or returning Infinity when rounding to decimal places.

  • #11375 f54da63 - Update cluster entity RPC dashboard and alert filters from span names like Cart.client.get and Cart.get to Cart/get, and from rpc.method = get to rpc.method = Cart/get. Replace entity.type with effect.cluster.entity.type (now on both client and server spans) and entity.id with effect.cluster.entity.id (server spans).

  • #11498 93129aa - Add Query.reconnecting so stream queries can keep the last value visible with waiting: true while retrying a connection.

  • #11453 f543daa - Add Query.Result<R> to effect/ui for a query's AsyncResult type, and move Args, Success and Error to the top of the Query module so they read Query.Args<R>, Query.Success<R> and Query.Error<R>.

  • #11630 d9b1197 - Add server: false to Query.Service, Query.InfiniteService and Query.StreamService to keep a query out of server renders; the client fetches it after hydration.

  • #11352 ca58e68 - Fix Record.filter and Record.findFirst to return the values accepted by their predicates.

  • #11577 30bf5a3 - Add Renderer.onFlush for scope-bound callbacks before renderer writes and after the following commit, so layout libraries can measure nodes before and after they move.

  • #11461 790f896 - Snap positioned popup left and top coordinates in trackPosition to the nearest device pixel so popups next to fractional anchors do not render blurred text or borders.

  • #11422 ddf3973 - Make trailing-slash normalization and repeated query-key parsing linear in Route.resolve.

  • #11578 d43291d - Fix Route.resolve falling back to the catch-all for malformed percent-escapes in undeclared query parameters. Declared fields with malformed values are reported in invalid for URL cleanup if they can decode as absent; otherwise, resolution still falls back to the catch-all.

  • #11626 9c32ec9 - Route printing now throws for a :name param of "", "." or "..", instead of emitting a URL that parses to another route.

  • #11385 ad1e44b - Add Router.awaitPrefetch and router.awaitPrefetch to wait for declared queries and lazy page and child walks without repeating their declarations. The Command returns "ready" when queries settle, including failures, or "timedOut" when its optional timeout elapses; a timeout leaves prefetches running.

  • #11479 2d3c0e2 - Prevent the effect/ui Router from loading URLs with javascript: or vbscript: schemes.

  • #11594 6b52ca1 - Fix navigation commands targeting the wrong Router when multiple routers share a layer memo map.

  • #11569 dbb3fb5 - Fix BrowserRouter losing saved drafts on Back after native fragment navigation in hash and path modes. Blocked fragment navigation now returns to the previous history entry.

  • #11378 2c3dc96 - Fix Router.prefetch failing on pages that read shared atoms or shared state from ancestor components. Shared atoms use the declaring component's AtomRegistry; readers behind Component.provide are skipped without an error when that registry is absent.

  • #11568 621b46f - Fix RouterStack.follow after reloading on a later browser history entry: Back now unmounts the popped screen, and Replace updates the current screen without growing the stack.

  • #11563 27e8b06 - Add strict to the RpcSerialization JSON-RPC serializers for plain JSON-RPC 2.0 peers. McpServer now uses it, so error responses no longer include Effect causes.

  • #11358 17e4433 - Fix Schedule.min so completed child schedules stay inactive for the current run and cannot shorten the combined delay.

  • #11356 2e82db1 - Fix Schema.withDecodingDefaultKey and Schema.withDecodingDefaultTypeKey to apply defaults only when the key is absent.

  • #11165 61f5f28 - Fix the inferred optionality and mutability of fields projected with Schema.toType or Schema.toEncoded to match the selected side.

  • #11557 aaaebd6 - Preserve keyboard focus in Select when scroll arrows appear or disappear, so users can continue navigating and selecting options with the keyboard.

  • #11433 f116db0 - Use the reader's path to find shared-state owners when binding reads and handling $.send in effect/ui, avoiding a scan of every owner in the tree.

  • #11393 af82398 - Drag SortableList rows with touch, pen or mouse. Move rows between lists, including empty ones, with SortableGroup, or with Sortable.TrackDrag when each list is a separate component.

  • #11423 890703f - Reject subsequent SQL statements and nested transactions inside withTransaction after SQLite rolls back the transaction, even if the rollback error is caught. This prevents later writes from autocommitting outside the transaction.

  • #11564 8f0ab8e - Make Ssr.ssr fail with SsrError when the root component crashes on the server or client, or a server-rendered instance's Model cannot be encoded for hydration.

  • #11552 3c0775c - Stop EntityReaper from scheduling periodic sleeps when no entities are resident, and SQL PersistedQueue from doing so when no elements are held. This avoids unnecessary timer wakeups during long TestClock advances.

  • #11631 ce3637c - Add expectViewTransition, expectNoViewTransition and current.viewTransition to Story and Scene tests, to check the view transition a step asked for.

  • #11600 d9ff071 - Fix Stream.throttle with the "enforce" strategy admitting chunks early when the system clock moves backward. Positive refill intervals now use monotonic time.

  • #11586 95f4513 - Bound matching time for Schema.TemplateLiteral and Schema.TemplateLiteralParser with combinations of literals, plain strings, and plain numbers.

  • #11470 6b92640 - Keep an empty slot in Markdown.viewBlocks for top-level islands that render nothing, so returned nodes stay aligned with document.blocks.

  • #11319 96292e8 - Add swipeLock, swipeVelocityType, and swipeResistance props to ToastProvider to configure swipe axis lock, velocity calculation, and resistance. Swipe.TrackSwipe gains the matching lock, velocityType, and resistance options.

  • #11327 e6cc037 - A finger or pen tap anywhere in the ToastProvider viewport now keeps toasts expanded and pauses dismissal timers, including taps on buttons or a lone toast. Tap expansion ends when any pointer presses outside the viewport, the last toast closes or limit becomes 0.

  • #11463 0760ed7 - When closeOnClick is false, Tooltip no longer intercepts trigger clicks, allowing the element's own click handler or its nearest clickable ancestor to handle them.

  • #11462 550e46c - Add keepOpenWhenFocused to Tooltip, defaulting to true so keyboard focus keeps the tooltip open after the pointer leaves. Set it to false to allow closing after closeDelay while the trigger remains focused.

  • #11491 fdf527f - Mark all effect/ui modules as @stability experimental, so they may receive breaking changes in patch releases.

  • #11502 e1776c4 - Speed up the first update after an effect/ui list is built by skipping unchanged subtrees with no controlled properties.

  • #11582 1eb42bd - Add HtmlHead.style for deduplicated inline styles with server CSP nonces supplied through HtmlServer.renderToHtml's nonce option or HtmlServer.Nonce. Hydration reuses server styles and retains their nonce for client-created styles.

  • #11542 4776d67 - Add UiHttpApi to define Query and Command services from HttpApi endpoints with derived schemas. Transport and decode failures become HttpApiClientError values that serialize without URLs, headers or response bodies; declared endpoint and middleware errors remain unchanged and must be safe to expose.

  • #11574 d752121 - Avoid evaluating subscriptions twice when a Component.provide key changes on a component without queries. Subscriptions restart against the replacement Layer in their latest declared order.

  • #11591 2a7f125 - Fix hoverable Tooltip, PreviewCard, and NavigationMenu popups in shadow roots so they stay open while the pointer crosses the safe triangle and close when it leaves the hover area. A PreviewCard in a shadow root now detects trigger removal without closing when unrelated elements change elsewhere on the page.

  • #11444 af34ab8 - Preserve DOM nodes the renderer did not place, such as a Mount's, when clearing or fully replacing an element's rendered children.

  • #11496 6ef3991 - effect/ui turns off its development checks and hot-reload runtime when NODE_ENV is production, so production servers and clients render the same views.

  • #11499 fcf6af9 - Add onPropsChange to a component's make to turn prop changes into messages, so component authors can update the model before the next render without rebuilding the component.

  • #11418 3f23c48 - Preserve own __proto__ fields in UiStruct.evolve and component $.evolve results, logged message and command arguments, and HtmlHead.jsonLd output.

  • #11392 3925903 - Add p.part(base, decorate) to headless components, which decorates an existing part, such as a child's, with the component's own attributes and handlers while keeping its signature: popup: p.part(dialog.popup, (b) => b.class("dialog-popup")).

  • #11495 ae56028 - Rename the reads entry key owner to provider in effect/ui. Rename Component.SharedOwner to Component.SharedProvider and Component.Shared.Owner to Component.Shared.Provider.

  • #11621 b1f044e - Pass the mount argument stream to Renderer.Host.runsMounts callbacks. Add Mount.run and expose argsSchema so hosts can encode arguments and run a local mount factory with forwarded updates.

  • #11450 ff0b99e - Prevent effect/ui routing from generating URLs that redirect to another origin or traverse outside the base path.

  • #11634 602611a - Add UiRpc to define Query, stream Query and Command services from RpcGroup RPCs, mapping client transport failures to a UiRpcError that serializes without URLs, bodies or causes.

  • #11510 6185b03 - Reduce the bundle size of effect/ui apps that use Query or MessageLog.

  • #11566 83c4637 - Fix initially open Dialog components rendered by Component.lazy ignoring pointer input on first open. The dialog now accepts input while the background stays inert.

  • #11452 583d9bc - Fix effect/ui server rendering to preserve attribute casing for elements in the SVG namespace and lowercase attribute names for HTML elements such as <use> inside <foreignObject>.

  • #11347 38f2c71 - Fix effect/ui URL filtering so uppercase and mixed-case SVG attributes cannot bypass javascript: and vbscript: checks. Matching ignores ASCII case while preserving the spelling of permitted SVG attributes.

  • #11390 8f433ed - Add shared-state providers to Component.provide lists alongside Layers. Providers can derive their props from the host's props and Model.

  • #11417 4e80607 - Make Validation.Rule.email() and Validation.Rule.url({ requireProtocol: false }) reject long malformed values in linear time while preserving the accepted inputs.

  • #11623 c6614e7 - Add firstOffset to VirtualList and VirtualGrid scroll events and an offset to Index and Key scroll targets, so a remounted list can return to the same place inside an item. Code that builds Scrolled values or sends Virtualizer's ScrolledViewport must now supply firstOffset and anchor (or null).

  • #11559 3757065 - Fix VirtualList with followEnd snapping back to the end after a small scroll up when sharing a viewport with ScrollArea or receiving other updates that leave the end unchanged.

  • #11344 d630c1d - Improve MixedScheduler yield performance in Safari/WebKit by using MessageChannel to avoid nested-timer delays. This fallback applies to browser pages and dedicated workers with MessageChannel available but no setImmediate or scheduler.postTask.

  • #11362 0a8f086 - Discard buffered outgoing worker messages in Worker.makePlatform when a worker run exits so stale requests from a failed run are not sent to replacement workers.

  • #11421 5073089 - Fix Sink.fromWritableStream and Channel.fromWritableStream hanging when the destination errors while waiting for upstream input.

  • #11406 d9fe5d6 - Preserve inherited namespace bindings on elements collected by Xml.elements after decoding with namespaces: "strict". Add Xml.attribute to read attributes by namespace URI and local name, and Xml.resolveQName to resolve qualified names in values; both require strict decoding.

Don't miss a new effect release

NewReleases is sending notifications on new releases.