-
Notifications
You must be signed in to change notification settings - Fork 42
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
[WIP] Preserve queryParams #47
base: master
Are you sure you want to change the base?
Conversation
@GavinJoyce May I take some advice on how to measure the perf of this change? I imagine that setting an observer won't affect performance that much (although all helpers will recompute when qps change while now it doesn't, but that is a bug to me) |
@cibernox I just manually copy some code into a custom benchmark in a throwaway Thanks for doing this, this is a nasty bug and it's great that it'll be fixed |
@GavinJoyce That would be great. That said, don't merge it yet. I need to test more edge cases.
|
@cibernox I didn't manage to get benchmark data, I was planning to modify GavinJoyce/ember-performance#1 but onQpsChange: Em.observer('_routing.currentState', function() {
this.recompute();
}), This seems like it will be expensive on any route transition, every href-to will |
I've been able to create a couple more complex scenarios that still fail. Over the weekend I'll try to figure out how to better do this. I've also seen on the core notes that they agreed to proceed with your url-for RFC, so I might ping someone to give some guidance on this. |
The basic idea is that when a link doesn’t specify the value for a query param, the current value is preserved. So, given the hierarchy ``` qps // defines a QP named “string” qps.details // defines a QP named “nestedString” qps.details.more // defines a QP named “doubleNestedString” ``` Links inside `qps.details.more` that point to `qps.details` will contain “nestedString=bar&string=foo”, but never “doubleNestedString”. Links inside `qps.details` that point to `qps` will contain “string=foo”, but never “nestedString” or “doubleNestedString”. Links inside `qps.details` that point to `qps.details` with a different will model will contain “string=foo” but never “nestedString” or “doubleNestedString”. Links from a route to any descendant route will always include all the query params defined in the path.
2d06aea
to
c179ed3
Compare
I was experimenting with this because I need it on my own project. Few observations:
|
Is it worth investigating this with the new public |
@scalvert I believe it's not. I mean, its probably worth pursuing, but the approach would be totally different from different. Tests seem valuable tho |
So far I've proven that this is doable by using the
-routing
service and observing changes in the state of that service.Questions to be answered:
{{link-to}}
that would defeat the purpose of using it.