Repository navigation
[Feedback] My few cents about the current state of the component library #291
Replies: 2 comments
mt-selectHave proper opening and closing events for the result-list. This would allow better asynchronous fetches and resets. |
|
Thanks for the feedback! This is very much appreciated. We're well aware of some issues like the modularity. We have plans for the future to improve three-shaking and only outputting the styles for the components that are actually imported. Regarding the flexibility we try to strive for a balance. We want the components to be flexible in a way that allows people to achieve the things their need to do but we also want to restrict certain things to have a sense of uniformity. I agree that some properties should be renamed or changed. Though we need to be careful not to break too many things as this makes it harder to adopt Meteor in some projects where a big migration could bring development to a hold. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have now used the component library several times to build various apps and would like to share my opinions, ideas and thoughts about it.
My feedback is based on my own experience of building Vue applications using external libraries such as NaiveUI, Vuetify and internal ones.
Note that the following is purely my opinion, and while I use phrases like "should", all points are open to discussion.
To give this a bit of structure, I would like to start with the criteria on which my feedback is based:
Modularity
A library's components should be self-contained to allow for optimal bundle size.
Flexibility
A library's components should not feel constrained in their capabilities. Being too fixed could lead to self-developing components, resulting in higher maintenance and less consistent styles.
Therefore, a component should make use of slots to cover most use cases, and also ensure that HTML elements and customisations are left in the
templateblock, rather than being defined alongside your data.Uniformity of API / prop naming
Props, along with slots, are the way to interact with components. Having a consistent way of naming props greatly improves the learning curve, usability and developer experience of the library.
Many components have a mixture of
disable-/enable-andhide-/show-props. Often these are used to indicate what the default value of that prop is, e.g.disable-if it's enabled by default. Default values can/will change, and I would prefer to have a consistent prop naming convention instead.Looking through the existing components, I would like to point out the following criteria:
model-valuewherever the state of a component is managed by one valuevariantto change the appearance of a componentsizeto change the size of a componentshowprefix to show/hide something visuallyenableprefix or adjectives (..able) to enable/disable a feature of the component. Ideally, only one pattern is usedupdate:<prop-name>to update prop values to properly match Vue's intentions, Dev's general expectations, and to allow the use ofv-modeland it's modifierscustom.Data/Form components
model-value,label,name,error,disabled,help-text,required, etc.Feedback about the components
mt-banner
hide-iconshould beshow-iconcustom-iconshould beiconmt-progress-bar
progress-label-typesays "percentage" instead of "percent"mt-checkbox
checkedshould bemodel-valuemt-select
hide-clearable-buttonshould beshow-clearable-buttonsmallshould besizeand properly not a booleanThis component has some performance overhead on large static datasets (> 1000, depending on your system), as each option is prepended in Vue's virtual DOM. Perhaps something like Vuetify's
v-lazymight be interesting to implement.mt-textarea
max-lengthis set, the character counter is not changing onchangebutblurmt-card
largeshould besizeand properly not a booleanmt-empty-state
buttons,headlineanddescriptionmt-card, title and subtitle are namedheadlineanddescriptionmt-tabs
smallshould besizeand properly not a booleanmodel-valuenor aupdate:model-valueevent but insteaddefault-itemandnew-item-activemt-modal
<Teleport>mt-card, this component is rather limited and could make great use of additional slots likeavatar,header-right/title-beforewidthshould be namedsizemt-popover
disable-flowshould beenable-floatorfloatableupdate:is-openedevent but nois-openedpropmt-paginiation
mt-data-table
A data table is properly the hardest to be done nicely in a component library. The current implementation is almost well done. One thing that pops right out is that it's not capable of managing any state by its own. By default, the search bar and settings pop over are enabled, but both aren't functional as long as no prop is bound.
disable-settings-tabledoesn't prohibit the hide of a column → once hidden, a column cannot be made visible againsearch-valueshould be namedsearch-termdisable-searchshould beenable-searchorsearchableallow-row-selectionshould beenable-row-selectionorrows-selectableallow-bulk-editshould beenable-bulk-editorbulk-editableallow-bulk-deleteshould beenable-bulk-deleteorbulk-deletableenable-outline-framingshould beshow-outline-framingenable-row-numberingshould beshow-row-numberingdisable-editshould beenable-editoreditabledisable-deleteshould beenable-deleteordeletabledisable-settings-tableshould beenable-settings-tablecurrent-pageshould bepagination-pageto be inline withpagination-limitandpagination-total-itemsand it's eventpagination-current-page-changepagination-limit-changeshould beupdate:pagination-limitpagination-current-page-changeshould beupdate:pagination-pagesort-changeshould beupdate:sortsearch-value-changeshould beupdate:search-valueopen-detailsshould beitem-editto be inline withitem-deletechange-show-outlinesshould beupdate:show-outlineschange-show-stripesshould beupdate:show-stripeschange-outline-framingshould beupdate:enable-outline-framingchange-enable-row-numberingshould beupdate:enable-row-numberingAll reactions