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

Multiple component invocations got this. added #101

Open
vlascik opened this issue Jan 12, 2020 · 5 comments
Open

Multiple component invocations got this. added #101

vlascik opened this issue Jan 12, 2020 · 5 comments

Comments

@vlascik
Copy link

vlascik commented Jan 12, 2020

Before:

{{nav/web-top-bar}}
{{nav/web-header}}
<div class="asdf">
  {{liquid-outlet}}
  {{liquid-modal}}
</div>

{{nav/web-footer}}

After:

{{this.nav/web-top-bar}}
{{this.nav/web-header}}
<div class="asdf">
  {{liquid-outlet}}
  {{this.liquid-modal}}
</div>

{{this.nav/web-footer}}

Current github master (3df3c19) + current master of telemetry-helpers (as the currently released version breaks on Windows)

@NullVoxPopuli
Copy link
Collaborator

What command did you use to run the codemod?
Do these components exist in the app or an add-on?

@vlascik
Copy link
Author

vlascik commented Jan 13, 2020

node p:\Git\ember-no-implicit-this-codemod\bin\cli.js http://localhost:4200/ app/**/*.hbs

nav/*components come from the app, liquid-modal comes from liquid-fire addon (https://github.com/ember-animation/liquid-fire-core/blob/master/app/templates/components/liquid-modal.hbs)

@IgorKvasn
Copy link

IgorKvasn commented Apr 24, 2020

I have the same problem - it looks like this codemod does not differenciate between properties and non-angle bracket components

I was running command: npx ember-no-implicit-this-codemod http://localhost:4200 app/

edit: I just noticed, that sometimes components are correctly left alone (not prefixed by this.) - will investigate further
as far as I noticed, components without template are prefixed with this. (maybe it's just a coincidence)

@knownasilya
Copy link

Same issue here, but it seems rare. Seems like angle bracket codemod should be run first as a workaround.

@Techn1x
Copy link

Techn1x commented Apr 16, 2021

Have also run into this, with components defined within the app errornously getting this added
{{this.debug/save-translations}}
{{this.side-nav/reading/teacher-toolkit}}
{{this.side-nav/reading/assignments/re}}
{{this.side-nav/reading/assignments/rex}}
{{this.side-nav/maths/teacher-toolkit}}
{{this.side-nav/maths/assignments}}

Interestingly, plenty of other side-nav components didn't get incorrectly this'd. Nothing obviously different between the above ^ components and the others..

EDIT: I do use pods, so could be that I guess 🤷 would be nice if the readme listed the limitations and what to look out for, it's pretty bare

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

5 participants