Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading substate isn't entered when lazily-loaded engine is mounted to root of host app #754

Open
camerondubas opened this issue Feb 25, 2021 · 1 comment

Comments

@camerondubas
Copy link
Contributor

Hey all馃憢

When an lazy-engine is mounted to the root of the host app, the loading suvbstate will not be entered while the assets for the engine are being downloaded.

The loading state is entered in these cases:

  • After the assets are downloaded and the engine's application route is loading
  • If the engine is mounted to a subroute on the host application.

The docs for lazy engines indicates that this functionality should be present. https://ember-engines.com/docs/lazy-loading#loading-error-substates.

I have recreated this issue in this repo: https://github.com/camerondubas/ember-engine-loading-state

Two acceptance tests were added. One demonstrates that the intended functionality works when the engine is mounted to a child route, while the other demonstrates that this functionality doesn't work when mounted to the root.

Due to caching the downloaded assets in the test suite. The tests will inconsistently fail unless they are run separately.
The yarn run test-both command can be run to execute both tests in sequence, ensuring consistent test results.


I would be happy to take a stab at fixing this issue if I could be pointed in the right direction.

Thanks!

@rwjblue
Copy link
Member

rwjblue commented Mar 16, 2021

This is definitely odd, and seems like a bug but it is most likely in Ember itself (or router_js).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants