Skip to content

feat(angular): implement link_component for native Rust linker#24

Merged
Brooooooklyn merged 11 commits into
mainfrom
feat/link-component
Feb 13, 2026
Merged

feat(angular): implement link_component for native Rust linker#24
Brooooooklyn merged 11 commits into
mainfrom
feat/link-component

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 12, 2026

Implement ɵɵngDeclareComponent → ɵɵdefineComponent linking in the Rust
linker, eliminating the Babel fallback for component declarations. This
was the last missing declaration type, so the linker now handles all
Angular partial declarations natively.

Changes:

  • Add compile_template_for_linker() and compile_host_bindings_for_linker()
    in component/transform.rs for template and host binding compilation
  • Implement link_component() with full support for: template compilation,
    selectors, inputs/outputs, queries (content + view), host attrs/bindings,
    features, dependencies, styles, encapsulation, change detection, and
    animations
  • Add helper functions: extract_host_metadata_input, extract_dependency_types,
    build_queries, build_features, get_array_property
  • Remove Babel fallback from Vite plugin and use async linkAngularPackage
  • Add tests for component linking including host bindings validation

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


Note

High Risk
Large change to Angular linking/codegen by adding template compilation and component metadata emission, which can affect runtime correctness across many libraries. Also changes HMR update behavior and linker plugin integration, increasing the chance of subtle regressions in dev/build flows.

Overview
Enables the Rust linker to convert ɵɵngDeclareComponent into ɵɵdefineComponent by compiling component templates and host bindings and emitting the needed declarations/metadata (e.g. decls, vars, consts, ngContentSelectors).

Extends linking to cover more component metadata (dependencies, queries, features, styles/encapsulation, change detection, animations) and fixes directive/component inputs handling by converting partial-declaration input shapes into definition format.

Improves dev tooling: HMR update module now conditionally restores inputs from inputConfig to avoid double-processing, the Vite linker plugin switches to async linkAngularPackage and injects Angular defines for optimizeDeps, and e2e coverage is expanded with a new input-based component plus HMR tests (and minor CSS HMR stabilization).

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

Copy link
Copy Markdown
Member Author

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

Implement ɵɵngDeclareComponent → ɵɵdefineComponent linking in the Rust
linker, eliminating the Babel fallback for component declarations. This
was the last missing declaration type, so the linker now handles all
Angular partial declarations natively.

Changes:
- Add compile_template_for_linker() and compile_host_bindings_for_linker()
  in component/transform.rs for template and host binding compilation
- Implement link_component() with full support for: template compilation,
  selectors, inputs/outputs, queries (content + view), host attrs/bindings,
  features, dependencies, styles, encapsulation, change detection, and
  animations
- Add helper functions: extract_host_metadata_input, extract_dependency_types,
  build_queries, build_features, get_array_property
- Remove Babel fallback from Vite plugin and use async linkAngularPackage
- Add tests for component linking including host bindings validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Brooooooklyn and others added 2 commits February 12, 2026 23:33
- Use a dedicated `pendingHmrUpdates` Set to track which component files
  have pending HMR updates instead of trying to set Vite's read-only
  `lastInvalidationTimestamp` property on ModuleNode
- Make `inputConfig` override conditional to avoid setting `inputs: undefined`
  for components without inputs, which would corrupt the component definition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs
Comment thread napi/angular-compiler/vite-plugin/angular-build-optimizer-plugin.ts
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs Outdated
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs
Comment thread crates/oxc_angular_compiler/src/linker/mod.rs
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/hmr/update_module.rs
@Brooooooklyn Brooooooklyn merged commit acb705e into main Feb 13, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the feat/link-component branch February 13, 2026 07:06
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