-
Notifications
You must be signed in to change notification settings - Fork 604
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
Remove computed property overrides #1841
Remove computed property overrides #1841
Conversation
78506c9
to
a026125
Compare
Great! As you point out, doing this with a computed property macro would end up being less verbose. |
Agreed, that’s my preference, but I’m not a maintainer so I’ll wait for confirmation that they’d be into having that kind of abstraction in the codebase 😀 |
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.
I think all of the CPs with _
prefixes are only overridden in tests. As they are private API anyway, I'd say it should be fine to replace them with regular properties and set them in init
or so which should be much simpler than turning them all into writeable CPs.
set(key, value) { | ||
this.routeAfterAuthenticationOverride = value; | ||
return 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.
Could this not be replaced with
routeAfterAuthentication: Configuration.routeAfterAuthentication,
simply? I can't remember why this was made a CP in the first place…
As suggested by @marcoow here: mainmatter#1841 (comment)
As suggested by @marcoow here: mainmatter#1841 (review)
I made those changes but maybe |
There’s more than one thing wrong but it’s true that (Also, that doesn’t work with |
I think using |
I can’t explain it but I made 4f48367 to add some logging that shows that I needed 4379cf3 to get the lint and floating dependencies tests running on Travis, maybe some dependency has dropped support for Node 6? I’ve since removed it, but before that, the tests were passing apart from the FastBoot one but the failures look the same as those on the most recent I’m unsure about the Node 6 vs 8 thing but could easily open a PR to change that if it’s desirable. |
These changes look good! Any change to get them merged soon? Thanks. |
I just came across a problem with |
This fixes the deprecation warnings described here: https://deprecations.emberjs.com/v3.x/#toc_computed-property-override As mentioned by @richard-viney here: mainmatter#1799 (comment)
As suggested by @marcoow here: mainmatter#1841 (comment)
As suggested by @marcoow here: mainmatter#1841 (review)
I’m not sure why this would have broken recently…?
36770a7
to
9aea609
Compare
This is a subset of mainmatter#1841 as requested by @locks: https://discordapp.com/channels/480462759797063690/491905849405472769/600683165929177091
closing in favor of #1900 |
I believe #1900 was just a subset of the changes here. There are a few more deprecations going on. |
This fixes the deprecation warnings described here, from Ember 3.8:
https://deprecations.emberjs.com/v3.x/#toc_computed-property-override
You can see in the Travis logs that the warnings are gone by comparing the log of this most recent run on
master
, which has 222 instances of “overriden” (sic), to the log of this PR run, which has 0!I chose to follow a pattern of adding a property to
this
with the same attribute name withOverride
appended. This allows theget
to check if the overridden property exists before sending the default if it doesn’t. It’s repetitive and a bit unwieldy. Since it’s the same pattern for each computed property, it could be extracted. Let me know if you think that’s desirable or if there are any other changes you’d like to see.Thanks for this project, it’s great to have around!