Skip to content

fix(compiler): prepend synthesized signal-API decorators before explicit member decorators - #542

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/issue-540-signal-decorator-order
Oct 6, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/issue-540-signal-decorator-order

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Fixes #540.

Problem

When a member carries an explicit Angular decorator and a signal-API initializer — e.g. @Output() x = input(0) — OXC appended the synthesized signal decorator after the explicit ones in propDecorators. Upstream getInitializerApiJitTransform prepends it ([newDecorator, ...member.node.modifiers] in initializer_api_transforms/input_function.ts:93), so the synthesized decorator comes first.

Change

extract_all_jit_member_decorators now splices the synthesized decorators to the front of the member's Angular decorator list instead of extending the tail.

Example

@Output() x = input(0);

Before: x: [{type: Output}, {type: i0.Input, args: [...]}]
After (matches ngtsc): x: [{type: i0.Input, args: [...]}, {type: Output}]

Testing

  • New test synthesized_decorator_precedes_explicit_member_decorators covers input() + @Output() and model() + @HostBinding() (model synthesizes two decorators; both must precede the explicit one).
  • cargo test -p oxc_angular_compiler: 2941 passed, 0 failed.
  • Verified end-to-end through the napi binding (transformAngularFileSync(..., {jit: true})).

Ordering-only change; the set of emitted decorators is unchanged.

…cit member decorators

Upstream's getInitializerApiJitTransform inserts the synthesized
decorator ahead of the member's existing decorators
(`[newDecorator, ...member.node.modifiers]`), so `@Output() x = input(0)`
lists the synthesized `i0.Input` before the explicit `Output` in
`propDecorators`. OXC appended them instead.

Insert `synthesize_signal_api_decorators` results at the front of the
member's Angular decorator list, matching the upstream order. Ordering
of the member's `propDecorators` array only; the set of emitted
decorators is unchanged.

Fixes #540
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Brooooooklyn
Brooooooklyn merged commit a7fb06a into main Oct 6, 2026
10 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/issue-540-signal-decorator-order branch October 6, 2026 10:30
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.

fix(jit): synthesized signal-API decorators should be prepended before explicit member decorators

1 participant