{"action":"created","issue":{"url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/54","labels_url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/54/comments","events_url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/54/events","html_url":"https://github.com/PixelsCommander/ReactiveElements/pull/54","id":113391648,"number":54,"title":"Proxying non-enumerable properties as well","user":{"login":"timdp","id":201034,"avatar_url":"https://avatars.githubusercontent.com/u/201034?v=3","gravatar_id":"","url":"https://api.github.com/users/timdp","html_url":"https://github.com/timdp","followers_url":"https://api.github.com/users/timdp/followers","following_url":"https://api.github.com/users/timdp/following{/other_user}","gists_url":"https://api.github.com/users/timdp/gists{/gist_id}","starred_url":"https://api.github.com/users/timdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timdp/subscriptions","organizations_url":"https://api.github.com/users/timdp/orgs","repos_url":"https://api.github.com/users/timdp/repos","events_url":"https://api.github.com/users/timdp/events{/privacy}","received_events_url":"https://api.github.com/users/timdp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-10-26T16:13:37Z","updated_at":"2015-11-04T13:00:35Z","closed_at":"2015-10-26T16:25:33Z","pull_request":{"url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/pulls/54","html_url":"https://github.com/PixelsCommander/ReactiveElements/pull/54","diff_url":"https://github.com/PixelsCommander/ReactiveElements/pull/54.diff","patch_url":"https://github.com/PixelsCommander/ReactiveElements/pull/54.patch"},"body":"We use React with ES6 classes transpiled by Babel. If we try to access a class method on the custom element powered by Reactive Elements, it fails. For example, this doesn't work:\r\n\r\n```javascript\r\n// Gets run through Babel\r\n\r\nclass CompBase extends React.Component {\r\n  foo() {}\r\n}\r\n\r\nclass MyComp extends CompBase {\r\n  bar() {}\r\n}\r\n\r\ndocument.registerReact('my-comp', MyComp)\r\n```\r\n\r\n```html\r\n<my-comp></my-comp>\r\n<script>\r\ndocument.querySelector('my-comp').foo()\r\ndocument.querySelector('my-comp').bar()\r\n</script>\r\n```\r\n\r\nThe underlying reason seems to be that class methods aren't enumerable in ES6, so I wrote this patch that uses `Object.getOwnPropertyNames` to proxy everything along the prototype chain up until `React.Component`. Not sure if it's a good idea, but it works for our scenario.\r\n\r\nAny thoughts?"},"comment":{"url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/comments/153713650","html_url":"https://github.com/PixelsCommander/ReactiveElements/pull/54#issuecomment-153713650","issue_url":"https://api.github.com/repos/PixelsCommander/ReactiveElements/issues/54","id":153713650,"user":{"login":"kof","id":52824,"avatar_url":"https://avatars.githubusercontent.com/u/52824?v=3","gravatar_id":"","url":"https://api.github.com/users/kof","html_url":"https://github.com/kof","followers_url":"https://api.github.com/users/kof/followers","following_url":"https://api.github.com/users/kof/following{/other_user}","gists_url":"https://api.github.com/users/kof/gists{/gist_id}","starred_url":"https://api.github.com/users/kof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kof/subscriptions","organizations_url":"https://api.github.com/users/kof/orgs","repos_url":"https://api.github.com/users/kof/repos","events_url":"https://api.github.com/users/kof/events{/privacy}","received_events_url":"https://api.github.com/users/kof/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T13:00:35Z","updated_at":"2015-11-04T13:00:35Z","body":"We can only carefully provide an explicit way of extending DOM element."}}