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

perf(v2): improve blog mdx-loader and postcss loader #4355

Merged
merged 3 commits into from
Mar 8, 2021
Merged

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Mar 6, 2021

Motivation

Resolves one TODO comment related with perf of linkify function and also removes postcss-preset-env, which we essentially don't need it, because we can use autoprefixer directly instead.

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: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient. label Mar 6, 2021
@lex111 lex111 requested a review from slorber as a code owner March 6, 2021 00:39
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 6, 2021
@netlify
Copy link

netlify bot commented Mar 6, 2021

[V1] Deploy preview success

Built with commit 774df2d

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

@github-actions
Copy link

github-actions bot commented Mar 6, 2021

Size Change: -483 B (0%)

Total Size: 532 kB

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

compressed-size-action

@netlify
Copy link

netlify bot commented Mar 6, 2021

Deploy preview for docusaurus-2 ready!

Built with commit 774df2d

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

@github-actions
Copy link

github-actions bot commented Mar 6, 2021

⚡️ Lighthouse report for the changes in this PR:

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

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

@lex111
Copy link
Contributor Author

lex111 commented Mar 6, 2021

Maybe we should improve Babel somehow? For example add such a plugin? https://babeljs.io/docs/en/babel-plugin-transform-react-constant-elements

@slorber
Copy link
Collaborator

slorber commented Mar 8, 2021

LGTM thanks

@slorber slorber merged commit 36dc206 into master Mar 8, 2021
@slorber
Copy link
Collaborator

slorber commented Mar 8, 2021

@lex111 yes there are a few babel plugins that could be useful to try.

Most of them are in https://github.com/jamiebuilds/babel-react-optimize

In the past I had problems due to the order of these plugins (jamiebuilds/babel-react-optimize#33 ). but normally that works nicely. I think some of the plugins are even enabled in CRA now

@@ -93,7 +94,7 @@
"null-loader": "^4.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"pnp-webpack-plugin": "^1.6.4",
"postcss": "^8.2.6",
"postcss": "^8.2.7",
"postcss-loader": "^4.1.0",
"postcss-preset-env": "^6.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to be a dependency after the update?

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: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants