fix(http): make HttpRouter entrypoints own their router - #8477
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 2b37f5f The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
Remove HttpRouter.layer and HttpRouter.make, reject app layers that output HttpRouter, and add a memoMap option to toHttpEffect.
tim-smart
commented
Sep 24, 2026
kriegcloud
added a commit
to beep-effect/beep-effect
that referenced
this pull request
Sep 28, 2026
… 1) (#1310) * chore(deps): bump the Effect catalog to snapshot e5f7d12af9 (rc.118 + 1) Move every Effect catalog entry from the pkg.pr.new snapshot of main 330b7475e2 to the snapshot of e5f7d12af9 (one commit after the 4.0.0-rc.118 tag). The Bun patches for effect and platform-node-shared are re-keyed to the new URLs (upstream sources unchanged), the OSV override is re-keyed, and the effect-vitest primitives graph, charter fixtures, and inventory are re-pinned to the @effect/vitest@4.0.0-rc.118 tag (101 entries: the README gained a fixtures section). HttpRouter.serve now owns the router it serves (Effect-TS/effect#8477), so the professional-desktop sidecar builds its rpc server inside the served app instead of as a sibling of it; the previous shape registered the handlers on an unserved second protocol. The integration harness follows the same shape. The knowledge command-surface parser drops the pre-rc.118 effect/unstable/cli specifier. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(ontology-client): skip request cancellation on a disposed atom registry The snapshot's AtomRegistry.reset empties the node map before running node finalizers (Effect-TS/effect#8543), so the graph-worker finalizer's registry.get on the watchdog/boundary/failure request atoms created nodes on a disposed registry and threw "registry is disposed" in three Session atom tests. Cancellation now bumps a request counter only while its atom still has a node; a request nobody can answer needs no cancellation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(epistemic-server): count SHACL violations without spying on the schema The snapshot caches every schema's `make` as a lazily built, non-configurable own property (Effect-TS/effect internal/schema/make.ts), so `vi.spyOn(ShaclValidationViolation, "make")` throws "Attempting to change value of a readonly property" once any test has built a violation. The bounded-generation test now counts constructions through a module mock of the layer's import, whose wrapper inherits the schema and shadows only `make`. `vi` comes from `vitest` because only that import gets its `mock` and `hoisted` calls hoisted; the effect-vitest inventory records the three plain-vitest rows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.
HttpRouter.serve,toWebHandlerandtoHttpEffectnow own the router. Each call creates a new one, so two servers in one layer graph, or two handlers sharing amemoMap, no longer answer each other's routes.HttpRouter.layeris removed. Holding a module-level router layer let apps share routes through memoization. Most callers just delete theLayer.provideMerge(HttpRouter.layer)line, since every entrypoint already supplies a router.HttpRouter.makeremains public for custom integrations. App layers may output another router, but entrypoints still serve their own router, not the app's output.toHttpEffecttakes amemoMapoption.migration/v3-to-v4.mdno longer pointHttpLayerRouter.layerorHttpRouter.Defaultat the removed layer.Layer.freshworkaround, app router outputs, and the public type surface. The HTTP/WebSocket RPC and MCP fixtures now register routes inside the app passed to the entrypoint.Compatibility impact: removing
HttpRouter.layeris a compile break, and routes registered on a router provided outsideserveused to be served through the shared router but now get 404s. A route layer shared by two entrypoints in one graph (or through a sharedmemoMap) is memoized, so it registers on only one of them and 404s on the other. The changeset and entrypoint docs say to wrap it inLayer.fresh. This is aneffectpatch, following the rc convention.Closes EFF-1570
Closes #8460