-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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): avoid synchronous/ blocking operation when possible #1957
Conversation
@@ -105,7 +104,7 @@ function normalizeSidebar(sidebars: SidebarRaw): Sidebar { | |||
export default function loadSidebars(sidebarPath: string): Sidebar { | |||
// We don't want sidebars to be cached because of hotreloading. | |||
let allSidebars: SidebarRaw = {}; | |||
if (sidebarPath && fs.existsSync(sidebarPath)) { | |||
if (sidebarPath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, if fake path is given, it is simply ignored
Deploy preview for docusaurus-2 ready! Built with commit 3c8475b |
Deploy preview for docusaurus-preview ready! Built with commit 3c8475b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making the code more parallel might introduce obscure race conditions and I'm not convinced we are aware of them. Your call to merge :P
Motivation
Refactoring. Try to avoid fs sync operation since it blocks the whole nodejs thread loop.
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
(20s-21s)
- Development