Skip to content
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

Move each proxy into a weak map #16215

Merged
merged 2 commits into from Feb 6, 2018
Merged

Move each proxy into a weak map #16215

merged 2 commits into from Feb 6, 2018

Conversation

mmun
Copy link
Member

@mmun mmun commented Feb 5, 2018

  • Move each proxy into meta so it doesn't have to be a computed property.
  • Deprecate geting @each. I am treating this as an intimate private API.
  • This required moving objectAt into ember-metal to avoid ember-metal depending on ember-runtime.
  • Fix a test that should have been testing array.objectAt(i) instead of objectAt(array, i).

Remaining items:

@mmun mmun changed the title Move each proxy to meta Move each proxy into meta Feb 5, 2018
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

this.__each = new EachProxy(this);
}
deprecate(
"Getting the '@each' property is deprecated",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message needs to include more details, or it’s going to be very hard to track down...


return this.__each;
return meta(this).eachProxy;
}).volatile().readOnly()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can’t recall, why is this volatile (seems like it is stable based on the implementation)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know exactly why it was volatile, but it certainly doesn't need to be now (in fact, we could remove this CP if we wanted).

@mmun
Copy link
Member Author

mmun commented Feb 5, 2018

In chat, Rob suggested I move the each proxy into a weakmap rather than meta. I will do this.

... and fix some tests that should ahve been testing the
method version of objectAt.
@mmun mmun changed the title Move each proxy into meta Move each proxy into a weak map Feb 6, 2018
@mmun
Copy link
Member Author

mmun commented Feb 6, 2018

@rwjblue Updated.

@rwjblue rwjblue merged commit f243404 into master Feb 6, 2018
@rwjblue rwjblue deleted the move-each-proxy-to-meta branch February 6, 2018 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants