Passing large amounts of data to pages via context not recommended? #30765
Replies: 1 comment
-
Here's the page that it should link to: https://www.gatsbyjs.com/docs/creating-and-modifying-pages/#performance-implications
Yes! It means that any page gets all the data. I guess the most relevant discussion on this is here: #13806 What I did in the past was loading the json files and defining the path to it via webpack define plugin: |
Beta Was this translation helpful? Give feedback.
-
Hey folks, I came across this recommendation in the Scaling docs:
https://www.gatsbyjs.com/docs/scaling-issues/#switch-off-type-inference-for-sitepagecontext
I'm curious why this approach is not recommended. We use a community plugin for internationalization:
https://github.com/wiziple/gatsby-plugin-intl/
This plugin passes message strings for all copy on our site (1K > message strings) for every page (for >1K pages) into context. Is this something we should avoid?
I found a separate discussion on context size (#30675) but we have never seen that warning before:
So I'm hoping we haven't hit that point of concern.
Appreciate any advice on this. Would be great if we could add more explanation to these docs, which I'd be happy to do once I understand the "why". Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions