When a decorator's template: or selector: is a JS template literal interpolating a module-level const, OXC fails to evaluate it — either bailing entirely (no ɵcmp) or compiling with an unresolved selector.
Repro
import { Component } from '@angular/core';
const twBtn = `px-4 py-2 rounded`;
@Component({ selector: 'app-btn', template: `<button class="${twBtn}">x</button>` })
export class BtnComponent {}
Actual
Emits the verbatim @Component source — no ɵcmp. With ${...} in selector:, compiles but emits selectors: [["ng-component"]].
Expected
Angular's partial evaluator resolves const-bound (incl. nested/chained) template literals in static metadata fields. OXC already handles styles: correctly — only template:/selector: regress. Commit a2e5d4d (#271) covered plain string consts but not template-literal consts.
Impact
AOT — an uncompiled component is dead at runtime; an unresolved selector silently never matches its tag.
Researched and drafted with Claude Code.
When a decorator's
template:orselector:is a JS template literal interpolating a module-levelconst, OXC fails to evaluate it — either bailing entirely (noɵcmp) or compiling with an unresolved selector.Repro
Actual
Emits the verbatim
@Componentsource — noɵcmp. With${...}inselector:, compiles but emitsselectors: [["ng-component"]].Expected
Angular's partial evaluator resolves
const-bound (incl. nested/chained) template literals in static metadata fields. OXC already handlesstyles:correctly — onlytemplate:/selector:regress. Commit a2e5d4d (#271) covered plain string consts but not template-literal consts.Impact
AOT — an uncompiled component is dead at runtime; an unresolved selector silently never matches its tag.
Researched and drafted with Claude Code.