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
{{ message }}
Repository navigation
Decrease the frontend messages bundle size by excluding server-side-rendered messages
#2617
When we have a server-side-rendered React application, usually most of the messages are rendered on the server side, and frontend components require only a small part of the whole global application message list.
But Lingui extractor now builds a single list with all the messages found in the code.
And seems we can optimize this by detecting from the file is this a server-side (by detecting the "use server" directive) or a client-side code, and mark server-side messages by a specific comment in the .po file, eg js-lingui-server-only.
Having this, when we prepare a list of messages for the frontend, we can exclude the server-only messages from the bundle, which should significantly decrease the size.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When we have a server-side-rendered React application, usually most of the messages are rendered on the server side, and frontend components require only a small part of the whole global application message list.
But Lingui extractor now builds a single list with all the messages found in the code.
And seems we can optimize this by detecting from the file is this a server-side (by detecting the "use server" directive) or a client-side code, and mark server-side messages by a specific comment in the
.pofile, egjs-lingui-server-only.Having this, when we prepare a list of messages for the frontend, we can exclude the server-only messages from the bundle, which should significantly decrease the size.
What do you think about this idea?
All reactions