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

Avoid 3rd party helper naming collision #3

Merged
merged 2 commits into from
Jul 9, 2018

Conversation

billdami
Copy link
Member

@billdami billdami commented Jul 9, 2018

Workaround for issue caused by ember-leaftlet's inclusion of a helper called icon, which collides with the icon component property, as global helper's take precendence over property names in the ember resolver.

see: miguelcobain/ember-leaflet#175

cc @miguelcobain

…naming collision from a bad citizen 3rd party addon
@billdami billdami requested a review from bakerac4 July 9, 2018 13:49
@billdami billdami self-assigned this Jul 9, 2018
@miguelcobain
Copy link

It really sucks that people need to do this in unrelated addons, but to solve this on ember-leaflet would mean introducing a breaking change (renaming the helper). Also, if I prefix the helper to leaflet-icon or something, it would probably mean that I would need to prefix all helpers. We never know what names people are using on their variables.

However, in my defense:

  1. this is very easy to solve using {{this.property}} like in this PR, and with zero breaking changes for everyone
  2. an Ember RFC was merged that basically deprecates {{property}} lookups, in favor of {{this.property}} lookups: Transition Away From Property Fallback Behavior emberjs/rfcs#308
  3. module unification will also solve this because it will introduce namespacing for addons

@@ -1,5 +1,5 @@
{{#if hasIcon}}
{{fa-icon icon class="action-button-icon"}}
{{fa-icon this.icon class="action-button-icon"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billdami can you add a comment above this line explaining why we need to do this. I know we will forgot at some point and it would be nice to have a reminder in the code

Copy link
Member

@bakerac4 bakerac4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bakerac4 bakerac4 merged commit 0a5e9f9 into master Jul 9, 2018
@bakerac4 bakerac4 deleted the feature/avoid-helper-naming-collision branch July 9, 2018 14:59
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

Successfully merging this pull request may close these issues.

4 participants