-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
feat: support multiple Webpack runtimes #701
feat: support multiple Webpack runtimes #701
Conversation
window.__LOADABLE_LOADED_CHUNKS__ = window.__LOADABLE_LOADED_CHUNKS__ || [] | ||
const loadedChunks = window.__LOADABLE_LOADED_CHUNKS__ | ||
const prefix = namespace ? `__${namespace}` : '' | ||
const loadedChunksKey = `${prefix}__LOADABLE_LOADED_CHUNKS__` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a breaking change since namespace
is separately used for getRequiredChunkKey
above. Maybe I should add a separate more explicit option. Maybe just a chunkLoadingGlobal
option for both loadableReady
and LoadablePlugin
which overrides the whole thing?
everything looks good 👍 |
Thanks @theKashey, anything more needed from my side? I'm not able to merge due to some CI checks. Any concern with my comment about the |
Updated to differentiate from the existing |
@wvanrensselaer Thanks for this PR, We encountered the same issue and this would fix it for us, I like the solution with the new option in |
Just waiting on @theKashey, is this good to merge? |
🤯 I didn't merge it. :coneofshame: |
Hi @theKashey, When do you plan to merge it? we are waiting for this bug fix to resolve an issue we have with multiple components on the same site. Thanks |
Hey, trying to find some extra time to go through all open important tasks and do proper testing before the merge - there are a few moments that worries me a little - but yet with no luck. |
Released 5.15.0 |
* feat: support multiple Webpack runtimes * namespace chunk loading global in loadableReady * Change namespace to chunkLoadingGlobal * Update size snapshot
Addresses: #635
Summary
We have a case where we're running multiple Webpack runtimes on the same page which both use Loadable. This change adds an optional
chunkLoadingGlobal
option toLoadablePlugin
andloadableReady
which namespacesjsonpFunction
orchunkLoadingGlobal
.Test plan
I didn't see unit tests for
LoadablePlugin
but I tested in a local application which rendered two Webpack apps in the same page. I can push this to a repo if you'd like. It correctly adds the namespace:namespace: 'header'
namespace: 'content'