Replace compact-input
& labeled-form-element
with composables
#11491
Labels
kind/tech-debt
Technical debt
QA/dev-automation
Issues that engineers have written automation around so QA doesn't have look at this
The existing
compact-input
&labeled-form-element
mixins were translated to composables nameduseCompactInput
&useLabeledFormElement
as a means to proof out the concept of using composables and to resolve issues with TypeScript compatibility when migrating fromVue.extend
todefineComponent()
.Not all mixin usages were replaced, resulting in divergence between the original mixins and their replacement composables.
Proposed solution
Update
useCompactInput
&useLabeledFormElement
to ensure feature parity with existing mixins.Replace the
compact-input
&labeled-form-element
mixins with their respective composables in:Replace the
labeled-form-element
mixin with its respective composable in:Remove the
compact-input
&labeled-form-element
mixins from Dashboard entirely.Additional Information
Benefits of using composables over mixins:
TypeScript Support
Composables offer better TypeScript support and leverage static typing and autocompletion out of the box without requiring additional developer intervention.
Simple Unit Testing
Composables are functions that return reactive objects, making them much easier to unit test. Unit tests can be written by importing and calling the composable function without instantiating a Vue component.
Examples:
The text was updated successfully, but these errors were encountered: