3 Commits
Author SHA1 Message Date
Matthieu Riegler 093dd364c6 refactor(compiler): remove standalone:true from ngp tests
This should prevent agents from adding more.
2026-10-19 20:11:55 +02:00
Matthieu Riegler dd5ef53817 fix(compiler-cli): preserve pure annotations on ngp static fields through tsc
When ngp emits a static definition as `static ɵcmp: Type = /*@__PURE__*/ i0.ɵɵdefineComponent(...)` on a single line, TypeScript attaches `/*@__PURE__*/` as a trailing comment of the `=` token rather than a leading comment of the initializer. When downstream `tsc` erases the static field type annotation (ES2022) or downlevels the static field to `Class.ɵcmp = ...` (ES2015/ES5), it drops trailing comments of `=`, stripping `/*@__PURE__*/` and preventing bundlers from tree-shaking unused Angular classes.

Place `/*@__PURE__*/` on the line after `=` with its own `// @ts-ignore` line (matching the existing placement used for `/** @pureOrBreakMyCode */`), so `tsc` attaches it as leading trivia of the initializer and preserves it across both type stripping and downleveling.

Also remove the test normalizer and compliance workarounds that previously hid the stripped comment.
2026-10-19 09:23:07 +02:00
4e4ad75144 refactor(compiler-cli): integrate hybrid preprocessor into compiler-cli
Integrate the hybrid Angular preprocessor (NGP) under packages/compiler-cli/preprocessor,
along with its language service integration, VS Code extension, and Rust/Wasm Bazel toolchain.

Key components included:
- Rust-based AST analyzer and Wasm compilation target (packages/compiler-cli/preprocessor/ng-analyze)
- Preprocessor engine and Jasmine test suites (packages/compiler-cli/preprocessor)
- Language service extension and specs (packages/compiler-cli/preprocessor/language-service)
- Experimental VS Code extension (ngp-vscode-ng-language-service)
- Rust toolchain and crate dependencies in Bazel (MODULE.bazel, Cargo.toml)

Monorepo integration & compatibility adjustments:
- Rust toolchain & hermetic Bazel testing: Made N-API optional (default = [] in Cargo.toml) and
  added non-NAPI fallback methods on Analyzer and TestAnalyzer (analyzer.rs, test_analyzer.rs,
  lib.rs) for native Bazel rust_test and Wasm compilation; replaced static Cargo.toml lookups in
  fs.rs tests with hermetic tempfile fixtures for Bazel sandbox execution; updated driver test
  fixture for Option<String> local_name.
- Angular monorepo TypeScript & linting compliance: Added tslint:disable:no-console pragmas to CLI
  entrypoints (main.ts, ngp.ts); added explicit override modifiers (output_ast_printer.ts); aligned
  TypeScript ESM imports (tcb_ls_util.ts); and consolidated compiler imports and type references
  (processor.ts, hybrid_compiler.ts).

Co-authored-by: Matthew Beck <[email protected]>
Co-authored-by: Alex Rickabaugh <[email protected]>
Co-authored-by: Kristiyan Kostadinov <[email protected]>
Co-authored-by: JoostK <[email protected]>
Co-authored-by: Matthieu Riegler <[email protected]>
2026-10-08 14:23:48 -07:00