fix: directive compiler uses flat array format for hostDirectives input/output mappings#77
Merged
Brooooooklyn merged 2 commits intomainfrom Mar 5, 2026
Conversation
…ut/output mappings
The directive compiler was using `create_string_map()` which generated object format
`{publicName: "internalName"}` for host directive mappings. Angular's runtime expects
flat array format `["publicName", "internalName"]`. Replaced with
`create_host_directive_mappings_array()` matching the component compiler's implementation.
- Fix #67
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.
…ective/component Mirrors Angular's structure where `createHostDirectivesMappingArray` is defined once in `view/compiler.ts` and imported by `partial/directive.ts`. The shared function now lives in `directive::compiler` (pub(crate)) and is imported by `component::definition`, with the `with_capacity_in` optimization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

The directive compiler was using
create_string_map()which generated object format{publicName: "internalName"}for host directive mappings. Angular's runtime expectsflat array format
["publicName", "internalName"]. Replaced withcreate_host_directive_mappings_array()matching the component compiler's implementation.hostDirectivesinput/output mappings #67Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Changes the emitted JS shape for directive
hostDirectivesmappings, which can affect runtime behavior for consumers relying on the previous (incorrect) object format; scope is limited to host-directive codegen and covered by new tests/fixtures.Overview
Fixes
@DirectivehostDirectives input/output alias emission to match Angular’s expected flat array mapping format (e.g.inputs:["public","internal"]) instead of object maps, aligning directive output with the existing component compiler.This extracts a shared
create_host_directive_mappings_arrayhelper (re-exported fromdirective) and removes the duplicate implementation from the component definition code, plus adds focused unit tests and new e2e fixtures covering directive hostDirectives mappings (inputs, outputs, and both).Written by Cursor Bugbot for commit f1b1c4d. This will update automatically on new commits. Configure here.