Simplify the process of wrapping a BootstrapVue component in GitLab-UI
I’ve been trying to understand the reason behind adding the bootstrap-vue dependency directly to the GitLab repo instead of creating a BV component wrapper in gitlab-ui (see https://gitlab.com/gitlab-org/gitlab/-/blob/master/package.json#L59). I found some factors that drove that decision. Thanks to @rhardarson for all the help understanding the Collapsed component situation.
- New developers are more likely to do it because we don’t have the decision of not adding bootstrap-vue to GitLab documented.
- The steps described in the documentation that covers adding new components feel overkill for the scenario of wrapping a bootstrap-Vue component that won’t replace any use case in GitLab. See https://gitlab.com/gitlab-org/gitlab-ui/-/blob/master/doc/contributing/adding_components.md
- Also, we have a component’s lifecycle docs, but that lifecycle only applies to components documented in Pajamas. We do not make that observation in the document. Developers may understand that they should cover that lifecycle for wrapping a BV component. See https://gitlab.com/gitlab-org/gitlab-ui/-/blob/master/doc/component-lifecycle.md
- We required a large number of approvals with the Danger Roulette recommendations and the gitlab-ui WG approval. We have addressed that problem so far.
I think we should simplify the steps required to wrap a BV component in gitlab-ui. Otherwise, developers will feel frustrated by a large number of requirements for such a simple task and will find a shorter route to achieve their goals. I propose some action items to address this problem:
-
Document the decision of not adding bootstrap-vue as a GitLab dependency (https://docs.gitlab.com/ee/development/fe_guide/dependencies.html). -
Create a section in doc/adding_components.mdabout wrapping BV components in gitlab-ui. Steps 4 and 5 should be enough to wrap a component because it’s unlikely to cause unintended side-effects in GitLab. !1133 (merged) -
Update the component’s lifecycle docs to highlight that the lifecycle is relevant to components that are documented in the Pajamas design system. !1133 (merged)
Edited by Enrique Alcántara