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 19, 2024
1 parent a435903 commit 0e741f2
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
Expand Up @@ -2,7 +2,7 @@ import { privatize as P } from '@ember/-internals/container';
import { ENV } from '@ember/-internals/environment';
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 @@ -67,6 +67,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 0e741f2

Please sign in to comment.