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

Improve error boundary docs #1100

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amirhhashemi
Copy link
Collaborator

  • I have read the Contribution guide
  • This PR references an issue (except for typos, broken links, or other minor problems)

Description(required)

This PR:

  1. Clarifies when <ErrorBoundary> does and doesn't catch an error.

  2. Improves the examples:

    1. The image on the Error boundary page doesn't illustrate the code beside it correctly. I think it's not needed here so I removed it. If you think it's necessary, a new image must be created which I think requires access to your Eraser account.
    2. The examples are often very minimal and don't show the whole picture. For instance:
    import { ErrorBoundary } from "solid-js";
    
    <ErrorBoundary fallback={(err) => <div>Error: {err.message}</div>}>
        <ProblematicComponent />
    </ErrorBoundary>

    I don't understand the reasoning behind this formatting but I think it's valuable for the examples to be complete to avoid potential confusion. Also, Prettier formats these incorrectly, and that could be a problem when we inforced formatting in CI.

    import { ErrorBoundary } from "solid-js";
    
    <ErrorBoundary fallback={(err) => <div>Error: {err.message}</div>}>
        <ProblematicComponent />
    </ErrorBoundary>;

    Notice the semicolon at the end.

  3. Adds more information to the <ErrorBoundary> reference page.

  4. Explains error boundaries more coherently.

Related issues & labels

Copy link

stackblitz bot commented Feb 27, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for solid-docs ready!

Name Link
🔨 Latest commit 027ebad
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/67c07eec814998000810d02a
😎 Deploy Preview https://deploy-preview-1100--solid-docs.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 configuration.

Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for solid-docs ready!

Name Link
🔨 Latest commit 78db858
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/67c07ef3c7a9910008c741f1
😎 Deploy Preview https://deploy-preview-1100--solid-docs.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 configuration.

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

Successfully merging this pull request may close these issues.

[Content]: ErrorBoundary content is incorrect
1 participant