Skip to content

Improve error boundary docs#1100

Merged
LadyBluenotes merged 25 commits intosolidjs:mainfrom
amirhhashemi:improve-error-boundary-docs
Mar 8, 2025
Merged

Improve error boundary docs#1100
LadyBluenotes merged 25 commits intosolidjs:mainfrom
amirhhashemi:improve-error-boundary-docs

Conversation

@amirhhashemi
Copy link
Copy Markdown
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

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

@netlify
Copy link
Copy Markdown

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.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 27, 2025

Deploy Preview for solid-docs failed. Why did it fail? →

Name Link
🔨 Latest commit f57b279
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/67ccbb80602f700008aa601e

kodiakhq bot and others added 14 commits March 8, 2025 00:33
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
Co-authored-by: Sarah <gerrardsarah@gmail.com>
@LadyBluenotes LadyBluenotes merged commit f8908b3 into solidjs:main Mar 8, 2025
2 checks passed
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

2 participants