-
-
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
Add a couple of tests to test passing empty queryParams
to replaceWith
#20042
Closed
boris-petrov
wants to merge
1
commit into
emberjs:master
from
boris-petrov:add-tests-for-replace-with
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In this case, this is something we could support but it's also not 100% clear to me that we want to. Can you explain more to me about the use case?
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.
Well, you can see what I had in my code here. The idea is that users of that component could set in
model
their ownrouteComponents
and (optionally)queryParameters
and the component would transition to that. Users might not addqueryParameters
which would mean that this call:Would become:
Which used to work on Ember < 4.3.0 but broke on 4.3.0. Not saying it's good, just saying it used to work. And is useful. 😄
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.
Fair enough! I'll look into it more next week.
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.
So I played around with this some and it looks like router.js would also need an update to handle this case correctly. In your case, a simple solution is probably
this.model.queryParameters || {}
. I'm open to more discussion however.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.
hm, but as I said, this used to work in the previous Ember version without changes to
router.js
. But I don't know the current code, of course. Also, note thatthis.model.queryParameters || {}
also doesn't work - check the first test of the two - it tests exactly that (and fails).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.
Ah, empty query params should work at least. I'll see about fixing that.
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.
Also, just because something worked before doesn't mean we guarantee that it will keep working, only if it is something that was clearly documented or widely used to the point where it's basically official. Honestly, this whole API is somewhat awkward so it's not actually clear to me what's most correct. I'm happy to hear another opinion on this.