Conversation
2a70304 to
c388ce6
Compare
|
Was |
|
Error Boundaries are a common concept in frontend frameworks and try/catch felt more "imperative" to us. |
cb16745 to
dc7ed41
Compare
48c436e to
c742892
Compare
| import * as t from './r3_ast'; | ||
|
|
||
| /** Pattern used to identify a boundary `let` parameter. */ | ||
| const LET_PATTERN = /^(let\s+)(.*)/; |
There was a problem hiding this comment.
It looks like this wasn't resolved?
| export interface ErrorDetails { | ||
| readonly boundary?: { | ||
| readonly type: Type<any>; | ||
| readonly reset: () => void; |
There was a problem hiding this comment.
Note for: we need to settle on either retry or reset for consistency
There was a problem hiding this comment.
Is the a precedent anywhere for this? @atscott Didn't you use something similar for reseting/retrying route resources, or was that reloading?
There was a problem hiding this comment.
I think maybe you're referring to reload, potentially? There was something in there to trigger reloads on resources in an error state.
There was a problem hiding this comment.
Ah okay. Maybe reset is most appropriate then? reload and retry to me imply some kind of network request operation, whereas reset more accurately reflects the fact that we're simply resetting some internal framework state?
atscott
left a comment
There was a problem hiding this comment.
AGENT: Thank you for working on this! I've reviewed the PR and left inline suggestions focusing on template variable scoping, binder visitor order, TCB resolution, and compiler reification cleanup.
leonsenft
left a comment
There was a problem hiding this comment.
reviewed-for: fw-compiler, fw-general
atscott
left a comment
There was a problem hiding this comment.
AGENT: Follow-up review focusing on compiler AST visiting, template pipeline dead code, and public API declarations.
Implement error interception during refreshView and provide onError callback options in ViewContainerRef for programmatic rendering and encapsulation of boundary errors.
Add the runtime primitives `ɵɵboundaryCreate` and `ɵɵboundaryUpdate` to the core instructions, which handle synchronous view destruction and provide the `ON_ERROR` interceptor hooks. Also include the initial compiler AST representations for the new syntax including the Lexer tokenization and HTML Parser integration. This lays the foundational structure for `@boundary` prior to code generation. Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
Add support for `@boundary` blocks in the template type-checking pipeline.
Add support for the new `@boundary` and `@error` control flow blocks in the Angular Language Service. This includes: - Updating outlining spans to handle boundary blocks correctly. - Adding classification visitor methods for semantic tokens. - Adding template target visitor methods for navigation and hover support. - Updating the TextMate grammar to recognize `@boundary` and the `when` clause.
…ation Added some tests to ensure error boundaries work with SSR and hydration.
593dce3 to
9d39794
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
angular#70463) Add the runtime primitives `ɵɵboundaryCreate` and `ɵɵboundaryUpdate` to the core instructions, which handle synchronous view destruction and provide the `ON_ERROR` interceptor hooks. Also include the initial compiler AST representations for the new syntax including the Lexer tokenization and HTML Parser integration. This lays the foundational structure for `@boundary` prior to code generation. Co-authored-by: Matthieu Riegler <kyro38@gmail.com> PR Close angular#70463
…ngular#70463) Add support for `@boundary` blocks in the template type-checking pipeline. PR Close angular#70463
Add support for the new `@boundary` and `@error` control flow blocks in the Angular Language Service. This includes: - Updating outlining spans to handle boundary blocks correctly. - Adding classification visitor methods for semantic tokens. - Adding template target visitor methods for navigation and hover support. - Updating the TextMate grammar to recognize `@boundary` and the `when` clause. PR Close angular#70463
…ation (angular#70463) Added some tests to ensure error boundaries work with SSR and hydration. PR Close angular#70463
Introduces a declarative way to catch rendering errors in templates using the new
@boundaryblock, preventing local failures from crashing the entire application hierarchy.Additionally, this adds programmatic error handling for dynamically created views by introducing an
onErroroption toViewContainerRef.createComponent,createEmbeddedViewand the standalone alonecreateComponentfunction:Additional changes:
ErrorHandlercan now implementonViewError(err, details)to receive rich metadata about caught boundary errors.Note: most of design & implementation was done by @alxhub.
Note2: Docs on the feature will be addressed in a follow-up PR.