Skip to content

Commit

Permalink
Deprecate component template resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 22, 2024
1 parent aa91346 commit 9b35d2b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/@ember/-internals/glimmer/lib/resolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InternalFactory, InternalOwner, RegisterOptions } from '@ember/-internals/owner';
import { isFactory } from '@ember/-internals/owner';
import { assert } from '@ember/debug';
import { assert, deprecate } from '@ember/debug';
import { _instrumentStart } from '@ember/instrumentation';
import { DEBUG } from '@glimmer/env';
import type {
Expand Down Expand Up @@ -65,6 +65,21 @@ function layoutFor(
): Nullable<Template> {
let templateFullName = `template:components/${name}` as const;

deprecate(
`Components with separetly resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts.`,
false,
{
id: 'component-template-resolving',
url: 'https://deprecations.emberjs.com/id/component-template-resolving',
until: '6.0.0',
for: 'ember-source',
since: {
available: '5.10.0',
enabled: '5.10.0',
},
}
);

return (owner.lookup(templateFullName, options) as Template) || null;
}

Expand Down

0 comments on commit 9b35d2b

Please sign in to comment.