ember-engines
ember-engines copied to clipboard
Enter loading substate while waiting for lazy engine to download.
Given
Router.map(function() {
this.mount('my-engine');
});
and app/templates/my-engine-loading.hbs
, the loading substate only enters after the engine has downloaded. Is it possible to enter the loading substate before the engine starts downloading?
Are you sure that loading substate isn't entered? Or is the transition resolving too quickly? If you verified the above, then we should consider this a bug.
The logic for whether the loading substate is entered starts here and you can see the slowTransitionTimer
gets canceled if the transition completes before it fires.
I slowed down the network and verified that while the assets are downloading, my previous route template is shown.
Se my comment on the related bug. The substate should be a property of the engine itself, not its host.
@nathanhammond I don't think the two issues are related. The other one is concerned with what to do during a blocked model hook in an engine, and this one is waiting for an engine is downloading, so we haven't made it into engine code yet.
Right now it seems like the app is hung on the old route while the engine downloads. It seems like the best thing to do is enter the loading substate during this.
+1 Facing the same issue
May be we can have an intermediate transition by triggering _scheduleLoadingEvent
here. But _scheduleLoadingEvent
requires a routeHandler
which will not be available until the engine resources are loaded. Thoughts?
@trentmwillis Same here. The loading template shows up until the JavaScript file and CSS file are downloaded.