-
Notifications
You must be signed in to change notification settings - Fork 331
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
feat(localizations): Reuse english characters to improve performance #5498
Conversation
🦋 Changeset detectedLatest commit: c00250b The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ebbf8d2
to
257fc55
Compare
257fc55
to
d3c73e4
Compare
d3c73e4
to
cc65a1e
Compare
Co-authored-by: Stefanos Anagnostou <[email protected]>
cc65a1e
to
c00250b
Compare
selectDropdown__role: `${S}${e}${l}${e}${c}${t} ${r}${o}${l}${e}`, | ||
subtitle: `${E}${n}${t}${e}${r} ${o}${r} ${p}${a}${s}${t}${e} ${o}${n}${e} ${o}${r} ${m}${o}${r}${e} ${e}${m}${a}${i}${l} ${a}${d}${d}${r}${e}${s}${s}${e}${s}, ${s}${e}${p}${a}${r}${a}${t}${e}${d} ${b}${y} ${s}${p}${a}${c}${e}${s} ${o}${r} ${c}${o}${m}${m}${a}${s}.`, | ||
successMessage: `${I}${n}${v}${i}${t}${a}${t}${i}${o}${n}${s} ${s}${u}${c}${c}${e}${s}${s}${f}${u}${l}${l}${y} ${s}${e}${n}${t}`, | ||
title: `${I}${n}${v}${i}${t}${e} ${n}${e}${w} ${m}${e}${m}${b}${e}${r}${s}`, | ||
}, | ||
membersPage: { | ||
action__invite: 'Invite', |
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.
@nikosdouvlis we missed this one I guess
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.
Does this affect bundle size at all or can we ignore for now?
Edit: this does affect bundle size, the tests now fail. I will fix the rest of the file
|
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.
This is great! I love that the reusability will reduce maintenance burden for maintainers. LGTM 👍
After internal discussions, we decided not to go forward with this approach at this time. The |
Description
This PR replaces all hardcoded character literals within strings across the codebase with default imports from the
@characters
npm package.With this change we improve:
@characters
library, rather than being an arbitrary part of a magic string.Important considerations:
Before opening the PR, @anagstef and I benchmarked the bundle size and the runtime impact. We found out that the runtime impact is negligible, while the bundle size is reduced by approximately 2.1%. Given the minimal runtime cost, we both think is a good trade-off.
Happy to discuss further before merging. We will need to apply the same to all localization files as well.
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change