bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 59 forks source link

UI - investigate component library/architecture #4551

Closed Kaineatthelab closed 4 years ago

Kaineatthelab commented 4 years ago

Description (This ticket was repurposed -- it was initially to move the existing Add Comment Detail component into some component library for reuse. This has now expanded as described below.)

The purpose of this ticket is to investigate current (Vue) component library architectures / Vue composition API that we should use for components used within and between different UI projects (eg, IA correction components). Suitable solutions should be documented in a RFC for other developers to review.

This ticket is time-boxed as 1 day for now; follow-on tickets can be created for additional work (eg, implementation of repo or whatever).

Considerations

Still To Do

severinbeauvais commented 4 years ago

Considerations:

Options:

monorepo: aka multi-package repo - different packages in different directorirs, each published individually

Lerna can be used to separate components within the library into packages within the repo.

References visited: https://vue-composition-api-rfc.netlify.app https://markus.oberlehner.net/blog/vue-application-structure-and-css-architecture/ https://www.reddit.com/r/vuejs/comments/8cjmdj/sharing_components_between_projects/ https://www.reddit.com/r/javascript/comments/89y2sp/best_way_to_share_code_between_projects/ https://vuejsdevelopers.com/2020/02/17/vue-composition-api-when-to-use/ https://codeburst.io/how-to-share-reusable-vue-components-between-a-c36bc775418d https://vue-loader.vuejs.org/guide/css-modules.html#using-with-pre-processors https://stackoverflow.com/questions/54761154/sharing-assets-and-components-between-vue-projects https://stackoverflow.com/questions/27379818/git-possible-to-use-same-submodule-working-copy-by-multiple-projects https://stackoverflow.com/questions/19424469/referring-to-the-same-submodule-twice https://tarektouati.github.io/vue-use-web/ https://blog.bitsrc.io/how-to-easily-share-vue-components-between-applications-1d30a1ad4e4d https://www.npmjs.com/package/meta https://www.atlassian.com/git/tutorials/monorepos https://medium.com/js-dojo/sharing-reusable-vue-js-components-with-lerna-storybook-and-npm-7dc33b38b011 https://vueschool.io/articles/vuejs-tutorials/reusing-logic-in-vue-components/ https://codeburst.io/creating-reusable-components-with-vue-js-button-component-503167facfde https://medium.com/@DaveAbiola/vue-js-reusable-components-cfced2af9c00 https://hackernoon.com/5-practical-ways-to-share-code-from-npm-to-lerna-and-bit-732f2a4db512 https://blog.bitsrc.io/monorepo-architecture-simplified-with-bit-and-npm-b1354be62870 https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt https://vuejs.org/v2/guide/components-slots.html https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html https://dev.to/pixari/multiple-vuejs-apps-in-a-lerna-monorepo-sharing-a-storybook-component-library-1f7k https://vue-styleguidist.github.io/ https://about.gitlab.com/

severinbeauvais commented 4 years ago

"bit" looks like a good way to collaborate on isolated components across projects and repos, but...

See also https://github.com/teambit/bit.

severinbeauvais commented 4 years ago

I have created a prototype (monorepo with Lerna) here: https://github.com/bcgov/bcrs-shared-components

Link to our Storybook page: https://bcgov.github.io/bcrs-shared-components/

Refs:

severinbeauvais commented 4 years ago

It was agreed at standup today to spend another 1/2 day max to document what I've so far and create an RFC to solicit feedback.

severinbeauvais commented 4 years ago

RFC: https://github.com/bcgov/entity/pull/4755

severinbeauvais commented 4 years ago

Conclusion

The RFC was broadly approved.

There is some follow-on work needed before we can fully use this library (see "Still To Do" in description above). I may pick away at this in my spare time and/or it can be figured out while working on some Create/Edit/Filings UI components that should be in this library.