hackoregon / civic

The frontend monorepo for the CIVIC platform.
http://civicplatform.org
MIT License
60 stars 26 forks source link

Break up the component-library into smaller modules #1200

Closed jaronheard closed 4 years ago

jaronheard commented 4 years ago

Summary

This pull request breaks up the component-library into smaller packages, with the intention of replacing and deprecating the component library in favor of these smaller modules.

It leaves the current component-library architecture as the default for now, so all components are now duplicated across packages. The plan for moving to the new components will be detailed in an upcoming RFC.

New packages

Packages Description Dependencies Dev Dependencies Comments
ui-brand Brand assets ui-themes, utils ui-docs
ui-cards Story cards ui-brand*, ui-core, ui-themes, utils ui-charts ui-brand: Logo used for loading spinner
ui-charts Charts components ui-brand*, ui-themes, utils ui-brand: Logo used for loading spinner
ui-core Common UI components ui-themes, utils
ui-docs Style guide and Storybook styles ui-themes ui-brand
ui-maps Map components ui-brand, ui-charts, ui-core, ui-themes, utils
ui-themes Themes and common styles
utils Utilities

Next steps

Future work

jaronheard commented 4 years ago

Per discussion with @DingoEatingFuzz, making the following adjustments:

ghost commented 4 years ago

I can't provide the caliber of technical review that @DingoEatingFuzz can, so I'll focus on participatory design aspects. These are probably the kinds of things that I'd put in an RFC about the migration process:

jaronheard commented 4 years ago

@Dianna, thanks for the review! In response to your bullets:

Should we transition all apps using the existing component library to this modular version and completely remove the old library?

See #1207 for details on your first bullet, and let me know if you have further comments after reviewing that.

I'm a bit concerned about the READMEs (sic)

Agreed, I'll flesh out the READMEs per your suggestion. I did the minimum viable READMEs as part of my first PR with the expectation that I'd fill them out a bit once we knew how everything was shaking out, so thanks for the reminder.

jaronheard commented 4 years ago
  1. There are some duplicated files across packages. Are those intentional or by accident?

The duplicated files that you identified was accidental. I've removed the extraneous asset folder that existed in ui-charts

  1. What's the deal with the .toMove files? Is that part of a multistep rollout or something?

Yep, rather than update 2018 to use the new components now, I'm going to do that in a separate PR. The components that will live within 2018 are in a temporary .toMove folder, and will live within src in the future.

The tarball size comparison[1]:

image image
  1. For some reason Bundlephobia fails on the component-library ... I was able to get a direct comparison using this tool.
jaronheard commented 4 years ago

Ok, I think this is ready now -- the comments have either been resolved, or incorporated into #1207.