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

memoize saves fallback with async backend #3

Closed
beheh opened this issue Jun 13, 2018 · 5 comments
Closed

memoize saves fallback with async backend #3

beheh opened this issue Jun 13, 2018 · 5 comments

Comments

@beheh
Copy link

beheh commented Jun 13, 2018

In our app, we use key-based fallback with an asynchronous i18next backend with react-i18next and i18next-icu.

When using react-icu with the default settings, it looks like memoization incorrectly memoizes the fallback keys, even after the translations have been loaded.

I can fix this right now by calling ICU.mem = {} manually after a new translation has been loaded. This should probably not happen in the first place though.

Alternatively, you might want to expose a (documented) method to clear the memoization cache.

@jamuhl
Copy link
Member

jamuhl commented Jun 13, 2018

Will look into this tomorrow....guess best would to be just not memoize in case of fallbacking to key? Agree?

@beheh
Copy link
Author

beheh commented Jun 13, 2018

Yeah, we had it disabled so far due to this issue. We're looking into some performance regressions on our site right now, so I was playing around with reenabling it which led me to the workaround of manually clearing the memoization cache.

@jamuhl
Copy link
Member

jamuhl commented Jun 14, 2018

@beheh
Copy link
Author

beheh commented Jun 16, 2018

Thanks for a quick release, this looks fixed! 👍

@beheh beheh closed this as completed Jun 16, 2018
@jamuhl
Copy link
Member

jamuhl commented Jun 16, 2018

awesome...if you encounter any other issue let me know....i18next-icu still rather fresh

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants