ember-engines: route#refresh no longer works
App demoing that this.refresh() in an engine route works in ember 3.5.1, but not ember 3.6
Never calls model hook: https://github.com/amk221/-ember-engine-refresh-route/commit/71dd1b606e5a33d01ede516aa6936bc5b2683b1d#diff-394600f34d48dad6f0abc29af03d8b1bR5
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (9 by maintainers)
I have a fix here https://github.com/tildeio/router.js/pull/284
Tried with
ember-source 3.9.0and works 👌Ran into this myself, so I did some digging and found the problem – I’m not used to debugging Ember itself so apologies in advance if I fudge the explanation/terms a bit.
The tricky bit is here, in router.js’s NamedTransitionIntent class:
What’s happening is
parsedHandlersuses the full route name, like so:…but it’s comparing it to
pivotHandler.routeName, which is the relative name of the route in Engine-land:[Apologies for the shoddy screenshots. In the 2nd screen, fullRouteName is “home.tenant.analytics.interact”]
For
ember-engineswe need to compare it topivotHandler.fullRouteNameinstead. I did a quick-hack fix in my local dev environment and confirmed that this fixes the issue (and the infinite loop @thec0keman found – it’s indeed the same root issue).Since
fullRouteNameis anember-engines-specific extension, it’ll probably be necessary to extend NamedTransitionIntent to do this, I presume? Might be best to get a second opinion from a proper dev before attempting a PR just yet.