Home

Awesome

Rainbow

An advanced serialization library for Sitecore 7 and above. Rainbow is designed to be a complete replacement for the Sitecore serialization format and filesystem organization, as well as enabling cross-source item comparison. It is a pure code library that comes with no UI of any kind, that is designed to be used with other libraries that use its serialization services with their own UIs. Libraries that consume Rainbow - such as Unicorn - gain the ability to abstract themselves from serialization details. Libraries that extend Rainbow can add new serialization formats, new places to store serialized items, and new ways to organize them.

taste it

Rainbow Features

Universal Item Data and Data Stores

Rainbow implements a set of interfaces that wrap the structure of a Sitecore item - item, version, and field. These interfaces provide a universal language that all Rainbow data stores can implement against. You could get an IItemData from Sitecore and write it out to disk as a YAML formatted item. You could get an IItemData from a web service, and deserialize it into a Sitecore database. You could construct an IItemData programmatically, and serialize it to a Sitecore database. Implementations of IDataStore provide places to store item data. It's completely universal, and everything Rainbow does revolves around these abstractions.

YAML-based serialization formatter improves the storage format for serialized items

Serialization File System (SFS) storage hierarchy

Deserialize abstract items into Sitecore with the Sitecore storage provider

Item comparison APIs

Improvements

Improvements are in comparison to Sitecore serialization and the functionality in Unicorn 2.

Rainbow Organization

Rainbow consists of several projects:

Using Rainbow with TFS

Rainbow by default allows all characters that Windows allows to be in item filenames (when using SFS). Team Foundation Server does not allow files to be added which contain the $ character. To enable proper interaction with TFS, enable the Rainbow.TFS.config.example patch file that ships with the Rainbow NuGet package.

Extending Rainbow

Rainbow is designed to be loosely coupled. It's recommended that you employ a Dependency Injection framework (e.g. SimpleInjector) to make your life constructing Rainbow objects easier. Of course you can also construct objects without DI.

Rainbow has extensive unit and integration tests and hopefully easy to understand code, which serve as its living documentation. As of now, Rainbow has 90% test coverage and 220 tests. Unicorn, which uses Rainbow as a service, can also be a useful source of examples.

If you can't find what you're looking for you can find me on Twitter (@kamsar) or on Sitecore Community Slack.