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

Incorrect {{has-block}} during interop #4

Open
chancancode opened this issue May 22, 2020 · 3 comments
Open

Incorrect {{has-block}} during interop #4

chancancode opened this issue May 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@chancancode
Copy link
Contributor

chancancode commented May 22, 2020

As explained in the README:

On Ember versions without native named blocks support, when passing only named blocks (without passing a <:default> or <:main> block) to an external (addon) component whose template was not preprocessed by this polyfill, {{has-block}} in that component's template will return true.

This is unlikely to be an issue in practice – if you are running an Ember version that requires this polyfill and the addon itself is not also using the polyfill, it probably means that the addon component you are invoking does not accept named blocks anyway, so there is no use in passing them.

This is due to desugaring the named blocks into the default/main block. There is probably no way to fix this, but seems unlikely to be a real issue.

@chancancode chancancode added the bug Something isn't working label May 22, 2020
@bartocc
Copy link
Contributor

bartocc commented Jul 9, 2020

I've hit this issue when using this addon in a 3.15 app with several in-repo addons.

The dependency graph is as follow

ui-addon -> middle-addon -> ember-app

ui-addon is providing a component that accepts named blocks. In order to be able to use this component in both middle-addon and ember-app, I've had to add ember-named-blocks-polyfill as a dependency in all packages.

Not a very big deal, but I though it was worth mentioning here

@chancancode
Copy link
Contributor Author

@bartocc I think the issue you are describing is #24 and unrelated to this

@bartocc
Copy link
Contributor

bartocc commented Jan 14, 2021

Indeed @chancancode, #24 is more likely to be the source of my issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants