-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Updates the navigation strategy to handle and expect a resolved strin… #393
base: master
Are you sure you want to change the base?
Conversation
I was going to also write some unit tests for this, but I couldn't get the tests to run locally after doing a jspm install. Not sure what that's about. |
Is there some reason why the custom navigation strategy can't just add the view ports onto the instruction's config? That was the original intent. |
When I started using the
Which does not work if you to return different |
Can you foresee any issues with just adding a viewPorts property onto the config in the callback? |
From the app developer's perspective, all they want is for a module to be loaded based on logic within their callback. At least this is the only use-case I've needed so far. Why not set the appropriate places on the instruction for them based on the resolved string or viewport-ID:module-id object mapping? It's just sugar. http://aurelia.io/hub.html#/doc/article/aurelia/router/latest/router-configuration/3
Changes to:
If the
|
@Roustalski Are you able to sign the CLA? There's a link in the details section of this issue. |
Alright, I signed the CLA by following the details link and clicking the button, but it still says it hasn't been signed O.o |
@Roustalski Is there any chance the email associated with your local git isn't the same as Github? We've had this happen a couple of times so we are trying to track down the source. @PWKad Can you chime in on this based on your experience? |
…g or object of viewport names with module ids for each key.
…acks on the navigation strategy
@bryanrsmith See any issues with this? |
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.
If a dev returns a falsey value in their nav strat, they might expect it to fall back, but it seems to just break. Changes recommended.
|
||
if (typeof modules === 'string') { | ||
modules = {'default': modules}; | ||
} else if (modules === undefined) { |
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.
For example, if someone has logic in their nav strat that falls back to a null value, they might expect it to run with the default config, but instead, modules will remain null and this will throw an unhandled error.
I'd recommend updating this to check for a falsey value.
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.
@Roustalski Can you update to handle this case?
Yea, I'll check this out and update. |
@Roustalski Hey Russ, appreciate the time you took on this PR. Did you have a chance to update this PR? |
@StrahilKazlachev I made this repo to replicate another problem I currently have, but I added a console.log(instruction) in app.js on line 24, which - as I understand it - would indicate the exact opposite of what you state here: "The first time navigationStrategy is called navigationInstruction.config does not have viewPorts set". If you download the repo and run it, you should see that it works just fine - or at least as I would expect it to work. Maybe I'm just missing your point entirely? :-) |
@sorenhoyer There were quite a lot of fixes since my comment. |
Stale? |
Defer to @davismj to determine what to do with this. |
Since the PR was never updated I can't merge it in. However, I don't have my head in this issue well enough to know if it is important or not. I'd like to come back to it later, but without more interest its low prio. |
…g or object of viewport names with module ids for each key.
Primarily for #289, but also #386