Ravenstine / ember-custom-elements

The easiest way to render parts of your Ember app using custom elements.
MIT License
15 stars 4 forks source link

fix: ensure `connectedCallback` runs after Ember initializer #7

Closed alexlafroscia closed 4 years ago

alexlafroscia commented 4 years ago

This resolves an issue where the initialization logic was being run in the constructor of the custom element before the Ember initializer was finished. The result of this issue was that the custom element attempted to access properties that were not yet ready for access.

The Ember initializer creates a new promise on each run to ensure that, in a testing scenario, each initializer run gets it's own promise. This isn't strictly necessary, but is probably safer for testing purposes.

Related to #6

alexlafroscia commented 4 years ago

@Ravenstine could you cut a release that includes this fix? We're currently installing in our codebase through my GitHub fork, but would much prefer to install through npm!

Ravenstine commented 4 years ago

@alexlafroscia Yes, I will certainly do that right now. I'm sure you may might have seen my other comment but, in case you didn't, I have a PR up that addresses the related problems, so if you can check that out and make sure it does, I can also merge that and cut a release with those fixes as well.

Ravenstine commented 4 years ago

@alexlafroscia I've published v2.0.2 to NPM.