-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
props for dynamic (like @loadable) #8818
Comments
dynamic imports are meant to be statically analyzable (no template strings). If you do |
@timneutkens, but why it's working in @loadable! I try to find a solution for next + globalize. It needs async loading cldr-data and messages before start rendering a page and getInitialProps is bad for this. For example:
It works, but it needs props for transmitting language settings. |
It's not, it has the exact behavior outlined here: #8818 (comment) |
@timneutkens do you see my example? it works very well (messages for globalize in chunks) |
Like I said you'll overbundle + slow down compilation because every single file will be bundled in that You can do what you wanted to do by using static imports |
@timneutkens ok, but if we change import to fetch? For example:
but it needs props for transmitting language settings. |
Sure, but if you are using other components inside that tree that also use dynamic loading and are lazy loading other components the code splitting should naturally have separate chunks which wouldn't be needed for the initial entry. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Can you add props for dynamic (like @loadable)?
The text was updated successfully, but these errors were encountered: