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

didReceiveAttrs not called anymore #58

Open
patric-eberle opened this issue Jan 21, 2020 · 5 comments
Open

didReceiveAttrs not called anymore #58

patric-eberle opened this issue Jan 21, 2020 · 5 comments

Comments

@patric-eberle
Copy link

Ember 3.13.1
ember-islands 1.5.1

It seems like the initial handling of didReceiveAttrs when initializing a component with factoryFor has changed (see emberjs/ember.js#17534 ). We run into this problem because a part of our components was relying on this.

To me it looks, like this hook should be called manually now, to preserve the normal component lifecycle. Maybe extend add the trigger('didReceiveAttrs') to the following code in get-render-component.js?

// ...
let componentInstance = component.create(attrs);

componentInstance.trigger('didReceiveAttrs');
componentInstance.appendTo(element);

return componentInstance;
// ...
@mitchlloyd
Copy link
Owner

mitchlloyd commented Feb 4, 2020 via email

@patric-eberle
Copy link
Author

@mitchlloyd true. I'm not that familiar with Ember anymore unfortunately... The only thing that came to my mind is checking the current Ember version? Not very nice, but it would work I guess.

@mitchlloyd
Copy link
Owner

Maybe @rwjblue could advise a bit? I looks like we could inspect the Ember version to fix this bug (>= 3.2.0) and then trigger the didReceiveAttrs hook, but I'm curious if there is a more official way. Perhaps I could use the component manager directly?

@rwjblue
Copy link

rwjblue commented Mar 29, 2020

Yeah, I think detecting Ember version is the best bet. I don't think we expose the managers themselves (though that is a good idea and would help libs like this to avoid having to care about these specific nuances).

@xtagon
Copy link

xtagon commented Jun 3, 2021

Is there a solution or workaround for this? Does ember-islands support Ember 3.x?

Thanks in advance 👍

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

No branches or pull requests

4 participants