-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create and (trying to) fix async loading of Routes #19456
base: failing-test-case-for-engines
Are you sure you want to change the base?
create and (trying to) fix async loading of Routes #19456
Conversation
Chatted a bit with @sly7-7 about this in discord this morning, the conclusion we came to was that Ember should never attempt to enter into a loading or error route that itself is not loaded. I believe that @sly7-7 is going to update this code: ember.js/packages/@ember/-internals/routing/lib/system/router.ts Lines 1411 to 1416 in b945e5c
Check that Something like: function routeHasBeenDefined(owner: Owner, router: any, localName: string, fullName: string) {
let routerHasRoute = router.hasRoute(fullName);
if (routeHasRoute && !isPromise(router.getRoute(fullName))) {
let ownerHasRoute =
owner.hasRegistration(`template:${localName}`) || owner.hasRegistration(`route:${localName}`);
return ownerHasRoute;
}
return false;
} |
cf582e6
to
0fba94d
Compare
assert.ok(true, '/posts/1 has been handled'); | ||
let router = this.applicationInstance.lookup('router:main'); | ||
run(() => router.send('editPost')); | ||
await runLoopSettled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue I have doubt about that artificial synchronisation
@@ -941,6 +946,14 @@ class LoadingTests extends ApplicationTestCase { | |||
assert.equal(childcount, 2); | |||
}); | |||
} | |||
|
|||
['@test What about loading states'](assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder to me, to remove this test
import { isDestroying } from '@glimmer/destroyable'; | ||
import RSVP from 'rsvp'; | ||
|
||
export default class LazyRouter extends Router { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the name fits well.
@rwjblue Hi, so I've played with that PR, and I'm blocked, mainly because I miss knowledge on the testing infrastructure, and also when it comes to engines. |
Is this still relevant? |
@kategengler I'm sorry I didn't notice your question until now 😞 I don't know if this is still relevant, as far as I remember, an error could happen when a route is loaded by an engine. |
This is a follow up of #19266