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(live-codeblock): add err boundary to live code block #8203

Closed
wants to merge 1 commit into from

Conversation

mturoci
Copy link
Contributor

@mturoci mturoci commented Oct 11, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Invalid code in live code block should not crash the whole page, but just editor.

Test Plan

Manual.

Screen.Recording.2022-10-11.at.8.52.46.PM.mov

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

Closes #8009

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 11, 2022
@netlify
Copy link

netlify bot commented Oct 11, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 0c7d58e
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6345baab2cf2a00009f408c2
😎 Deploy Preview https://deploy-preview-8203--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 59 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 75 🟢 100 🟢 100 🟢 100 🟢 90 Report

@mturoci mturoci changed the title fix: Add err boundary to the live code block #8009. fix(live-codeblock): add err boundary to the live code block #8009. Oct 11, 2022
@Josh-Cena Josh-Cena changed the title fix(live-codeblock): add err boundary to the live code block #8009. fix(live-codeblock): add err boundary to live code block Oct 11, 2022
@slorber
Copy link
Collaborator

slorber commented Oct 13, 2022

Sorry but there's already a pending PR for that which looks better to what I want: only show the error in the live preview and keep the code block mounted:

image

#8015

@slorber slorber closed this Oct 13, 2022
@mturoci
Copy link
Contributor Author

mturoci commented Oct 13, 2022

Woops, didn't notice that PR. Sorry for the duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined crashes live codeblock
3 participants