ember-codemods / ember-no-implicit-this-codemod

Template codemod for refactoring from `{{foo}}` to `{{this.foo}}`
MIT License
17 stars 25 forks source link

Doesn't recognize Glimmer Components via runtime telemetry #394

Open gitKrystan opened 1 year ago

gitKrystan commented 1 year ago

This codemod currently uses analyzeEmberObject exported from ember-codemods-telemetry-helpers. It turns out that the analyzeEmberObject implementation is very specific to the native class codemod that it was extracted from, and thus it only recognizes EmberObject and its descendants when determining the type property:

https://github.com/ember-codemods/ember-codemods-telemetry-helpers/blob/cf2bb9be57bd5cc454c73c61217db64d76c0dbed/lib/gather/analyze-ember-object.js#L158-L171

To fix this, we should replace analyzeEmberObject with our own implementation.

This is probably the root cause for: https://github.com/ember-codemods/ember-no-implicit-this-codemod/issues/101

It might be related to: https://github.com/ember-codemods/ember-no-implicit-this-codemod/issues/43