News for hackers. Stuff that matters.
Re:JavaScript Temporal Is Coming by syncsynchalt on Thursday January 30, 2025 @08:34PM (#42883975)
It looks like `.epochMilliseconds` should work as a Map/Set key/member in some situations, though you'll need to preserve the instant in the value in the Map case if you want to preserve the zonedata / do further operations on the Instant.

For the Set case you could use a Map{v.epochMilliseconds:v} and preserve the Instant.

Not great, but I think we all blame JS for this rather than Temporal. This could be made to work by the runtime but then polyfills would fail.

Re:JavaScript Temporal Is Coming by nikeee on Wednesday February 05, 2025 @09:13PM (#42958179)
Passing Dates to a React component caused re-rendering issues in some of my applications due to Date being an object.

I had to resort to numbers (Unix time) to not have to add memoization everywhere. Seems like this will continue with Temporal. Or React-Compiler will solve this.