Skip to content

[RFC] Component Library Migration Plan #1207

@jaronheard

Description

@jaronheard

Component Library Migration Plan

Summary

A plan to migrate from using the component-library to using the smaller modules outlined in #1200

Motivation

Primary motivations

Module size & performance

The component-library is 8.47 MB unpacked, which is way, way too big, especially when you're trying to use CIVIC components outside of civicplatform.org. You should be able to use a Button without adding mapping libraries as dependencies.
(Note that unpacked size isn't really the right way to measure the size of the module, but rest assured it is way too big, even if I don't have the gzipped numbers)

Smaller modules are easier to improve and maintain

By breaking up modules into smaller parts, we can make smaller areas of responsibility that can have the opportunity to engage contributors more effectively.

Detailed design

Plan

  1. Initial implementation of smaller modules
    a. Break up the component-library into smaller modules #1200, which breaks out the smaller modules, but leaves the component-library as the default
  2. Cleanup smaller module implementation
    a. Common module build script and tooling clean-up #1208, tooling & build scripts
    a. Common module documentation improvement #1209, improve documentation
  3. Switch to usage of smaller modules in civic repo
    a. Update default Storybook to use smaller modules. Also our hosted Storybook would be updated at this time.
    b. Update civicplatform.org to use smaller modules by replacing all uses of component-library in the 2018 package.
  4. Publish "final" ci version of component-library with deprecation warning
  5. Switch to usage of smaller modules in other projects
    a. For example, Open Elections
  6. Remove component-library from the civic repo

How we teach this

We'll want to update our documentation and Storybook to reflect the use of these smaller modules.

Drawbacks

There is a transition period where we'll have both sets of modules in the repo.

Alternatives

This could be done in a different order. It could be possible to split out the new modules into a separate repo.

Unresolved questions

When exactly is it ok to remove the component-library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    planning:RFCRequest for comment. A document outlining the what, why, and how of a project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions