Replace JSON.parse/stringify deep clone with structuredClone() #14

Closed
opened 2026-02-15 05:31:46 -08:00 by kyle · 0 comments
Owner

Problem: DeparturesManager.displayDepartures() used JSON.parse(JSON.stringify(departures)) to deep clone departure data. This is slow and loses Date objects, undefined values, and other non-JSON types.

Solution: Replaced with structuredClone(departures) which is the modern browser/Node API for deep cloning that preserves all object types.

Files changed:

  • public/js/components/DeparturesManager.js
Problem: DeparturesManager.displayDepartures() used JSON.parse(JSON.stringify(departures)) to deep clone departure data. This is slow and loses Date objects, undefined values, and other non-JSON types. Solution: Replaced with structuredClone(departures) which is the modern browser/Node API for deep cloning that preserves all object types. Files changed: - public/js/components/DeparturesManager.js
kyle closed this issue 2026-02-15 05:32:14 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kyle/SignageHTML#14