Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ambroisemaupate opened this issue Mar 30, 2021 · 0 comments
Assignees

Comments

@ambroisemaupate
Copy link
Member

ambroisemaupate commented Mar 30, 2021

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": []
}
@ambroisemaupate ambroisemaupate self-assigned this Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant