You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The problem I'm running into is with our project's monorepo setup. Essentially, we have many siloed translations and many shared translations, as such there are many unnecessary translations that get included when using the client provider.
We end up with long blobs in the HTML, like this
<script>self.__next_f.push([1, "28:{\"example\":\"lots of json\"])
</script>
To get around this we're looking into splitting each of our routes to use only the set of translations the need
This works to an extent, however we now run into the case that duplicate blobs end up in the html, essentially because we're reusing translations in seperate layouts.
The tree might look something like this
<... some stuff>
<layout 1>
<!-- shared translations ends up in a blob for this -->
<NextIntlClientProvidermessages={{ shared }}>
... components using stuff
<layout 2>
<!-- shared translations also ends up in a blob for this -->
<NextIntlClientProvider messages{{ shared, home }}>
... components using stuff and home
</NextIntlClientProvider>
</layout 2>
</NextIntlClientProvider>
</layout 1>
</... some stuff>
Describe the solution you'd like
Unless there's already a solution for this, I'd like to suggest that nested instances of NextIntlClientProvider could inherit it's parent's translations.
By doing this we can improve how much data needs to be send to the client.
Describe alternatives you've considered
I could probably improve how I'm doing imports. I think this is coming from the server/client boundary, still looking into it
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
The problem I'm running into is with our project's monorepo setup. Essentially, we have many siloed translations and many shared translations, as such there are many unnecessary translations that get included when using the client provider.
We end up with long blobs in the HTML, like this
To get around this we're looking into splitting each of our routes to use only the set of translations the need
This works to an extent, however we now run into the case that duplicate blobs end up in the html, essentially because we're reusing translations in seperate layouts.
The tree might look something like this
Describe the solution you'd like
Unless there's already a solution for this, I'd like to suggest that nested instances of
NextIntlClientProvider
could inherit it's parent's translations.By doing this we can improve how much data needs to be send to the client.
Describe alternatives you've considered
I could probably improve how I'm doing imports. I think this is coming from the server/client boundary, still looking into it
The text was updated successfully, but these errors were encountered: