Skip to content

Commit

Permalink
fix(i18n): parseChunkImport helper function performance issue (#3607)
Browse files Browse the repository at this point in the history
* fix: performance issues on parseChunkImport helper

* chore: add changeset
  • Loading branch information
ragafus authored Sep 20, 2024
1 parent 4499e76 commit 87d2686
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-dragons-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/i18n': patch
---

Fix performance issue on parseChunkImport helper function
6 changes: 2 additions & 4 deletions packages/i18n/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ export const parseChunkImport = (
const messageAsString = isStructuredJson(messageValue)
? messageValue.string
: messageValue;
messages[messageKey] = messageAsString;

return {
...messages,
[messageKey]: messageAsString,
};
return messages;
},
{} as TMessageTranslations
);
Expand Down

0 comments on commit 87d2686

Please sign in to comment.