HMR: Include updated modules in the correct order

Reviewed By: davidaurelio

Differential Revision: D5852269

fbshipit-source-id: 519564a4899b22d16a2ab3be4b466e21783e8f86
This commit is contained in:
Rafael Oleza 2017-09-18 08:56:18 -07:00 committed by Facebook Github Bot
parent a7ad7502aa
commit f6e2e17900
1 changed files with 4 additions and 1 deletions

View File

@ -129,7 +129,10 @@ class HmrServer<TClient: Client> {
// The Delta Bundle can have null objects: these correspond to deleted
// modules, which we don't need to send to the client.
if (module != null) {
modules.push({id, code: module.code});
// When there are new modules added on the dependency tree, they are
// appended on the Delta Bundle, but HMR needs to have them at the
// beginning.
modules.unshift({id, code: module.code});
}
}