feat(angular): implement link_component for native Rust linker#24
Merged
Conversation
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>
2370ce6 to
d55d787
Compare
- 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>
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:
in component/transform.rs for template and host binding compilation
selectors, inputs/outputs, queries (content + view), host attrs/bindings,
features, dependencies, styles, encapsulation, change detection, and
animations
build_queries, build_features, get_array_property
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
ɵɵngDeclareComponentintoɵɵdefineComponentby 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
inputshandling by converting partial-declaration input shapes into definition format.Improves dev tooling: HMR update module now conditionally restores
inputsfrominputConfigto avoid double-processing, the Vite linker plugin switches to asynclinkAngularPackageand 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.