-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
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. |
E2E results are ready! |
@@ -44,31 +55,21 @@ export const _generateMetadata = async ( | |||
const h = headers(); | |||
const canonical = h.get("x-pathname") ?? ""; | |||
const locale = h.get("x-locale") ?? "en"; | |||
|
|||
const t = await getFixedT(locale, "common"); | |||
const t = await getTranslationWithCache(locale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: we could even replace this with getTranslate()
@hbjORbj no preview available 🤔 (the code change looks good, but i haven't tested it yet) |
* plain custom desin * No display on card * dynamic plain chat component and hmac hash * re-route users to plain.com chat instead of intercom chat when going to /support * provider errors * yarn lock fix * plain chat removed unneeded hmac * fix ts error * error handling improved * remove intercome provider from app-dir * Create getting-started.mdx (#18342) * Delete help directory (#18343) * chore: moved docs/help to /help (#18345) * chore: Delete unused guides directory (#18346) * feat: booking filters (#18303) Co-authored-by: Syed Ali Shahbaz <[email protected]> * chore: Remove `HeadSeo` components where no longer needed + improve app router metadata logic (#18348) * remove HeadSeo for already migrated pages and refactor prepareMetadata * create _generateMetadataWithoutImage and refactor _generateMetadata * chore: app router - /bookings status page (#18183) * chore: app router - /bookings page * remove env vars * fix * Update middleware.ts * revert unneeded change * refactor for the better * fix * cache i18n instances (#18309) * feat: virtual queues tab in insights (#18260) Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> * feat: update translations via @replexica (#18361) Co-authored-by: Replexica <[email protected]> * update OOO e2e tests to remove flakiness (#18367) * fix: metadata is overwritten for child managed eventType when updating parent (#18059) * fix: metadata is overwirten * Update * type error * Update * fix test * fix type error * chore: added routing support link (#18369) * Added routing form support link * small change * Type fix --------- Co-authored-by: Joe Au-Yeung <[email protected]> * chore: refactor handling logic for embeds in app router (#18362) * refactor handling logic for embeds in app router * fix type checks * add test for withEmbedSsrAppDir * fix * review changes * yarn lock --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Calcom Bot <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Replexica <[email protected]> Co-authored-by: Vijay <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
* plain custom desin * No display on card * dynamic plain chat component and hmac hash * re-route users to plain.com chat instead of intercom chat when going to /support * provider errors * yarn lock fix * plain chat removed unneeded hmac * fix ts error * error handling improved * remove intercome provider from app-dir * Create getting-started.mdx (#18342) * Delete help directory (#18343) * chore: moved docs/help to /help (#18345) * chore: Delete unused guides directory (#18346) * feat: booking filters (#18303) Co-authored-by: Syed Ali Shahbaz <[email protected]> * chore: Remove `HeadSeo` components where no longer needed + improve app router metadata logic (#18348) * remove HeadSeo for already migrated pages and refactor prepareMetadata * create _generateMetadataWithoutImage and refactor _generateMetadata * chore: app router - /bookings status page (#18183) * chore: app router - /bookings page * remove env vars * fix * Update middleware.ts * revert unneeded change * refactor for the better * fix * cache i18n instances (#18309) * feat: virtual queues tab in insights (#18260) Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> * feat: update translations via @replexica (#18361) Co-authored-by: Replexica <[email protected]> * update OOO e2e tests to remove flakiness (#18367) * fix: metadata is overwritten for child managed eventType when updating parent (#18059) * fix: metadata is overwirten * Update * type error * Update * fix test * fix type error * chore: added routing support link (#18369) * Added routing form support link * small change * Type fix --------- Co-authored-by: Joe Au-Yeung <[email protected]> * chore: refactor handling logic for embeds in app router (#18362) * refactor handling logic for embeds in app router * fix type checks * add test for withEmbedSsrAppDir * fix * review changes * yarn lock --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Calcom Bot <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Replexica <[email protected]> Co-authored-by: Vijay <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
* plain custom desin * No display on card * dynamic plain chat component and hmac hash * re-route users to plain.com chat instead of intercom chat when going to /support * provider errors * yarn lock fix * plain chat removed unneeded hmac * fix ts error * error handling improved * remove intercome provider from app-dir * Create getting-started.mdx (calcom#18342) * Delete help directory (calcom#18343) * chore: moved docs/help to /help (calcom#18345) * chore: Delete unused guides directory (calcom#18346) * feat: booking filters (calcom#18303) Co-authored-by: Syed Ali Shahbaz <[email protected]> * chore: Remove `HeadSeo` components where no longer needed + improve app router metadata logic (calcom#18348) * remove HeadSeo for already migrated pages and refactor prepareMetadata * create _generateMetadataWithoutImage and refactor _generateMetadata * chore: app router - /bookings status page (calcom#18183) * chore: app router - /bookings page * remove env vars * fix * Update middleware.ts * revert unneeded change * refactor for the better * fix * cache i18n instances (calcom#18309) * feat: virtual queues tab in insights (calcom#18260) Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> * feat: update translations via @replexica (calcom#18361) Co-authored-by: Replexica <[email protected]> * update OOO e2e tests to remove flakiness (calcom#18367) * fix: metadata is overwritten for child managed eventType when updating parent (calcom#18059) * fix: metadata is overwirten * Update * type error * Update * fix test * fix type error * chore: added routing support link (calcom#18369) * Added routing form support link * small change * Type fix --------- Co-authored-by: Joe Au-Yeung <[email protected]> * chore: refactor handling logic for embeds in app router (calcom#18362) * refactor handling logic for embeds in app router * fix type checks * add test for withEmbedSsrAppDir * fix * review changes * yarn lock --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Calcom Bot <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Replexica <[email protected]> Co-authored-by: Vijay <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
* plain custom desin * No display on card * dynamic plain chat component and hmac hash * re-route users to plain.com chat instead of intercom chat when going to /support * provider errors * yarn lock fix * plain chat removed unneeded hmac * fix ts error * error handling improved * remove intercome provider from app-dir * Create getting-started.mdx (calcom#18342) * Delete help directory (calcom#18343) * chore: moved docs/help to /help (calcom#18345) * chore: Delete unused guides directory (calcom#18346) * feat: booking filters (calcom#18303) Co-authored-by: Syed Ali Shahbaz <[email protected]> * chore: Remove `HeadSeo` components where no longer needed + improve app router metadata logic (calcom#18348) * remove HeadSeo for already migrated pages and refactor prepareMetadata * create _generateMetadataWithoutImage and refactor _generateMetadata * chore: app router - /bookings status page (calcom#18183) * chore: app router - /bookings page * remove env vars * fix * Update middleware.ts * revert unneeded change * refactor for the better * fix * cache i18n instances (calcom#18309) * feat: virtual queues tab in insights (calcom#18260) Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> * feat: update translations via @replexica (calcom#18361) Co-authored-by: Replexica <[email protected]> * update OOO e2e tests to remove flakiness (calcom#18367) * fix: metadata is overwritten for child managed eventType when updating parent (calcom#18059) * fix: metadata is overwirten * Update * type error * Update * fix test * fix type error * chore: added routing support link (calcom#18369) * Added routing form support link * small change * Type fix --------- Co-authored-by: Joe Au-Yeung <[email protected]> * chore: refactor handling logic for embeds in app router (calcom#18362) * refactor handling logic for embeds in app router * fix type checks * add test for withEmbedSsrAppDir * fix * review changes * yarn lock --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Calcom Bot <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Replexica <[email protected]> Co-authored-by: Vijay <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
What does this PR do?
getFixedT
utilThis 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)
How should this be tested?