Commit graph

6 commits

Author SHA1 Message Date
Doug Parker
05d022d5e6 fix(compiler-cli): ignore generated ngDevMode signal branch for code coverage
The Angular compiler unconditionally adds a debug name transform for signals
which generates a conditional on `ngDevMode` (e.g., `ngDevMode ? { debugName: "xyz" } : []`).
During testing, `ngDevMode` is true, so the true branch executes but the
false branch is never executed. Consequently, coverage tools report the
false branch as an untested line/branch, preventing 100% test coverage.

This commit adds a synthetic `/* istanbul ignore next */` comment to the
generated false branch so that Istanbul ignores it. We only include the
istanbul comment (instead of additionally including c8) to focus on the
established standard for Angular CLI/Karma coverage while maintaining
compatibility with modern Vitest setups, since @vitest/coverage-v8 now
natively respects the fallback istanbul comment.

Fixes #64583

(cherry picked from commit dc4cf649b6)
2026-03-04 22:42:57 +00:00
Shuaib Hasan Akib
1b4dcc01ff docs: replace old https://angular.io/license with https://angular.dev/license 2026-01-12 13:41:30 -08:00
Kristiyan Kostadinov
e30e61b789 fix(compiler-cli): avoid allocating an object for signals in production mode
Currently when the signal debug name transform sees something like `const foo = signal(0);`, it transforms the signal into `signal(0, {...(ngDevMode ? { debugName: 'foo' } : {})})`. After minification this becomes `signal(0, {})` which will allocate memory for the empty object literal.

These changes rework the logic to produce `signal(0, ...(ngDevMode ? [{ debugName: 'foo' }] : []))` which will be fully tree shaken away to `signal(0)`.
2025-12-02 15:06:51 +01:00
hawkgs
0f4b11c293 refactor(compiler-cli): add a resource debugName transform (#64172)
Add a TS transform for `resource` (and `httpResource`) `debugName`. Test the transformations.

PR Close #64172
2025-11-24 11:30:12 -05:00
Kristiyan Kostadinov
f5b50ec20d refactor: clean up explicit standalone flags from tests (#63963)
Since standalone is the default, we can dropn the `standalone: true` flags from our tests.

PR Close #63963
2025-09-22 14:27:34 +00:00
AleksanderBodurri
3a9a70de08 refactor(compiler-cli): implement transform to determine debugName from signal functions (#57348)
Implements a compiler transform that attempts to statically analyze variable names and apply them to usages of signal functions like signal, computed, effect, etc.

PR Close #57348
2025-06-03 20:34:12 -04:00