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
This is mostly a question, but I am hoping for a solution. Without any bundling, imagine one module that is imported into multiple JavaScript files in a single page application in the browser. Following the true es6 modules spec, I believe the loader would load the module only once, creating one single instance of that module.
Now let's add bundling. Imagine there are multiple bundles that import that one module, and those bundles are then included into that single page application in the browser. Will the browser have one instance of the module, or multiple instances?
If the answer is multiple instances, that is not ideal, since it does not follow the es6 modules spec as far as I know. I have also seen problems with this when using other bundlers, because I had a stateful module that was imported into multiple bundles, and at runtime changes to the state of the module from one bundle would not be reflected in the other bundles as I expected, since the module was not a singleton, but was multiple instances.
The text was updated successfully, but these errors were encountered:
This is mostly a question, but I am hoping for a solution. Without any bundling, imagine one module that is imported into multiple JavaScript files in a single page application in the browser. Following the true es6 modules spec, I believe the loader would load the module only once, creating one single instance of that module.
Now let's add bundling. Imagine there are multiple bundles that import that one module, and those bundles are then included into that single page application in the browser. Will the browser have one instance of the module, or multiple instances?
If the answer is multiple instances, that is not ideal, since it does not follow the es6 modules spec as far as I know. I have also seen problems with this when using other bundlers, because I had a stateful module that was imported into multiple bundles, and at runtime changes to the state of the module from one bundle would not be reflected in the other bundles as I expected, since the module was not a singleton, but was multiple instances.
The text was updated successfully, but these errors were encountered: