-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(v2): format post date using Intl #4344
Conversation
[V1] Deploy preview success Built with commit 0ae6adc |
Deploy preview for docusaurus-2 ready! Built with commit 0ae6adc |
3d49a04
to
3c28e32
Compare
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4344--docusaurus-2.netlify.app/classic/ |
Size Change: -1 B (0%) Total Size: 532 kB ℹ️ View Unchanged
|
@@ -23,6 +23,8 @@ | |||
"escape-string-regexp": "^4.0.0", | |||
"fs-extra": "^9.1.0", | |||
"gray-matter": "^4.0.2", | |||
"intl": "^1.2.5", | |||
"intl-locales-supported": "^1.8.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, it seems deprecated but seems safe in our case 🤪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, didn't know about it, but this is a temporary solution until we set v14 as the minimum version of Node.
Looks great thanks! |
Motivation
As discussed earlier, we'd better format the date using the Intl API. Since the current minimum version of Node.js does not offer full ICU support, we will use the polyfill
Intl
, which we will remove when moving to Node v14.This will not affect on final client bundle size as formatting doing on during prerendering.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)