Skip to content
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

Merged
merged 4 commits into from Mar 4, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Mar 3, 2021

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.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Mar 3, 2021
@lex111 lex111 requested a review from slorber as a code owner March 3, 2021 23:27
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 3, 2021
@netlify
Copy link

netlify bot commented Mar 3, 2021

[V1] Deploy preview success

Built with commit 0ae6adc

https://deploy-preview-4344--docusaurus-1.netlify.app

@netlify
Copy link

netlify bot commented Mar 3, 2021

Deploy preview for docusaurus-2 ready!

Built with commit 0ae6adc

https://deploy-preview-4344--docusaurus-2.netlify.app

@lex111 lex111 force-pushed the lex111/format-post-date-intl branch from 3d49a04 to 3c28e32 Compare March 3, 2021 23:42
@github-actions
Copy link

github-actions bot commented Mar 3, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 91
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4344--docusaurus-2.netlify.app/classic/

@github-actions
Copy link

github-actions bot commented Mar 3, 2021

Size Change: -1 B (0%)

Total Size: 532 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 87.4 kB 0 B
website/build/assets/js/main.********.js 359 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 60.3 kB -1 B (0%)
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 25.4 kB 0 B

compressed-size-action

@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 4, 2021
@@ -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",
Copy link
Collaborator

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 🤪

formatjs/formatjs#1789

Copy link
Contributor Author

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.

@slorber
Copy link
Collaborator

slorber commented Mar 4, 2021

Looks great thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants