James Berry
James Berry
Hi @jqhoogland! You can use `z.preprocess` (https://github.com/colinhacks/zod#preprocess) to transform an input type while keeping Zod's built-in validations (i.e. min/max). I do like the proposal to support `number`, `Date` **AND** `boolean`...
So I've taken a stab at implementing this (not entirely sure I want to ship this feature yet). Would be great if you could take a look at the PR...
Example: ```ts .query('getUsers', { input: z.object({ limit: z.preprocess((arg) => (typeof arg === 'string' ? parseInt(arg) : arg), z.number().min(1).max(50)), }), /* ... */ }) ```
Note to self: https://twitter.com/ecyrbedev/status/1567953183120699392
Hi @moltar - this is already possible, I think you are describing the purpose of `adapters` (router-side) and `links` (client-side). Please see [`trpc-chrome`](https://github.com/jlalmes/trpc-chrome/tree/v0.1.0) as an example for web extensions where...
Hi @chuckstock. I have added this feature as a "**_Maybe_**" in our `v1.0.0` roadmap (https://github.com/jlalmes/trpc-openapi/issues/91). Any ideas how you would like this API to look/behave? Initial thoughts 👇 ```ts //...
Hi @TheSwordBreaker, thank you for your contribution! 🙏 🙏 I've added you as a contributor now, could you please do the following for me? :point_down: 1. Accept the invitation -...
This discussion might be relevant 👉 https://github.com/jlalmes/trpc-chrome/pull/1
I'm currently using [`trpc-chrome`](https://github.com/jlalmes/trpc-chrome). Appears that you can use it with tRPC subscription procedures (two-way messaging) for this use-case. For visibility, here's a complete Plasmo example: https://github.com/jlalmes/trpc-chrome/tree/master/examples/with-plasmo
Also stumbled across this. Fixed by using this: `npm install --save-dev [email protected]`