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

feat: Support Node 17 #5814

Merged
merged 3 commits into from
Oct 29, 2021
Merged

feat: Support Node 17 #5814

merged 3 commits into from
Oct 29, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Oct 28, 2021

Motivation

Docusaurus should run on Node 17

Change filename hash algo

https://webpack.js.org/configuration/output/#outputhashfunction

image

Fixes #5778

Note: it's not too important to use md5 in the file-loader because it's deprecated and using an older version of loader-utils (does not allow using xxhash64).

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

CI

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Oct 28, 2021
@slorber slorber requested a review from lex111 as a code owner October 28, 2021 17:19
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 28, 2021
@github-actions
Copy link

github-actions bot commented Oct 28, 2021

Size Change: +7 B (0%)

Total Size: 847 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 38 kB 0 B
website/build/assets/css/styles.********.css 94 kB 0 B
website/build/assets/js/main.********.js 425 kB +7 B (0%)
website/build/blog/2017/12/14/introducing-docusaurus/index.html 68.2 kB 0 B
website/build/blog/index.html 39 kB 0 B
website/build/docs/index.html 46.1 kB 0 B
website/build/docs/installation/index.html 53.6 kB 0 B
website/build/index.html 31.6 kB 0 B
website/build/tests/docs/index.html 27.3 kB 0 B
website/build/tests/docs/standalone/index.html 23.8 kB 0 B

compressed-size-action

@netlify
Copy link

netlify bot commented Oct 28, 2021

✔️ [V2]

🔨 Explore the source changes: cfeb69d

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/617c0e06cb45900007652c36

😎 Browse the preview: https://deploy-preview-5814--docusaurus-2.netlify.app

@slorber
Copy link
Collaborator Author

slorber commented Oct 28, 2021

Hmmm this is more complex as Webpack uses some hashes in prod in multiple places.

And it seems they plan to backport a MD4 hash impl here to fix the problem: webpack/webpack#14584

so it's probably not useful to change the hash algo for now

@slorber slorber marked this pull request as draft October 28, 2021 17:54
@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

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

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

@slorber slorber marked this pull request as ready for review October 29, 2021 15:18
@slorber
Copy link
Collaborator Author

slorber commented Oct 29, 2021

Thanks @alexander-akait seems to be working :)

@slorber slorber merged commit 3b66c68 into main Oct 29, 2021
@slorber slorber deleted the slorber/node-17-support branch October 29, 2021 15:21
@alexander-akait
Copy link

@slorber Anyway, can you explain why file-loader is still used, maybe I can help or we can improve some things

@slorber
Copy link
Collaborator Author

slorber commented Oct 29, 2021

@alexander-akait it's probably a lack of time/priority, I didn't work on it since last time.

Also not sure how to do this migration without using a oneOf rule, which is likely a breaking change for our plugin ecosystem using a configureWebpack(config) lifecycle. Doing that seems likely to be annoying.

webpack/webpack#12900 (comment)

@alexander-akait
Copy link

hm, I see... yes need may have to experiment or enter a new option...

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: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to start app with NodeJS newest version v17.0.1
3 participants