Show HN: Fate, a new data framework for React and tRPC, inspired by Relay
2 days ago
- #Data Fetching
- #tRPC
- #React
- fate is a modern data client for React and tRPC inspired by Relay and GraphQL.
- Key features include View Composition, Normalized Cache, Data Masking, Async React features, and type safety.
- View Composition allows components to declare data requirements via co-located 'views', minimizing network requests.
- Normalized Cache ensures efficient data updates and avoids stale or duplicated data.
- Data Masking enforces strict data selection, preventing overfetching and accidental coupling between components.
- Async React features like Suspense and Actions support concurrent rendering for a seamless user experience.
- Built-in support for connection-style lists with cursor-based pagination simplifies infinite scrolling.
- Optimistic Updates allow UI to update immediately during mutations, with rollback on failure.
- AI-Ready API enables stable, type-safe data-fetching code generation by humans and AI tools.
- fate integrates with tRPC, providing type safety between client and server without adopting GraphQL.
- Server integration requires tRPC backend conventions like 'byId' and 'list' queries for data fetching.
- fate is currently in alpha and not production-ready, with plans for future features like garbage collection and live views.