Skip to content

Commit d2d4015

Browse files
Brooooooklynclaude
andcommitted
Angular compiler: 100% fixture alignment (151/151) + test runner improvements
## Compiler Fixes ### Defer Block Alignment (17/17 fixtures) - Add `ingest_defer_view` helper for defer block content generation - Generate child template functions (Defer, DeferLoading, DeferPlaceholder, DeferError) - Fix `ɵɵdefer()` signature to match Angular output - Add flags calculation for hydrate triggers - Fix slot propagation to defer ops ### i18n Implementation (16/16 fixtures) - Fix i18n attribute detection and `I18nMeta::Message` creation - Fix interpolation expression extraction and slot dependencies - Add ICU placeholder generation with unique naming (VAR_PLURAL, VAR_PLURAL_1, etc.) - Fix `i18n-*` attribute metadata propagation - Add `I18nMeta::BlockPlaceholder` for control flow blocks inside i18n - Fix nested ICU expression counting ## Compare Test Runner Improvements - Fix ArrowFunctionExpr body handling (statement vs expression bodies) - Fix findDeferBlocks to traverse ForLoopBlock.empty - Fix TaggedTemplateLiteralExpr typo and LocalizedString placeholders - Make expectedFeatures check stricter (track per-compiler features) - Wire up skipReason for fixture skipping - Remove unused expectFail feature ## Results - Fixtures: 151/151 (100%) - bitwarden-clients: 651/651 (100%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 484355e commit d2d4015

File tree

65 files changed

+10989
-680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+10989
-680
lines changed

crates/oxc_angular_compiler/src/ast/r3.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ pub enum I18nMeta<'a> {
2121
Message(I18nMessage<'a>),
2222
/// Part of a containing message.
2323
Node(I18nNode<'a>),
24+
/// Control flow block placeholder (for @if/@else/@for etc. inside i18n blocks).
25+
/// Ported from Angular's `i18n.BlockPlaceholder`.
26+
BlockPlaceholder(I18nBlockPlaceholder<'a>),
2427
}
2528

2629
/// An i18n message containing translatable content.
@@ -860,6 +863,20 @@ pub struct R3DeferredBlockTriggers<'a> {
860863
pub never: Option<R3NeverDeferredTrigger>,
861864
}
862865

866+
impl R3DeferredBlockTriggers<'_> {
867+
/// Returns true if any trigger is set.
868+
pub fn has_any(&self) -> bool {
869+
self.when.is_some()
870+
|| self.idle.is_some()
871+
|| self.immediate.is_some()
872+
|| self.hover.is_some()
873+
|| self.timer.is_some()
874+
|| self.interaction.is_some()
875+
|| self.viewport.is_some()
876+
|| self.never.is_some()
877+
}
878+
}
879+
863880
/// A deferred block (`@defer`).
864881
#[derive(Debug)]
865882
pub struct R3DeferredBlock<'a> {

crates/oxc_angular_compiler/src/ir/ops.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,9 @@ pub struct DeferOp<'a> {
10281028
pub own_resolver_fn: Option<OutputExpression<'a>>,
10291029
/// SSR unique ID.
10301030
pub ssr_unique_id: Option<Atom<'a>>,
1031+
/// Defer block flags (e.g., HasHydrateTriggers = 1).
1032+
/// Corresponds to `flags` in Angular TS's DeferOp.
1033+
pub flags: Option<u32>,
10311034
}
10321035

10331036
/// Defer trigger.

0 commit comments

Comments
 (0)