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
We have an application that waits for i18n to be fetched for multiple dependencies.
Nesting multiple withLocaleRequired HOCs causes these locale files to be fetched in series, which means longer load times.
Each withLocaleRequired blocks the subsequent one from rendering until it's own fetching is complete.
Example Code:
// compose is a utility that wraps a component in multiple HOCs
export default compose(
withLocaleRequired('/i18n'),
withLocaleRequired('/i18n/@scope-one/module-one'),
withLocaleRequired('/i18n/@scope-two/module-two'),
withLocaleRequired('/i18n/@scope-three/module-three'),
)(Component);
Proposed Solution
Allow withLocaleRequired to accept an array of paths, to be fetched in parallel.
The only component blocked from rendering will be the underlying Component, and all locale fetching can take place simultaneously within one single instance of withLocaleRequired.
A design that allows parallel fetching of many locale paths would speed up load times for our application significantly. I'm willing to work on this feature, but wanted to get feedback on the proposal first.
The text was updated successfully, but these errors were encountered:
Problem
We have an application that waits for i18n to be fetched for multiple dependencies.
Nesting multiple withLocaleRequired HOCs causes these locale files to be fetched in series, which means longer load times.
Each
withLocaleRequired
blocks the subsequent one from rendering until it's own fetching is complete.Example Code:
Proposed Solution
Allow withLocaleRequired to accept an array of paths, to be fetched in parallel.
The only component blocked from rendering will be the underlying Component, and all locale fetching can take place simultaneously within one single instance of
withLocaleRequired
.Example Code:
Conclusion
A design that allows parallel fetching of many locale paths would speed up load times for our application significantly. I'm willing to work on this feature, but wanted to get feedback on the proposal first.
The text was updated successfully, but these errors were encountered: