CompatibilityPlugin and Shared dependencies, MF sync #15256
Unanswered
crodriguez-plitzi
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Please use the issue template, respect time of other developers, thanks Also please create reproducible test repo |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
@alexander-akait i started this PR #15259 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Still not 100% if this should be considered a bug, so before create an issue ticket i want to confirm it
after debug for a few days i found something that i still thinking is wrong
in webpack when we import a library that its already a bundle in webpack, during the build process we call the plugin
CompatibilityPluginthat basically transforms__webpack_require__to__nested_webpack_require_${pattern.range[0]}__my concern is that shared dependencies that were loaded by the main bundle are under
__webpack_require__and these should be exposed to the whole application if these aresingletonbut testing the bundle compiled i can see things like this


if i marked that
reactshould be singleton, why is trying to load it from the nested webpack bundle instance__nested_webpack_require_${pattern.range[0]}__and this is why is loading the "duplicated react" instead the original from the bundlei can understand that each nested dependency in the bundle are completely isolated, but for scenarios where dependencies are shared/singleton doesnt make sense
should this be considered a bug ?
i did some tests doing manual changes in the bundle related to this, and was able to make works react instance
from
var versions = scope[name] = scope[name] || {};to
var versions = scope[dependencyName] = __webpack_require__.S[name][dependencyName] || scope[dependencyName] || {};(keep on mind that this is for the scenario where__webpack_require__is nested and we need access to the root)doing just 1 change i was able to make it works
Beta Was this translation helpful? Give feedback.
All reactions