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

fix(v2): fix useEffect infinite loop in blogOnly mode #5097

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 30, 2021

Motivation

Infinite loop produced because we use an "unstable" empty object fallback when there is no docs global data available => triggers downstream useEffect re-executions because the unstable object is used in dependency array

Issue can be reproduced in blogOnly mode yarn workspace docusaurus-2-website start:blogOnly

Fix #5089

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

none :( unfortunately this only happens on the client and the blogOnly CI action we have fails to catch this at build time

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.)

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 30, 2021
@slorber slorber requested a review from lex111 as a code owner June 30, 2021 10:44
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 30, 2021
@netlify
Copy link

netlify bot commented Jun 30, 2021

✔️ [V2]

🔨 Explore the source changes: 4e94caa

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

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

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

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

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

@slorber slorber merged commit 0f14421 into master Jun 30, 2021
@github-actions
Copy link

Size Change: +4 B (0%)

Total Size: 605 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 87.7 kB 0 B
website/build/assets/js/main.********.js 415 kB +4 B (0%)
website/build/blog/2017/12/14/introducing-docusaurus/index.html 68.7 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 33.4 kB 0 B

compressed-size-action

@slorber slorber deleted the slorber/fix-blogOnly-infinite-effects-loop branch August 17, 2021 17:57
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: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freeze of page after navigating to any other page from the first page in beta2
2 participants