App Router: RSC HTML bloat when using Tolgee Provider with staticData (large inline i18n JSON in Flight stream) #3254
Unanswered
esha-fatima
asked this question in
Q&A
Replies: 1 comment 1 reply
|
Hello! Thanks for reporting this. ❤️ From what you describe, the behavior is expected. Whatever you pass to ssr.staticData is serialized into the RSC/Flight stream and ends up in the initial HTML. If that’s the full catalog, the payload can get quite large. Can you let us know approximately how many keys you’re providing this way? That would help us understand the scale. A common way to avoid huge payloads is to split translations into namespaces, so each page or feature only includes the subset of keys it actually needs. That keeps the serialized data much smaller. Also interested if you have any ideas on how this could be improved from your perspective. Feedback like this helps us decide what to tackle next. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When I pass translations via Tolgee’s staticData in a Next.js App Router app, the entire translation payload gets serialized into the RSC/Flight stream and inlined in the initial HTML (self.__next_f.push(...)). This significantly increases “View Source” size and the HTML payload the browser must parse—even when only a few keys are actually used on the page.
This is causing real-world issues for us (HTML too big for some parsers/proxies, slower initial parse, and noisy source).
All reactions