You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ngx-translate package currently provides an impure Angular pipe for translations. This results in thousands of function calls, especially on pages with numerous pipe calls for translations/internationalization. This behavior can lead to performance issues, particularly on complex or data-heavy pages.
Expected behavior
The package should provide a pure version of the translation pipe. This would significantly reduce the number of function calls and improve performance, especially on pages with many translated elements.
What is the motivation / use case for changing the behavior?
The primary motivation is to improve performance in Angular applications using ngx-translate, especially those with a large number of translated elements. By reducing the number of function calls, we can potentially see significant performance improvements, particularly on complex or data-heavy pages.
How do you think that we should implement this?
Implement a new pure pipe alongside the existing impure pipe.
The pure pipe would function similarly to the current pipe but would not automatically trigger on every change detection cycle.
Leave it to the user to manage change detection for translations, for example by reloading the whole page when the language changes or manually triggering change detection when needed.
Provide clear documentation on how to use the pure pipe effectively, including best practices for managing translations and change detection.
This approach would provide a performance-optimized option for users who are willing to manage change detection themselves, while still keeping the current functionality available for those who prefer it.
The text was updated successfully, but these errors were encountered:
Current behavior
The ngx-translate package currently provides an impure Angular pipe for translations. This results in thousands of function calls, especially on pages with numerous pipe calls for translations/internationalization. This behavior can lead to performance issues, particularly on complex or data-heavy pages.
Expected behavior
The package should provide a pure version of the translation pipe. This would significantly reduce the number of function calls and improve performance, especially on pages with many translated elements.
What is the motivation / use case for changing the behavior?
The primary motivation is to improve performance in Angular applications using ngx-translate, especially those with a large number of translated elements. By reducing the number of function calls, we can potentially see significant performance improvements, particularly on complex or data-heavy pages.
How do you think that we should implement this?
This approach would provide a performance-optimized option for users who are willing to manage change detection themselves, while still keeping the current functionality available for those who prefer it.
The text was updated successfully, but these errors were encountered: