Skip to content

fix(angular): fix 5 compiler divergences from Angular reference#28

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/angular-control-flow-divergences
Feb 22, 2026
Merged

fix(angular): fix 5 compiler divergences from Angular reference#28
Brooooooklyn merged 1 commit into
mainfrom
fix/angular-control-flow-divergences

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 22, 2026

  1. Standalone connected blocks (@else, @empty, @Placeholder, @Loading,
    @error) now emit error diagnostics and produce UnknownBlock nodes
    instead of being silently dropped.

  2. @defer connected block validation now rejects duplicate @placeholder/
    @loading/@error, @error with parameters, and unrecognized params in
    @placeholder/@Loading blocks.

  3. @switch case groups now propagate i18n metadata via
    create_block_placeholder() instead of hardcoding None.

  4. parse_track_expression now returns empty string for bare "track "
    so the downstream EmptyExpr check produces the correct diagnostic.

  5. Comments between connected blocks are no longer marked as processed,
    matching Angular's findConnectedBlocks behavior.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Changes parsing/validation behavior and emitted AST nodes for control-flow blocks, which may affect downstream consumers and error expectations despite being well-covered by new tests.

Overview
Fixes several Angular compiler divergences in the template-to-R3 transform.

Standalone connected blocks (@else, @empty, @placeholder, @loading, @error) now emit diagnostics and produce UnknownBlock nodes instead of being silently ignored, and comment nodes between connected blocks are skipped without being marked processed.

Tightens @defer connected-block handling to validate duplicates and parameters (rejects multiple connected blocks of the same type, forbids params on @error, and reports unrecognized params on @placeholder/@loading), propagates i18n metadata for @switch case groups, and adjusts @for track parsing to treat track as a match so the downstream empty-expression diagnostic is triggered (removing unused deferred-time param helpers accordingly).

Written by Cursor Bugbot for commit b4f2914. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread crates/oxc_angular_compiler/src/transform/html_to_r3.rs
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-control-flow-divergences branch from ad19b39 to 655700f Compare February 22, 2026 05:26
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread crates/oxc_angular_compiler/src/transform/html_to_r3.rs
1. Standalone connected blocks (@else, @empty, @Placeholder, @Loading,
   @error) now emit error diagnostics and produce UnknownBlock nodes
   instead of being silently dropped.

2. @defer connected block validation now rejects duplicate @placeholder/
   @loading/@error, @error with parameters, and unrecognized params in
   @placeholder/@Loading blocks.

3. @switch case groups now propagate i18n metadata via
   create_block_placeholder() instead of hardcoding None.

4. parse_track_expression now returns empty string for bare "track "
   so the downstream EmptyExpr check produces the correct diagnostic.

5. Comments between connected blocks are no longer marked as processed,
   matching Angular's findConnectedBlocks behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-control-flow-divergences branch from 655700f to b4f2914 Compare February 22, 2026 06:36
@Brooooooklyn Brooooooklyn merged commit 52b25dc into main Feb 22, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-control-flow-divergences branch February 22, 2026 06:52
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.

1 participant