Overview
remix-typedjson is an innovative package designed to replace superjson for use within Remix applications. This utility focuses on a more streamlined and efficient handling of data types, ensuring that apps can run faster while maintaining a compact footprint. While it does not support the extensive flexibility of superjson, remix-typedjson excels in simplicity and speed, making it an attractive option for developers who require a straightforward solution for type handling in their projects.
Whether you’re building a new app or integrating this into an existing project, remix-typedjson provides essential features tailored for modern development needs. It has been specifically crafted for those using Remix v1.6.5 and above, offering strong type fidelity and inference to enhance the developer experience.
Features
Performance Optimization: Remix-typedjson is designed to be faster and smaller than superjson, improving application load times without sacrificing essential functionality.
Type Support: This package supports several key data types, including Date, BigInt, Set, Map, RegExp, and more, providing a robust set of tools for data manipulation.
Typed Loader Data: The
useTypedLoaderDatafunction allows for precise type inference based on the loader, streamlining data management within the app.Typed Action Data: Similar to the loader, the
useTypedActionDataoffers enhanced type inference for actions, improving the reliability of action handling.Typed Defer Replacement: With the introduction of
typeddefer, developers gain a new, type-safe way of handling async data, allowing for better control over loading states.Custom Type Registration: For users needing more specialized data types, the
registerCustomTypeAPI allows the registration of custom types, such as Decimal, without inflating the bundle size.Redirect Functionality: The package includes a redirect function that integrates seamlessly with type inference, ensuring smooth navigation within the application.
Simplified Usage: The API is designed for straightforward implementation, making it easier for developers to get started and leverage the benefits of typed data handling in their Remix applications.