Repository navigation
feat: standalone endpoints, endpoint schemas and readable call hovers (0.1.0-rc.1) - #5
Merged
Merged
Conversation
…en-out call types
Fetch.endpoint(route, definition) returns frozen data (route, method, path, schemas, headers) that can live at module level. client.bind turns it into the same Endpoint client.endpoint makes. Plugin overrides are given when binding; a definition without `error` uses the client's defaultError. Adds UnboundEndpoint, UnboundEndpointDefinition, BindMethod and BindOptions. The example app's todos module now defines its endpoints in contract/ and binds them in data/.
…finition` - rename the exported type in `Endpoint.ts` and the `index.ts` export list - update the README API list and the changelog entry to match
…e-service to 0.87.5
The oldest-supported-effect CI job typechecks with effect 4.0.0, where UrlParams values are strings. Cast the whole conditional in toParam so it compiles with both versions, and run the Redacted query tests only when the installed Effect sends Redacted values as their value.
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.
Second release candidate for 0.1.0. It sets the version to
0.1.0-rc.1. The full notes are under## 0.1.0-rc.1in CHANGELOG.md.Added
output,errorandinputproperties, holding the schemas they were defined with.erroris the schemaHttpError.bodyis decoded with: the endpoint's ownerror, then the client'sdefaultError, thenSchema.Unknown.Fetch.endpoint(route, definition)defines an endpoint as frozen data that can be exported at module level, next to its schemas.client.bind(definition, options?)turns it into an endpoint of that client, the same oneclient.endpointmakes. Plugin overrides are given when binding, so they're checked against that client's plugins.UnboundEndpoint,UnboundDefinition,BindMethodandBindOptions.todosmodule inexamples/appnow defines its endpoints this way.Changed
Effect.Effect<A, E, R>with the errors and services written out, rather than asCallEffect<…>. Hovering a call now shows something likeEffect<{ readonly id: number }, NetworkError | DecodeError | HttpError.With<unknown>, never>. AGENTS.md rule 3 records this exception to "named types only". The type tests check that the written-out types matchCallErrorandCallServices.Fixed
Redactedquery values. ARedactedvalue inqueryis sent as its value. Effect 4.1 addedRedactedtoUrlParams.Coercible, but effetch passed every value throughString(), so it senttoken=<redacted>.Type-level changes for consumers
These don't change runtime behavior.
CallEffect's type parameters from a call. A helper typed(call: CallEffect<O, EB, I, Ps>)should take<A, E, R>(call: Effect.Effect<A, E, R>)instead.Endpointvalues built by hand, such as test doubles, needoutput,errorandinput.Clientvalues built by hand needbind.Tooling
effectand@effect/vitestgo to 4.1.0;@effect/language-servicegoes to 0.87.5.effectpeer range stays^4.0.0.Fetch.endpoint,client.bindand the endpoint schema properties.Verification
pnpm run checkpasses:effect@4.0.0typechecks and runs, with both NodeNext and Bundler resolution andskipLibCheck: false.