You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3a4f3ea
Browse filesBrowse the repository at this point in the historyBrowse files
feat(transform): support @service decorator in JIT downlevel transform (#311) (#320)
* feat(transform): support @service decorator in JIT downlevel transform (#311)
Recognize Angular v22's @service decorator in the JIT downlevel pipeline so
the runtime JIT facade (compileService) can rediscover it. A @service class is
now restructured the same way as @Injectable: decorator removed, static
decorators/ctorParameters emitted, and lowered via __decorate(...).
- Add `Service` variant to `AngularDecoratorKind` and match it in
`find_angular_decorator`; include `"Service"` in `ANGULAR_DECORATOR_NAMES`.
- Add `AngularVersion::supports_service_decorator()` (v22+) helper.
- Version-gate: when targeting Angular < 22, emit a diagnostic and leave the
@service decorator unchanged (pass-through), since the runtime lacks
compileService. Unknown version defaults to "supports".
- Tests: @service downlevels like @Injectable (snapshot); targeting v21
surfaces a diagnostic and leaves the decorator in source.
https://claude.ai/code/session_01U6t6qXHNPsEUk5ZFEcB8NQ
* fix(jit): skip non-Angular @service decorators when scanning for class kind
A bare `@Service()` matched by raw name only would shadow a real Angular
decorator on the same class. On pre-v22 targets the version gate would
then emit a misleading "requires v22" diagnostic and `continue` past the
sibling `@Component`/`@Injectable`, leaving it unlowered.
Thread the import map into `find_angular_decorator` and require the
`Service` identifier to resolve to `@angular/core`. Other Angular
decorator names are left as raw-name matches to preserve namespace-style
usage like `@core.Component()`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments