Skip to content

fix(jit+aot): ctorParameters and AOT propDecorators should include every @angular/core decorator, not just the name list #538

Closed

Description

@Brooooooklyn

Follow-up from #522 / #537 — same class of divergence on sibling paths.

Problem

ngtsc's isAngularDecorator gate is import-only: decorator.import.from === '@angular/core' (no name check). OXC now matches this for JIT propDecorators (#537), but three sibling paths still filter decorators by a hard-coded name list, so @angular/core decorators whose names aren't listed are silently dropped:

Path File Current filter Upstream
JIT ctorParameters crates/oxc_angular_compiler/src/component/transform.rs (extract_jit_ctor_params) angular_param_decorator → PARAM_DECORATORS isAngularDecorator on every param (downlevel_decorators_transform.ts:475)
AOT setClassMetadata ctor params crates/oxc_angular_compiler/src/class_metadata/builders.rs (build_ctor_params_metadata_in, ~line 966) angular_param_decorator → PARAM_DECORATORS ctorParameterToMetadata → isAngularDecorator (metadata.ts:174-176)
AOT setClassMetadata propDecorators crates/oxc_angular_compiler/src/class_metadata/builders.rs (build_prop_decorators_metadata_in, ~line 534) angular_member_decorator → MEMBER_DECORATORS field list decoratedClassMemberToMetadata → isAngularDecorator (metadata.ts:190-191)

Concrete divergence: @Component() or @Foo imported from @angular/core on a ctor param / member is listed by ngtsc in ctorParameters/propDecorators, but OXC drops it (AOT) or lowers it via __param/__decorate (JIT).

Expected

Use the import check (the new is_angular_core_decorator added in #537, or the equivalent ctor-param helper) instead of the name lists on these three paths — same rule ngtsc applies everywhere.

References

  • Upstream: packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.ts:18,475
  • Upstream: packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.ts:174-191,227-229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions