Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

18
Organized by the Community, for the Community. NEXT GENERATION SERIALIZATION WITH UNICORN 3 Kam Figy Connective DX @kamsar

Transcript of Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Page 1: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community.

NEXT GENERATION SERIALIZATION WITH UNICORN 3

Kam FigyConnective DX@kamsar

Page 2: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015

GOOD MORNING

Page 3: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 3

WHY DO WE NEED SERIALIZATION?

• Sitecore dev artifacts are a mixture of code files and items, such as templates or renderings.

• Items are stored in the Sitecore database, code is stored in source control.

• Source control commits are incomplete without the items that complement the code. This is bad.

Without serialization.

SUGCON NORTH AMERICA 2015

Page 4: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 4

WHY BUILD UNICORN?

• Back in the dark ages, we used shared databases.

• We used packages.• We tried TDS.• None of these delivered the frictionless

development experience we desired.

SUGCON NORTH AMERICA 2015

Page 5: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 5

HOW DOES UNICORN WORK?

• You choose items to serialize.• Database items are written to files on

disk.• Changes in Sitecore are updated to

disk in real time.• “Sync” pushes changes from disk into

your local database.• Merging is always done on disk.

SUGCON NORTH AMERICA 2015

Page 6: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 6SUGCON NORTH AMERICA 2015

STOP

DEMO TIME

Page 7: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 7SUGCON NORTH AMERICA 2015

DEMO:SETTING UP UNICORN

In which we taunt the demo gods

Page 8: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 8SUGCON NORTH AMERICA 2015

DEMO:TEAM COLLABORATION

In which we bite our thumbs at the demo gods

Page 9: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 9

WHAT’S NEW IN UNICORN 3?

Features• New format (YAML)• New storage (SFS)• Sitecore UI warnings• Partial sync• Partial reserialize• Auto publish synced• Split config schema• Sync event pipelines

Improvements• SPEED: 50% more of

it• Better messaging• More extensible• No Ninject required• Versioned to shared

field conversion• Fresh paint on the UI• More info: http://

goo.gl/XwMjTa

SUGCON NORTH AMERICA 2015

Page 10: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 10

RAINBOW:A MODERN ITEM SERIALIZATION LIBRARY

Overview:http://goo.gl/Yl4gkM More about format:http://goo.gl/LPMbVvMore about hierarchy:http://goo.gl/8cSDNm

SUGCON NORTH AMERICA 2015

• Rainbow is a code library for serialization.

• Unicorn uses Rainbow.• Easy to read file format.• Human readable file hierarchy.• Designed to be easy to merge when

conflicts occur.• Item comparison APIs.

Page 11: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 11

RAINBOW: SERIALIZING A MULTILIST FIELDWith Sitecore

serialization format…Content-Length: n{GUID}|{GUID}|{GUID}

If you and someone else both add a GUID, you get a merge conflict and have to manually recalculate content length.

With Rainbow’s YAML format…{GUID}{GUID}{GUID}

Line oriented format increases automerge chance,

no content length.

SUGCON NORTH AMERICA 2015

Page 12: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 12SUGCON NORTH AMERICA 2015

ONE MORE THING

Page 13: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 13SUGCON NORTH AMERICA 2015

INTRODUCINGTRANSPARENT SYNC

Page 14: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 14SUGCON NORTH AMERICA 2015

Page 15: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 15

TRANSPARENT SYNC

• Automatic, real-time sync.• One less thing to remember to do.• Amazing for code reviews.• Great for dev artifact items.• SSD recommended for the I/O.• Enabled per-configuration.• New deployment possibilities.

SUGCON NORTH AMERICA 2015

Page 16: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 16SUGCON NORTH AMERICA 2015

DEMO:TRANSPARENT SYNC

In which we laugh at the demo gods

Page 17: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community. 17SUGCON NORTH AMERICA 2015

QUESTIONS

“IS UNICORN 3 OUT YET?”YES. RIGHT NOW.

Page 18: Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON

Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015

THANK YOU!UNICORN IS AVAILABLE ON NUGETOPEN SOURCE (MIT) ON GITHUBTWEET @KAMSARBLOG: KAMSAR.NETSource:

https://goo.gl/VF3Mkd Documentation:https://goo.gl/ePFki1