Mayhul
Explore posts from serversMigrating to use Superjson
I currently have a tRPC router that is being used by a web app & React native client. My current version does not use superjson. I want to start using superjson as my transformer. Is there an easy way for me to make this migration?
When I tried just starting to use Superjson, our React native client started running into errors because the old mobile client was not using superjson but the server was. I wish I could access context in my transformer so I could choose to only do the transformation for new clients. Any other ideas on how I can make the switch-over while maintaining backwards compatibility for older clients?
10 replies
TTCTheo's Typesafe Cult
•Created by Mayhul on 4/25/2024 in #questions
React Native Data Loader library
Does anyone know of any good data loader libraries that will prevent waterfalls in React Native? I know on web, frameworks like TanStack (https://tanstack.com/router/latest/docs/framework/react/guide/data-loading) and React Router (https://reactrouter.com/en/main/route/loader) have done a good job of hoisting data fetching code from the route level to the component level.
Our main goal is to prevent loading waterfalls where a nested component only starts its API call after the parent component is done rendering.
3 replies
TTCTheo's Typesafe Cult
•Created by Mayhul on 5/30/2023 in #questions
Task scheduler infra?
I'm looking for something that can do the following (or do essentially the same thing). It feels like something that would be some kind of open source tech / AWS service / something.
- I can /PUT an id, JSON blob, URL and timestamp
- When the timestamp occurs, the provided URL gets called with the json blob
- If multiple tasks are within a close enough timestamp (1-2 seconds), they get batched into a single API call with an array
- Retries are handled intelligently with some kind of exponential backoff. Ideally I can specify whether a task should be retried or discarded after a certain period of time
- If the service is about to DDOS the URL with a ton of tasks, it spreads them out
- I can /POST an id to edit the task
- It scales effectively and has no problem handling 1m+ scheduled tasks
Nice to have:
- a UI where I can inspect currently scheduled tasks / see failures
I don't need this to be super precise. Triggering anywhere within 5-20 seconds of the timestamp is basically good enough.
We currently have a bunch of cron scrips that are all doing some version of this to schedule emails, notifications, reminders, etc. Anyone have thoughts on how they typically handle timestamp-based task scheduling? If this doesn't exist, someone please build it!!
1 replies