csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
441 stars 96 forks source link

Remove scheduleMicrotask wrapping of notifyListeners #259

Closed nullrocket closed 2 years ago

nullrocket commented 2 years ago

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Removes unneeded wrapping of notifyListeners in scheduleMicrotask

:arrow_heading_down: What is the current behavior?

Wrapping notifyListeners currently moves its execution out of scope and prevents wrapping with Router.neglect or Router.navigate.

:new: What is the new behavior (if this is a feature change)?

Removing scheduleMicrotask keeps execution within the current task.

:boom: Does this PR introduce a breaking change?

No

:bug: Recommendations for testing

All tests pass, and all examples run, there isn't any direct test of the original hack so observation is it.

:memo: Links to relevant issues/docs

https://github.com/csells/go_router/issues/226

:thinking: Checklist before submitting

nullrocket commented 2 years ago

Reference https://github.com/csells/go_router/issues/226 for discussion.

csells commented 2 years ago

PR published in go_router: ^2.5.6