Do not bundle deleted modules in HMR

Reviewed By: mjesun

Differential Revision: D5777831

fbshipit-source-id: dd3551194eca99097cea5a1944555cd8adff9f19
This commit is contained in:
Rafael Oleza 2017-09-07 10:08:00 -07:00 committed by Facebook Github Bot
parent 14428a67e5
commit 177c4fb1ab
1 changed files with 5 additions and 1 deletions

View File

@ -96,8 +96,12 @@ class HmrServer<TClient: Client> {
const modules = []; const modules = [];
for (const id in result.delta) { for (const id in result.delta) {
// The Delta Bundle can have null objects: these correspond to deleted
// modules, which we don't need to send to the client.
if (result.delta[id] != null) {
modules.push({id, code: result.delta[id]}); modules.push({id, code: result.delta[id]});
} }
}
return { return {
type: 'update', type: 'update',