-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Performance #1044
Comments
Here's a plugin that do the transformation ( There is a lot of room to improve it, like I shouldn't be assuming that every Credits goes to Michael Jungo in his response to my stack overflow question:
To implement it, save in a file (like transform.js) and add this to {
"presets": [
...
],
"env": {
"production": { "plugins": ["./transform"] },
}
} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Hey, is there a more performatic method of doing translations other than intl.formatMessage ?
I've being using Chrome console and react developer tools ($r is the reference for my component that includes react-intl by using
injectIntl
injector) to test its performance. If I run:Chrome tells me that it took
0.02001953125ms
to execute.But by accessing its internal messages variable directly:
It only takes
0.0048828125ms
.Couldn't the formatMessage method be more optimized, for instance if there isn't a second parameter for formatMessage it only returns what is inside the messages variable like I did above.
Or am I doing something wrong ?
The text was updated successfully, but these errors were encountered: