ember-codemods / ember-module-migrator

Automated migration for new Ember application layout.
74 stars 15 forks source link

Component with / in the name should not be converted #61

Open mixonic opened 7 years ago

mixonic commented 7 years ago

Components with / in their invocation, ala {{foo/foo-bar}} should not be converted. Alternatively they could simple be automatically renamed to foo-foo-bar, but this could have other unintended side-effect wrt the {{component helper.

My suggestion is that we throw if any component with / in the name is detected and request the user refactor that code before running the migrator again.

Refs: https://github.com/rwjblue/ember-module-migrator/issues/60

billybonks commented 7 years ago

hmm, that may be a good idea, to do the refactor before hand. ill be hard to catch dynamic invocations though.

billybonks commented 7 years ago

what do you think about a dry run, where we can build a list of components that need to be migrated before the run can occur?

or, we could do a partial migration, that migrates everything the migrator can, then leaves / components in the app directory, since we have the fallback resolver

rwjblue commented 7 years ago

Not sure I agree with the lead in here.

Many / invoked components are properly localized (and this was the primary motivation for "invoked renderables" concept here). I suppose we could "opt out" of this all intelligent localization of components when we hit a dynamic {{component usage, but that feels pretty bad TBH.

IMHO, the migrator should emit output after running that lists dynamic callsites so that they can be audited...