-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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: remove react-dev-utils
(CRA) dependency, internalize code
#10956
Conversation
packages/docusaurus-bundler/src/legacy/formatWebpackMessages.js
Dismissed
Show dismissed
Hide dismissed
packages/docusaurus-bundler/src/legacy/formatWebpackMessages.js
Dismissed
Show dismissed
Hide dismissed
packages/docusaurus-bundler/src/legacy/formatWebpackMessages.js
Dismissed
Show dismissed
Hide dismissed
packages/docusaurus-bundler/src/legacy/formatWebpackMessages.js
Dismissed
Show dismissed
Hide dismissed
⚡️ Lighthouse report for the deploy preview of this PR
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
Size Change: +319 B (0%) Total Size: 11.1 MB ℹ️ View Unchanged
|
Size Change: +309 B (0%) Total Size: 11.6 MB ℹ️ View Unchanged
|
…onstructed from library input Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Report too large to display inline |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts
Dismissed
Show dismissed
Hide dismissed
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
Motivation
CRA is now deprecated, and its
react-dev-utils
package too.https://react.dev/blog/2025/02/14/sunsetting-create-react-app
We only use a subset of that package but pull a large dependency tree because of it.
Let's remove the dependency, and copy/paste the legacy code into our project.
Fix #7289
I also refactored to TS and cleaned up some utils like
openBrowser()
andprepareUrls()
, removed useless code branches and transitive dependencies.Other others
evalSourceMapMiddleware
andformatWebpackMessages
are quite complex, untested, and harder to convert to TS so I left them as-is in JS.Benchmark -
node_module
install sizeBefore: 242M
After: 237M
Test Plan
CI + various local tests
Unfortunately, this is not well-covered by unit tests and not easy to write some.
Test links
https://deploy-preview-10956--docusaurus-2.netlify.app/