-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Before colocation, if someone had a component JS that is just a reexport of another component JS:
// app/components/one.js
export default class extends Component {}
// app/templates/components/one.hbs
One
// app/components/two.js
export { default} from './one';
// app/templates/components/two.hbs
Two
This actually gave you two distinct components with the different templates.
But after colocation, templates are associated with JS by value, and since:
import One from './components/one';
import Two from './components/two';
assert.strictEqual(One, Two); // passes
This means they can no longer have different templates. The codemod is unaware of this and just breaks your components.
A better output for the codemod would be rewriting re-exported component classes as extensions:
-export { default } from './one';
+import Component from './one';
+export default class extends Component {};
Metadata
Metadata
Assignees
Labels
No labels