Skip to content

Wrap single NodesSources responses in a RootObject to limit serialization side-effects #9

Description

@ambroisemaupate

When we inject blocks or breadcrumbs into a NodesSources they might be serialized again and injected for any child NodesSources wasting precious TTFB and response size.

If we wrap single NodesSources responses in a RootObject, we will be able to add additional data outside of NodesSources:

{
  "@type": "SingleNodesSourcesRoot",
  "item": {
    "@id": "",
    "@type": "Page",
    "someNodeRef": [{
      "@id": "",
      "@type": "BlogPost"
    }],
  },
  "blocks": {},
  "breadcrumbs": []
}

instead of:

{
  "@id": "",
  "@type": "Page",
  "someNodeRef": [{
    "@id": "",
    "@type": "BlogPost",
    "blocks": {}, 
    "breadcrumbs": []
  }],
  
  "blocks": {},
  "breadcrumbs": []
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions