-
Notifications
You must be signed in to change notification settings - Fork 23
Component Data Versioning
One of the major hurdle with the Clay component architecture is iteration. It’s rare that a component is built once and then never iterated on again. While changing HTML, CSS or JS of a component is easy, what happens when you decide you need to iterate on a component’s schema? Once you make a change in your component’s schema, your data for all future instances of your component will diverge from previously created instances and this could break your pages.
Rather than writing scripts to run again your Clay instance to modify old data, what if components could control their own data versioning and be upgraded on the fly? This is where data versioning comes in. By assigning a version number in your component’s `schema.yml`and providing a module which declares upgrade logic, Amphora can dynamically upgrade components as you request your data.
For the complete discussion of data versioning please refer to the [original issue](https://github.com/nymag/amphora/issues/398) for the feature. In the following sections we’ll cover requirements and implementation details of the feature.