Skip to content

[Refactor] Use Object.fromEntries in flattenDevExtensionTranslations - #8536

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor-maintenance-34852179334
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor-maintenance-34852179334

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

convertMapToExtensionTranslationMap was a hand-rolled helper that copied a Map into a plain object — exactly what the built-in Object.fromEntries does. It had a single call site, so the indirection added a function to read without adding any behaviour.

WHAT is this pull request doing?

Replace convertMapToExtensionTranslationMap with Object.fromEntries in flattenDevExtensionTranslations and delete the now-unused helper from packages/ui-extensions-server-kit/src/i18n.ts.

The function's public signature and ExtensionTranslationMap return type are unchanged, and Object.fromEntries accepts a Map directly, so the merged-translations behaviour is identical.

How to manually test your changes?

CI

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

Replace the hand-rolled convertMapToExtensionTranslationMap helper with the
built-in Object.fromEntries. The helper had a single call site and reimplemented
standard library behaviour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@Suleimanlatrsh Suleimanlatrsh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and checked the translation fallbacks. Looks good 👍

@gonzaloriestra
gonzaloriestra marked this pull request as ready for review September 16, 2026 08:56
@gonzaloriestra
gonzaloriestra requested a review from a team as a code owner September 16, 2026 08:56
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants