<h2 dir="auto">Feature request</h2>





<p dir="auto"><strong>What is the expected behavior?</strong><br>
An external component should be able to invalidate the remoteEntry and cause a refresh of the external module - currently we would have to do a full page reload.</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong></p>
<ul dir="auto">
<li>If the app is able to detect a new release of the external component a reload might be required - instead of a full page reload we could refresh the module. <em>(it would likely be the module it self knowing if a refresh is needed)</em></li>
<li>If there was an issue in the loaded module eg. a UI Component having an issue - it would be nice to provide a pr. module refresh eg. letting the user trigger a "retry"</li>
<li>If the external service is down for some reason the fallback module/component could likely detect when the service is up again and trigger a refresh of modules from that service</li>
</ul>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong><br>
Client code could import a magical <code class="notranslate">import {refresh} from "webpack/module/federation/refresh"</code><br>
If used as an external module it would communication with the remoteEntry refresh mechanism updating module loader and resetting module cache. <em>(If used in the main application it could either be ignored or trigger a full page reload?)</em></p>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
yes, despite being low on time and domain knowledge regarding the webpack code base - although the initial work would likely be figuring out if feasible / practical or if a full page reload is better.</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">As per <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/TheLarkInn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/TheLarkInn">@TheLarkInn</a> tweet (<a href="https://twitter.com/thelarkinn/status/821879942552154112" rel="nofollow">https://twitter.com/thelarkinn/status/821879942552154112</a>) it has been brought to attention that there are some rather obvious performance gains (upwards of 10x) when using <code class="notranslate">for</code> over <code class="notranslate">for-of</code> and <code class="notranslate">forEach</code></p>


<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Currently, <code class="notranslate">forEach</code> is being used throughout project.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>



<p dir="auto">N/A</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Well, I expect it to be as fast and optimized as possible :-)</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto">It is always better when things are faster!</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p>
<p dir="auto">As per this sample gist</p>
<p dir="auto"><a href="https://gist.github.com/vsemozhetbyt/7f6db3f73dfec8ac08bcfc81b1b11cbb">https://gist.github.com/vsemozhetbyt/7f6db3f73dfec8ac08bcfc81b1b11cbb</a></p>
<p dir="auto">Local Results</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  // v8 5.1.281.84 (Node.js 6.8.1)

for    : 1.113ms
for-of : 35.201ms
forEach: 24.478ms"><pre class="notranslate"><code class="notranslate">  // v8 5.1.281.84 (Node.js 6.8.1)

for    : 1.113ms
for-of : 35.201ms
forEach: 24.478ms
</code></pre></div>