TGViewer
Computer Science and Programming Computer Science and Programming @computer_science_and_programming · 140K subscribers
Post #2162 11.4K
Parse, Don't Guess
A developer shares how a sneaky Regex-based bigint auto-detection during JSON deserialization caused JavaScript event loop freezes in production. The fix involved dropping the global Regex reviver and replacing it with an explicit upcasting pattern — a function that converts stored types (strings) to application types (Date, bigint) only for declared fields. This same upcasting mechanism naturally extends to schema versioning: handling structural changes between document/event versions (V1 flat fields vs V2 nested objects) using upcast (read) and downcast (write) functions. The pattern is applied to both Pongo (document store) and Emmett (event store), enabling backward and forward compatibility without batch migrations.
  • ❤ 6
  • 👍 1
  • 🗿 1
More from @computer_science_and_programming
  1. Oct 3, 2026BYD says it will have a solid-state car next year, the earliest date anyone has given BYD…
  2. Oct 1, 2026Introducing G#: A Go-like language for .NET G# is a new open-source, Go-inspired programmi…
  3. Sep 30, 2026Chrome for Developers Chrome 146 introduces three notable features for web developers. Scr…
  4. Sep 26, 2026Introduction to Solon A comprehensive tutorial walks through building a REST API with Solo…
  5. Sep 25, 2026The strangler fig pattern: modernizing without a big-bang rewrite A detailed guide to the…
  6. Sep 24, 2026Lessons From Four Years of Writing a Weekly Newsletter A .NET blogger reflects on four yea…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →