refactor(angular): use [flagNameFeatureFlag] selector for generated directives#227
Conversation
Summary of ChangesHello @tomflenner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Angular directive generation logic to append a Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the Angular directive generator to append the FeatureFlag suffix to selectors and their corresponding inputs. This is a solid improvement for consistency and to prevent potential naming collisions in consuming applications. The changes have been applied consistently across the generator template, test files, and golden file snapshots. I've identified one pre-existing issue where a necessary input is missing from the generated directives, which I've detailed in a specific comment. Addressing this would make the generated code more robust.
…irectives Signed-off-by: backtrack5r3 <flennertom@gmail.com>
9ef3d8d to
9790ffe
Compare
This PR
Refactors the Angular directive selector generated by the CLI to append the
FeatureFlagsuffix.Previously, directives were generated using:
selector: '[{{ .Key | ToCamel }}]'They are now generated as:
selector: '[{{ .Key | ToCamel }}FeatureFlag]'This change aligns the generated directives with the existing Angular SDK naming convention (
<type>FeatureFlag, e.g.booleanFeatureFlag,stringFeatureFlag) and reduces the risk of selector collisions with:Example before:
Example after:
This makes the intent explicit and prevents conflicts with application-level naming.
Related Issues
Fixes #225
Notes
Depending on the project’s release policy, this may require a major version bump due to the selector change.
How to test
make test-integration