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: remove node-fetch polyfill #1662

Merged
merged 1 commit into from
Dec 15, 2024
Merged

perf: remove node-fetch polyfill #1662

merged 1 commit into from
Dec 15, 2024

Conversation

chenjiahan
Copy link
Member

Summary

Remove node-fetch polyfill to reduce 7.45MB install size:

image

  • In Node.js >= 18, fetch is builtin and enabled by default.
  • In Node.js 16, fetch can be enabled by the --experimental-fetch flag, I have updated the bin file to enable it.
  • In Rspress 2.0 we can remove this flag from the bin file.

Other Change

This PR also removed mdast-util-mdxjs-esm from two packages because they never use it:

Screenshot 2024-12-15 at 10 15 05

TODO

I think the remote search should be redesigned in Rspress 2.0 as it is now a ByteDance SCM only feature.

See:

if (isProduction() && isSCM() && config?.search?.mode === 'remote') {

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Dec 15, 2024

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 0241ad0
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/675e406d59cee60008f5f2e0
😎 Deploy Preview https://deploy-preview-1662--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90 (🔴 down 3 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@Timeless0911 Timeless0911 merged commit 9d9d6f7 into main Dec 15, 2024
8 checks passed
@Timeless0911 Timeless0911 deleted the node_fetch_1215 branch December 15, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants