This aims to prevent breaking changes in production and allows smooth transitions during A/B testing or staged rollouts.
By having DatoCMS schema changes follow a 3-step process, we ensure that new features can be introduced without disrupting existing functionality.
Introduce New Versions - When modifying fields or models, create new versions instead of altering existing ones.
Update and Deploy Code - Update the application code to handle both the new fields/models and the old ones. Once tested, merge the changes into the main branch and deploy.
Clean Up Deprecated Schema - After confirming the new version is fully in use and stable, remove any unused fields or models from DatoCMS (e.g. ComponentX if replaced by ComponentXv2).
DatoCMS Components - DatoCMS blocks are reusable content modules that can be added flexibly across the CMS. Our codebase should reflect this modularity by structuring components for reusability and clarity.
When implementing a component tied to a DatoCMS block:
lib/datocms/fragments
folder
This fragment should cover all fields needed by the component.