Skip to content

fix(angular): fix 4 compiler bugs and add regression tests#23

Merged
Brooooooklyn merged 2 commits into
mainfrom
fix/angular-compiler-bugs
Feb 12, 2026
Merged

fix(angular): fix 4 compiler bugs and add regression tests#23
Brooooooklyn merged 2 commits into
mainfrom
fix/angular-compiler-bugs

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 12, 2026

Fix directive factory namespace resolution to always use namespace-prefixed
DI tokens (i1.Store instead of bare Store), ensuring correctness after
TypeScript import elision. Fix i18n ɵɵi18nPostprocess to emit with namespace
prefix. Fix view/content query chaining to emit separate statements per query
instead of chaining calls. Add Angular linker Vite plugin and clean up unused
sourcemap/jit parameters.

Includes 6 Rust integration tests and 7 NAPI compare fixtures covering all
regressions.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Touches core codegen paths for DI factories, queries, and NgModule injector imports and adds a new linker that rewrites library JS, so regressions could impact runtime behavior across many apps despite added test coverage.

Overview
Fixes several Angular runtime correctness issues and adds a new package linking capability.

DI factory generation now consistently emits namespace-prefixed tokens (including @Inject(...) and directive ctor deps) by introducing a resolve_factory_dep_namespaces pass and adjusting directive token extraction, preventing failures after TypeScript import elision. Query generation is updated to emit one statement per view/content query (no chained calls) for Angular 20’s void-returning query APIs, and ɵɵi18nPostprocess is now emitted as i0.ɵɵi18nPostprocess to avoid runtime ReferenceError.

NgModule injector imports now preserve raw import expressions (e.g. StoreModule.forRoot(...), spreads) for correct ModuleWithProviders resolution. Adds an Angular partial-declaration linker (ɵɵngDeclare*ɵɵdefine*, excluding components) exposed via NAPI, plus a Vite plugin that runs it over node_modules, and expands regression coverage with new Rust integration tests and NAPI compare fixtures.

Written by Cursor Bugbot for commit b479471. This will update automatically on new commits. Configure here.

Fix directive factory namespace resolution to always use namespace-prefixed
DI tokens (i1.Store instead of bare Store), ensuring correctness after
TypeScript import elision. Fix i18n ɵɵi18nPostprocess to emit with namespace
prefix. Fix view/content query chaining to emit separate statements per query
instead of chaining calls. Add Angular linker Vite plugin and clean up unused
sourcemap/jit parameters.

Includes 6 Rust integration tests and 7 NAPI compare fixtures covering all
regressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-compiler-bugs branch from b5ebf09 to b479471 Compare February 12, 2026 09:22
@Brooooooklyn Brooooooklyn merged commit 609cf94 into main Feb 12, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-compiler-bugs branch February 12, 2026 09:49
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.

1 participant