-
Notifications
You must be signed in to change notification settings - Fork 768
refactor(): value types for directives expecting simple string or string combinations #902
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
In principle, I have no issue with this. It wouldn't affect the runtime build size because all of this is typed metadata, and it's great for developer experience. Unfortunately, with #900, we're getting rid of individual inputs in favor of making the custom breakpoints story easier for developers, which I think is more of a benefit of this change. If there is a way to get this in without changing the |
I've also updated the Wiki for |
@CaerusKaru I see, is it because of It's a pitty that the inputs are removed, it now lacks a type safety and using inputs in metadata decorator is a bad practice according to angular style guide. I'd like to have a closer look on the possibilities, but I don't fully understand the motivation and changes in mentioned PR. Would you have a time for some intro? |
@vmasek It's not because of the constructor, we're actually refactoring so that you don't need to include one in a custom breakpoint directive as part of #900. I have two points about type safety and the style guide. For type safety, inputs generally don't require them, especially in our library where most directives accept any type of value and are coerced to the correct type at runtime. We have documentation that provides the options for our users, and while it would definitely be easier to have an inline reference, maybe a better place for that would be the package README (or the module README?). As for the style guide, it is a general best practice guide for end users, not library authors. Angular Material, for instance, violates many of the style guide core principles, most notably by using the If we were to not follow this, and revert back to using This is the motivation behind #900, to reduce complexity and overhead introduced by having a ton of |
Thank you, in that case, I am closing this PR, if I manage to come up with some other solution for this, I will discuss it in new PR/Issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This will enable input value completion in IDEs when using
fxLayout
,fxFlexAlign
,fxShowHide
andfxLayoutAlign
directivesI used supported values from directives API docs in wiki
and also included some that are not mentioned there
flex-
prefixes forstart
andend
baseline
forLayoutAlign
which was not mentioned in wiki fxLayoutAlign-APITested in WebStorm with Angular Language service enabled.