-
-
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
[BUGFIX beta] Remove chaining in Observable.set #11213
Conversation
yes please :P. Although I have no idea how to deprecate... That being said, we can provide an add-on that restores this functionality for those who experience this as a pain point. |
For consistency, this also has to be done with I'd been trying hard to test this but I just |
We may want to slide this into the current beta. If it turns out to cause lots of grief we can roll it back, but i suspect it wont, and for the ones who may, it is a mechanical change. That way the 1.13 -> 2.0 upgrade statement of minimal pain remains true @cibernox I'll look into your tests failure today. |
I'm kind-of blocked on this because I can't run the tests locally. I'll try to reinstall node itself. Have you heard of this before? |
currently you must still use node 0.10.35. Until we finish upgrading all the micro-libs to the latest transpiler. |
So the problem can come from using |
Not a known problem. The problem I am aware of is new node versions that have Symbols. Old traceur attempts to coerce them, which causes a hard crash. Your problem appears in related? |
No, that's the problem with node 0.12/iojs. My problem is that |
i'll give it a try momentarily, just |
Unfortunately, I could not reproduce your issues. Everything appears to boot :( let me see if i can fix your test failures though |
I couldn't cherry-pick it either, but I applied the changes as a |
9703338
to
dd52c66
Compare
Failed in sauce, probably random |
re-running |
likely needs to be bugfix beta |
Looks like tests are fixed up. @stefanpenner - Have time for a final review? |
I'm good with this. Lets bring it up at this weeks meeting. |
resolution:
|
I'm very curious about the static analysis. I really don't see a reliable way of warn about this. |
just the obvious o.set().set() or
o.set().<anything>
o.setPropertyes().<anything>
var a = o.set(); |
@stefanpenner that analysis be done as part of the build process in ember-cli? |
@cibernox Basically you want to write a babel transform that looks for |
@cibernox Yes, we'll build it into ember-cli, but likely also build a node module for non-ember-cli projects to use. |
It's amazing the kind of things you can do with esprima. Completely dark magic to me. |
Maybe we could start an ES-lint plugin package for ember? http://eslint.org/docs/developer-guide/working-with-rules.html |
Ember Watson is also a great place to start if you're new to these kind of transforms using recast, but it sounds like we want a warning instead of an actual transformation. https://github.com/abuiles/ember-watson |
dd52c66
to
dfc31df
Compare
Rebased |
@stefanpenner @cibernox @mmun is this going into beta? It would need to land asap. I'll happily doc it in the blog post, but I will need guidance. |
This should go into beta to align ember get/set with regular ES5 getters/setters, the controversy here is how much of an issue is breaking backwards compatibility, since there's no easy way of deprecate this. On the other hand, very very few people (if any at all) will be using such an awkward construct like |
@cibernox master is currently 2.0- should it just go into 2.0 as a small breaking change? |
Personally I'm ok with breaking changes in general as long as they are small and the upgrade path is properly documented. |
i am +1 |
Merging this into beta (Ember 2.0) |
[BUGFIX beta] Remove chaining in Observable.set
👍 |
Pulled into beta.
|
Does this deserve an special entry somewhere in the website repo? |
@cibernox I would just like to add it to the 2.0 "breaking changes" section of the blog post: emberjs/website#2212 |
This broke apps in the wild but still got merged, and the breaking change never got documented--not on the blog, not in the deprecations section, just a silent update to the API docs. I had to read the git the history of |
For those who come here after this, I've released an addon that undoes this change! Hope you find it useful: https://github.com/secondstreet/ember-observable-set-chaining |
@Kerrick I'm sorry this wasn't documented properly. Maybe it's not too late to add a note in the 2.0 blog post. Also, deprecate this functionality was almost impossible, since the only way of detecting chaining would be some sort of static code analysis. However I'd discourage you to restore the old functionality with an addon. The same way this change broke your app, it's likely that undoing it will break addons in the wild, ending up in your app being broken anyway. |
@Kerrick I've added a not as the very first line of the changelog for the 2.0 release with big a breaking label, so at least this is easier next time. |
@cibernox Thank you! If anybody else besides us still hasn't upgraded to 2.X and they read the changelog, hopefully they won't be confused by this now. 👍
Yeah, but the only way to find all instances of this to change them across our six Ember apps and 25K+ lines of JavaScript would be some sort of static code analysis. 😝 |
Ignore this for now