{"action":"created","issue":{"url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/51","repository_url":"https://api.github.com/repos/glimmerjs/glimmer-component","labels_url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/51/comments","events_url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/51/events","html_url":"https://github.com/glimmerjs/glimmer-component/issues/51","id":221860044,"number":51,"title":"didUpdate hook called before component is rerendered","user":{"login":"habdelra","id":61075,"avatar_url":"https://avatars2.githubusercontent.com/u/61075?v=4","gravatar_id":"","url":"https://api.github.com/users/habdelra","html_url":"https://github.com/habdelra","followers_url":"https://api.github.com/users/habdelra/followers","following_url":"https://api.github.com/users/habdelra/following{/other_user}","gists_url":"https://api.github.com/users/habdelra/gists{/gist_id}","starred_url":"https://api.github.com/users/habdelra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habdelra/subscriptions","organizations_url":"https://api.github.com/users/habdelra/orgs","repos_url":"https://api.github.com/users/habdelra/repos","events_url":"https://api.github.com/users/habdelra/events{/privacy}","received_events_url":"https://api.github.com/users/habdelra/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-14T18:07:58Z","updated_at":"2018-03-05T14:33:56Z","closed_at":"2018-03-05T14:33:56Z","author_association":"CONTRIBUTOR","body":"The didUpdate hook is invoked before the component is re-rendered into the DOM. Here is a repo to reproduce the issue:  https://github.com/habdelra/glimmerjs-didUpdate-hook/\r\n\r\nThe component looks like this:\r\n```ts\r\nimport Component, { tracked } from \"@glimmer/component\";\r\n\r\nexport default class GlimmerDidUpdateHook extends Component {\r\n  updated = false;\r\n\r\n  @tracked\r\n  foo: boolean = false;\r\n\r\n  didInsertElement() {\r\n    setTimeout(() => {\r\n      this.foo = true;\r\n    }, 2000);\r\n  }\r\n\r\n\r\n  didUpdate() {\r\n    if (!this.updated) {  // to compensate for infinite rerender bug\r\n      this.updated = true;\r\n\r\n      console.log('this.foo is ', this.foo);\r\n      let fooElement = document.getElementById(\"foo\");\r\n      if (!fooElement) {\r\n        console.log(\"Can't find foo\");\r\n      }\r\n    }\r\n  }\r\n\r\n}\r\n\r\n```\r\n\r\nthe template looks like this:\r\n```hbs\r\n<div>\r\n  <h1>Welcome to Glimmer!</h1>\r\n  {{#if foo}}\r\n    <div id=\"foo\">I'm a foo!</div>\r\n  {{/if}}\r\n</div>\r\n\r\n```\r\n\r\nThis is what I see in the console:\r\n<img width=\"639\" alt=\"screen shot 2017-04-14 at 2 16 21 pm\" src=\"https://cloud.githubusercontent.com/assets/61075/25051891/f981ba58-211c-11e7-865d-2d5feecbddfa.png\">\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/comments/370437558","html_url":"https://github.com/glimmerjs/glimmer-component/issues/51#issuecomment-370437558","issue_url":"https://api.github.com/repos/glimmerjs/glimmer-component/issues/51","id":370437558,"user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars0.githubusercontent.com/u/12637?v=4","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T14:33:56Z","updated_at":"2018-03-05T14:33:56Z","author_association":"OWNER","body":"This repo has been merged with glimmerjs/glimmer.js (into a monorepo setup). I am not sure if this issue is still applicable, but if you could confirm it is still an ongoing concern and open it over there that would be very helpful.\r\n\r\nSorry for the noise, but thank you for your help!"}}
{"actor":{"display_login":"rwjblue"}}