Closed toteto closed 3 months ago
Latest commit: 922179e62a54b829c674de0a54af997bbed792c7
The changes in this PR will be included in the next version bump.
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
@toteto is attempting to deploy a commit to the ts-rest Team on Vercel.
A member of the Team first needs to authorize it.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
12.7% Duplication on New Code
CI is running/has finished running commands for commit 922179e62a54b829c674de0a54af997bbed792c7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
Sent with 💌 from NxCloud.
There's no need for the core library helpers since they all exist in the initContract()
type helper. makeRoute
is covered by c.query()
and c.mutation()
For now we'd prefer to stick to the const c = initContract()
convention
The express helper can be achieved much easier, so I'll just make a quick to change to cover this need
Having to import initContract
or initServer
just to use stateless utility methods seems like extra step and extra computation for anyone that is not 100% aware of the source code. Seems like the resulting type of c.mutation/query
is not portable as makeMutation
or makeQuery
would be. This is my opinion at least.
Any opinion on the makeResponses
utility?
We will be exporting c
or similar directly in the next major version, and the old stateless method will be removed. However, exporting the utilities separately, not contained in an object, makes discovery harder and dependency on the docs even more - think of zod's z
Motivated by few issues (like #521) and comments on Discord, I am adding few methods that will aid into easier creation of reusable endpoints/responses/implementations.
If the changes in
ts-res/express
are desired, I am willing to try to port them to other server packages.Resolves #521