Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
Justin Jones edited this page Jul 23, 2018 · 5 revisions

Creating a new component

Check to see if a similar component already exists in mc-components:

  • YES! Use that, or abstract it out further to fit your needs
  • NO! Check the masterclass repo directly. Is there a similar component there?
    • YES! Can it be further abstracted to push it towards graduating to the mc-components library?
    • NO! Add your new component to mc repo directly

When does a component "graduate" to mc-components?

If you notice similar components being rebuilt / reused in multiple places:

  • Create an issue on the mc-components github:
    • Propose that you have a component that needs to be "graduated" to the mc-component library
    • Link to examples on masterclass.com where this component would be used (likely it won't graduate until there are at least 3 examples, but we can start conversation on components that we know will likely have more examples soon)
    • How can this be abstracted?
    • What components are being duplicated / would be replaced by your new abstracted component?
  • Everyone weighs in / suggests changes to make it a true abstraction
  • If approved:
    • Create branch off mc-components with your new proposed component
    • mc-component crew weighs in on issue and in Slack
    • Revisions (if necessary)
    • Merged in to mc-components, deployed with weekly deploy

Maintaining components

For now, it's ok if things get a little messy. Eventually we'll want to integrate something like Cypress to handle integration testing with the main mc repo, but for now, visual testing is sufficient.

There is a high risk of code duplication since components are built in the masterclass repo, reused multiple times, then (potentially) graduated to mc-components. This is ok! We're willing to accept this in exchange for a cleaner and slimmer mc-components library.