Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Optimize i18n instance caching in App Router #18309

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Dec 20, 2024

What does this PR do?

  1. Added module-level caching for i18n instances to prevent unnecessary recreation
  2. Confirmed that there's no instance of getFixedT util
  • This change improves translation loading performance by reusing i18n instances across requests while maintaining the same functionality.

  • Before: Each translation request would create a new i18n instance

  • After: i18n instances are cached and reused based on locale-namespace combinations

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Please use the latest Vercel preview and test please 🙏.

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Dec 20, 2024 8:54pm
calcom-web-canary ⬜️ Ignored (Inspect) Dec 20, 2024 8:54pm

@graphite-app graphite-app bot requested a review from a team December 20, 2024 20:54
@dosubot dosubot bot added the i18n area: i18n, translations label Dec 20, 2024
@keithwillcode keithwillcode added consumer core area: core, team members only labels Dec 20, 2024
@hbjORbj hbjORbj changed the title chore: cache i18n instance chore: Optimize i18n instance caching in App Router Dec 20, 2024
Copy link

graphite-app bot commented Dec 20, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (12/20/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@hbjORbj hbjORbj changed the title chore: Optimize i18n instance caching in App Router perf: Optimize i18n instance caching in App Router Dec 20, 2024
@hbjORbj hbjORbj enabled auto-merge (squash) December 20, 2024 20:58
@hbjORbj hbjORbj added ready-for-e2e performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive labels Dec 20, 2024
Copy link
Contributor

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only i18n area: i18n, translations performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants