Skip to content

Conversation

BBlackwo
Copy link
Collaborator

Summary

Reasoning

  1. This library has been around for a long time now. I think it's important to minimize changes that may cause applications to break unexpectedly. Even though there is fix: enhance date parsing to reduce date revival errors #282 to fix the number parsing issue specifically, I think it's better to just revert to the previous ISO date format regex detection to be on the safe side.
  2. If someone wants custom date reviver behavior they can use the reviver config to achieve that.
  3. The default JSON.stringify() behavior creates an ISO string which this implementation handles
  4. A similar change to use Date.parse() was introduced way back in 2017 in use Date.parse instead of RegEx #51, and then reverted in 0507f9d because of the same number issue Change to use Date.parse instead of date regex breaks rehydration #54

Issues

@BBlackwo BBlackwo merged commit 87360db into master Jul 30, 2025
1 check passed
@BBlackwo BBlackwo deleted the fix/revert-date-parse-change branch July 30, 2025 13:11
@BBlackwo
Copy link
Collaborator Author

🎉 This PR is included in version 19.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New date parsing wrongly treats certain number strings as dates restoreDates implementation is too loose
1 participant