Content Serialization

Component ID

2923952

Component name

Content Serialization

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

The module allows you to serialize content entities. It's intended to provide content while building a site, and for initial deployment of new site features.

It's explicitly designed to:

  1. only use UUIDs.
  2. provide easy collaboration and development:
    • Allow content to come from multiple sources (eg. content being entered in different environments; developer deploying config and content together; dummy content).
    • Exports should not change unless the data's actually changed (serial IDs, domain names, etc. shouldn't matter).
  3. be format/serializer-agnostic
  4. allow cyclic references, eg. two nodes have related content fields referencing one another.

The code design goals are

  1. Make the code unopionated, eg. an import doesn’t require a module, the source or destination can be switched out, the format isn’t assumed, etc.
  2. Keep things modular, eg. if someone wants to create their own export process and would like to use just the normalizers or batch loader from this project, that should be possible.
  3. Try to be a minimal wrapper around core/Symfony serialization.

What isn't the focus?

  1. Building a UI
  2. Content staging

Wait, another export/import module for default content?

Yeah, I know. I’m happy to retire this if there’s something else that covers
the needs above!

Alternatives

These might suit your needs better. Apologies for any mistakes in the
descriptions below. As far as I can tell, none of them support cyclic
references.

  • demo content: Exports to YAML, doesn’t use serialization framework, doesn’t
    support export
  • yaml content: Exports to YAML, doesn’t use serialization framework
  • default content: Exports to HAL JSON, uses serialization framework