You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that if watchDependencies is true, there is the path ./ in the watch list. I'd prefer to exclude this path from the watch list but there is no such a way. Using onBeforeReload is not a good solution in this case, since due to debouncing there may be a batch of events, and some of them should cause hot reloading, but if at least one event is discarded by the onBeforeReload, all other events will be discarded:
var noVeto =true;
if (_onBeforeReload !=null) {
if (changes?.isEmpty ??true) {
noVeto = _onBeforeReload?.call(newBeforeReloadContext(null, isolateRef)) ??true;
} else {
for (final change in changes ??<WatchEvent>[]) {
if (!(_onBeforeReload?.call(newBeforeReloadContext(change, isolateRef)) ??true)) {
noVeto =false; // <<< HERE a single event discards all the batch of events.
}
}
}
}
I would change the logic here so that the onBeforeReload becomes just a filter for events. If no events remain in the batch, we don't reload the code, otherwise we assume some other (not discarded) events cause hot reloading and launch the process.
What do you think?
The text was updated successfully, but these errors were encountered:
Hi! Thanks for the great package.
I've noticed that if
watchDependencies
istrue
, there is the path./
in the watch list. I'd prefer to exclude this path from the watch list but there is no such a way. UsingonBeforeReload
is not a good solution in this case, since due to debouncing there may be a batch of events, and some of them should cause hot reloading, but if at least one event is discarded by theonBeforeReload
, all other events will be discarded:I would change the logic here so that the
onBeforeReload
becomes just a filter for events. If no events remain in the batch, we don't reload the code, otherwise we assume some other (not discarded) events cause hot reloading and launch the process.What do you think?
The text was updated successfully, but these errors were encountered: