Remove layout/layoutName from classic Component#21284
Remove layout/layoutName from classic Component#21284NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
Conversation
dd38f95 to
fbedb2b
Compare
|
For context, I believe we dropped support for this in v6, per: https://deprecations.emberjs.com/id/component-template-resolving we only support component-co-location, and gjs/gts. |
| @type Function | ||
| @public | ||
| */ | ||
| declare layout?: TemplateFactory | Template; |
There was a problem hiding this comment.
I've been treating it like a shadow-deprecation from https://deprecations.emberjs.com/id/component-template-resolving
testing a new app tho with layout doesn't work as I expect: https://github.com/NullVoxPopuli/my-app-trying-to-use-layout-pls-dont-no-one-look-please-use-gjs
There was a problem hiding this comment.
I suppose I should try Ember 5.12 tho, cause the deprecation was probably removed
There was a problem hiding this comment.
5.12 with vite has the same behavior as 6.11+ with vite -- not working (good)
There was a problem hiding this comment.
5.8 classic also doesn't have layout working.
or something since 5.8 prevents hbs files from being imported "as templates"
The curly component manager now uses getComponentTemplate() to resolve templates, aligning with how Glimmer components work. The layout and layoutName properties are removed from Component. Changes: - curly.ts: templateFor() uses getComponentTemplate(component.constructor) instead of layout/layoutName properties - component.ts: remove layout and layoutName property declarations - rendering.ts, router-non-application.ts: render() uses template() from @ember/template-compiler/runtime instead of compile + layoutName - abstract-application.ts: remove compile method - Tests using layoutName rewritten to use setComponentTemplate - Tests specifically testing layout/layoutName behavior removed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fbedb2b to
c1cc192
Compare
| declare layout?: TemplateFactory | Template; | ||
|
|
||
| /** | ||
| The name of the layout to lookup if no layout is provided. |
There was a problem hiding this comment.
any form of looking up was deprecated during 5.x
| @@ -132,24 +131,12 @@ export default class CurlyComponentManager | |||
| WithDynamicTagName<ComponentStateBucket> | |||
| { | |||
| protected templateFor(component: Component): CompilableProgram | null { | |||
There was a problem hiding this comment.
I'm currently exploring if I can get rid of templateFor, but will save that for a separate PR
|
Just found out if you manually I don't like it, but it means this (and a bunch of other cleanup) needs to wait until v8 |
|
Gonna close, because it's too early to do anything here -- and |
|
Todo:
|
This should be:
|
Summary
layoutandlayoutNameproperties from classicComponentgetComponentTemplate()to resolve templates, aligning with Glimmer componentsrender()in test infrastructure usestemplate()from@ember/template-compiler/runtimeinstead of internalcompile+layoutNamelayoutNamerewritten to usesetComponentTemplatelayout/layoutNamebehavior removedThis unblocks eliminating the internal
compilefromrender(), sincetemplate()+setComponentTemplatenow works for classic components throughgetComponentTemplate.Test plan
🤖 Generated with Claude Code