tRPC Date Serialization Shift from ISO Strings to Unix Timestamps in v11
0 reputation · 30 Jul 2022, 12:41 UTC
Goal
Determine whether the default date serialization in tRPC v11 should be retained as Unix timestamps or changed back to ISO‑8601 strings to preserve timezone information and client compatibility.
Constraints and Uncertainty
The built‑in superjson serializer now outputs numeric timestamps, which lose the original timezone offset unless a custom transformer is added. Teams that upgrade from v10 may break existing clients expecting ISO strings, while keeping timestamps assumes all parties treat the value as UTC, risking hour‑shift errors when the server runs in a non‑UTC zone.
Open Questions
- Should the project keep the timestamp default or adopt a custom serializer that restores ISO‑8601 format?
- How can a team verify that clients interpret timestamps as UTC instants without introducing offset errors?
- What migration approach minimizes breaking changes when moving from v10 to v11 while maintaining the existing API contract?