-
-
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
[FEATURE ember-route-serializers] Introduce serialize method to Router DSL options and deprecate Route#serialize #13016
Conversation
18c2d6f
to
8b51ff5
Compare
Updated to separate the |
deepEqual(router.location.path, '/posts/emberjs'); | ||
}); | ||
|
||
QUnit.test('Custom Route#serialize method raises deprecation warning but still works', function() { |
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.
Usually we just prefix these tests with DEPRECATED:
This is a good PoC @trentmwillis! A requisite next step would be this needing a feature-flag, prefixed commit etc. See contributing guides on adding a feature and CONTRIBUTING.md. It seems like @rwjblue would also like to see the testing coverage over both features be the same, which means either duplicating the tests or better yet coming up with a good abstraction to help test the feature. Other thoughts @rwjblue? Likely @stefanpenner and @dgeb want to review in detail. |
Thanks for reviewing @mixonic! Now that the RFC has been merged I'll work on formalizing this a bit more. As for the tests, I don't think there will be a good way to abstract out the new feature vs. the old but I'll take a look. |
Ya, duplicating them is fairly common (since when enabled we will delete the duplication anyways). |
8b51ff5
to
f7a4b71
Compare
Bolstered tests, added a feature flag, and prefixed the commit. I also cleaned up some usage of |
☔ The latest upstream changes (presumably #13144) made this pull request unmergeable. Please resolve the merge conflicts. |
f7a4b71
to
84ca9be
Compare
run(function() { | ||
expectDeprecation(function() { | ||
router.transitionTo('posts', { category: 'emberjs' }); | ||
}); |
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.
Adding the deprecation message as a second argument to expectDeprecation
will ensure that we're catching the right deprecation.
Nice work @trentmwillis - LGTM except that one nit 👍 |
84ca9be
to
13ffd6d
Compare
@dgeb updated with your suggestion. However, it's failing but says the actual and expected values are the same, so I don't know what to do. |
@trentmwillis ok thanks - will investigate. |
☔ The latest upstream changes (presumably #13285) made this pull request unmergeable. Please resolve the merge conflicts. |
The message says:
I believe it is saying that |
Ah okay, that makes sense. Was not interpreting it that way. I'll look into that sometime soon. |
13ffd6d
to
29eddb9
Compare
@trentmwillis - Awesome! I added the following items to a checklist in the main PR description:
|
Sounds good, I'll try to get to those sometime this weekend. |
29eddb9
to
0c35433
Compare
…r DSL options and deprecate Route#serialize
0c35433
to
f4b2723
Compare
I believe the API docs for |
Yeah, I was going to look at the API docs tomorrow to identify what all would need to be updated. Only things I could think of were |
Yeah, I suspect it is documented in |
@rwjblue I've opened a PR for the API docs update, which I believe was the last pertinent documentation change. |
Awesome work @trentmwillis, thanks for keeping on this! |
@trentmwillis @rwjblue I saw #13360 was closed. Is it currently recommended to define |
Ya, current recommendation is for route class. Though this (somewhat fundamentally) means that lazily loaded routes cannot customize their serialization behavior. Ideally you just shouldn't need to customize... |
Implementation of emberjs/rfcs#120.
TODO:
FEATURES.md
ember-routing.serialize-function
(and updatedeprecate
calls here to include theurl
) [Add to deprecation guide website#2557]