Skip to content

Commit

Permalink
Merge pull request #1029 from Windvis/fix/component-helper-resolver-i…
Browse files Browse the repository at this point in the history
…gnore-built-ins

Don't resolve built-in components when used with the component helper
  • Loading branch information
ef4 committed Dec 7, 2021
2 parents 6343e9c + b4c3b10 commit c880396
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/compat/src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ export default class CompatResolver implements Resolver {
from
);
}

if (builtInComponents.includes(component.path)) {
return null;
}

let found = this.tryComponent(component.path, from);
if (found) {
return this.add(found, from);
Expand Down
15 changes: 15 additions & 0 deletions packages/compat/tests/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,21 @@ describe('compat-resolver', function () {
},
]);
});
test('built-in components are ignored when used with the component helper', function () {
let findDependencies = configure({
staticComponents: true,
});
expect(
findDependencies(
'templates/application.hbs',
`
{{component "input"}}
{{component "link-to"}}
{{component "textarea"}}
`
)
).toEqual([]);
});
test('component helper with direct addon package reference', function () {
let findDependencies = configure({
staticComponents: true,
Expand Down

0 comments on commit c880396

Please sign in to comment.