-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nimble Angular extends the Angular public API #732
Comments
One step we could take to move this forward would be to open an issue / discussion / feature request on the Angular repo to explain our use case and request that the classes we extend be added to the public API. Even if it doesn't get prioritized immediately it would be good to have our use cases on their radar. |
Another potential option coming in v14 is utilizing hostDirectives. The idea being, apply an Angular accessor directive with a nimble directive. |
Unfortunately, it looks like that was only added in v15. |
@jattasNI It looks like a promising approach to me. I'd imagine we could wait until then to resolve this. |
Ah yea, related to the issues in the Default CVA, Angular doesn't want to make the default CVA's standalone either: #1017 (comment) |
🐛 Bug Report
NimbleSelectControlValueAccessorDirective and NimbleSelectListOptionDirective extend classes from @angular/forms.
Update:
There seem to be many more cases where we extend Angular classes that do not seem to be explicitly marked as extendable/non-final. This is not a comprehensive list:
NimbleNumberFieldControlValueAccessorDirective
extendsNumberValueAccessor
, whose API doc does not explicitly say it is not final/can be extended.NimbleRadioControlValueAccessorDirective
extendsRadioControlValueAccessor
, whose API doc does not explicitly say it is not final/can be extended.NimbleToggleButtonControlValueAccessorDirective
andNimbleSwitchControlValueAccessorDirective
extendCheckboxControlValueAccessor
, whose API doc does not explicitly say it is not final/can be extended.NimbleTextFieldControlValueAccessorDirective
andNimbleTextAreaControlValueAccessorDirective
extendDefaultValueAccessor
, whose API doc does not explicitly say it is not final/can be extended.This is not supported unless explicitly documented.
💻 Repro or Code Sample
See NimbleSelectControlValueAccessorDirective and NimbleSelectListOptionDirective.
🤔 Expected Behavior
N/A
😯 Current Behavior
N/A
💁 Possible Solution
This is just a warning that extending the public API can lead to breakages and isn't recommended. If they are documented as supporting such, this can be closed. My search was not extensive. An alternative might be to use composition. Except for the constructor, NimbleSelectListOptionDirective is probably not a high risk. However, NimbleSelectControlValueAccessorDirective appears to depend on undocumented API.
🔦 Context
This was investigated as a possible cause to #729. It was not.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: