mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-25 21:05:40 +08:00
Make HMR faster (2)
Summary: public The HMR listener needs to be invoked on the non debounced callback to avoid loosing updates if 2 files are updated within the debounce configured time. Also, improve the time it takes to send HMR updates by avoiding rebuilding the bundle when the listener is defined. Instead just invalidate the bundles cache so that if the user reloads or disables Hot Loading the packager rebuilds the requested bundle. Reviewed By: davidaurelio Differential Revision: D2863141 fb-gh-sync-id: 3ab500eacbd4a2e4b63619755e5eabf8afdd1db9
This commit is contained in:
committed by
facebook-github-bot-9
parent
65b8ff17f3
commit
68f71dab4c
@@ -109,10 +109,10 @@ function attachHMRServer({httpServer, path, packagerServer}) {
|
||||
|
||||
packagerServer.setHMRFileChangeListener((filename, stat) => {
|
||||
if (!client) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
return stat.then(() => {
|
||||
stat.then(() => {
|
||||
return packagerServer.getShallowDependencies(filename)
|
||||
.then(deps => {
|
||||
if (!client) {
|
||||
|
||||
Reference in New Issue
Block a user