mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Hot Loading Indicators
Summary: public Introduce a header bar similar to the one shown when loading the bundle to indicate that the packager server is processing an HMR update. Hook into HMR events to show this bar when appropriate. Reviewed By: javache Differential Revision: D2873521 fb-gh-sync-id: a77cbb2368b75b045aa8c6ababce2f731baf514b
This commit is contained in:
committed by
facebook-github-bot-7
parent
180ead05e9
commit
36efbc341d
@@ -112,6 +112,7 @@ function attachHMRServer({httpServer, path, packagerServer}) {
|
||||
return;
|
||||
}
|
||||
|
||||
client.ws.send(JSON.stringify({type: 'update-start'}));
|
||||
stat.then(() => {
|
||||
return packagerServer.getShallowDependencies(filename)
|
||||
.then(deps => {
|
||||
@@ -240,7 +241,9 @@ function attachHMRServer({httpServer, path, packagerServer}) {
|
||||
() => {
|
||||
// do nothing, file was removed
|
||||
},
|
||||
);
|
||||
).finally(() => {
|
||||
client.ws.send(JSON.stringify({type: 'update-done'}));
|
||||
});
|
||||
});
|
||||
|
||||
client.ws.on('error', e => {
|
||||
|
||||
Reference in New Issue
Block a user