Skip to content

Add ErrorBoundary RFC - #1

Closed
megothss wants to merge 10 commits into
mainfrom
error-boundary-rfc
Closed

Add ErrorBoundary RFC#1
megothss wants to merge 10 commits into
mainfrom
error-boundary-rfc

Conversation

@megothss

@megothss megothss commented Mar 6, 2026

Copy link
Copy Markdown
Owner

Add RFC proposing a built-in component for catching synchronous render errors in the Glimmer VM.

Propose {{RFC_NAME}}

Rendered

Summary

This pull request is proposing a new RFC.

To succeed, it will need to pass into the Exploring Stage, followed by the Accepted Stage.

A Proposed or Exploring RFC may also move to the Closed Stage if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.

An FCP is required before merging this PR to advance to Accepted.

Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.

Exploring Stage Description

This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.

An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an Exploring label applied.

An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.

Accepted Stage Description

To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.

If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.

When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.

Checklist to move to Exploring

  • The team believes the concepts described in the RFC should be pursued.
  • The label S-Proposed is removed from the PR and the label S-Exploring is added.
  • The Ember team is willing to work on the proposal to get it to Accepted

Checklist to move to Accepted

  • This PR has had the Final Comment Period label has been added to start the FCP
  • The RFC is announced in #news-and-announcements in the Ember Discord.
  • The RFC has complete prose, is well-specified and ready for implementation.
    • All sections of the RFC are filled out.
    • Any unanswered questions are outlined and expected to be answered before Ready for Release.
    • "How we teach this?" is sufficiently filled out.
  • The RFC has a champion within one of the relevant teams.
  • The RFC has consensus after the FCP period.

megothss added 9 commits March 6, 2026 18:58
Add RFC proposing a built-in <ErrorBoundary> component for catching
synchronous render errors in the Glimmer VM.
- Remove Discourse mention, generalize to plugin architectures
- Fix Solid.js and Preact documentation links
- Add Svelte to framework parity list
- Fix "only major framework" claim (Angular/Lit also lack it)
- Remove vague route-level recovery subsection
- Clean up unmaintained addon reference
- Promote reference implementation into dedicated PoC section
Illustrate render failure blast radius with a concrete example
Add RFC emberjs#513 to prior discussion section, remove @onerror callback from unresolved questions
Comment thread text/0000-error-boundary.md Outdated
Comment on lines +24 to +26
### No built-in error recovery

If a component's getter throws during render, or a helper invocation fails, the entire render pass aborts. The DOM may be left partially rendered, and there's no way for the app to recover gracefully. The user is left staring at a broken page.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This heading & paragraph feels like it's just repeating exactly the same info as the paragraph above? Maybe just drop it?

Comment thread text/0000-error-boundary.md Outdated
Comment on lines +67 to +69
### Graceful degradation

ErrorBoundary enables progressive enhancement patterns. Wrap non-critical UI sections (widgets, sidebars, third-party embeds) in boundaries so that failures degrade gracefully while the rest of the app stays interactive.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This heading & paragraph seems to be repeating the same problem again. I think we can delete it.

Comment thread text/0000-error-boundary.md Outdated

ErrorBoundary doesn't catch:

- Modifier install/update errors: modifiers run in `transaction.commit()` after the VM execution phase completes, outside the boundary's try/catch scope

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kinda surprising. Surely we'd want modifier to have their errors caught? Otherwise they'll break the whole app?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifiers usually do not break the app. They run async and it's hard to catch/rollback them because they may be altered the DOM themselves

Drop two Motivation subsections that restated the opening paragraph.

Answer the modifier question directly rather than calling the omission
intentional. Modifiers run after the boundary's try has exited, and one
may already have mutated the element, so recovery does not mean the same
thing it does for render output. Say plainly that this is the most
significant known gap.

Add an Alternatives section on block syntax. The component form was
chosen because it needs no tooling change, not because a keyword is the
wrong answer.

Rewrite Proof of concept: the prototype leaned heavily on AI assistance,
is not a proposed implementation, and is not offered as a pull request
against Ember. Ask reviewers to judge the API on its own merits.

Retitle around the capability rather than the component, since the
component is the proposed shape and not the substance of the proposal.

Set start-date to the day the PR is opened, matching how the field is
used in practice.
@megothss

megothss commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the upstream proposal: emberjs#1235

@megothss megothss closed this Sep 9, 2026
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.

2 participants