feat: deprecate HasDynamicTitle in favor of PageTitleGenerator#24606
feat: deprecate HasDynamicTitle in favor of PageTitleGenerator#24606totally-not-ai[bot] wants to merge 1 commit into
Conversation
HasDynamicTitle resolves a route title from a live instance, so it can only produce a title for the route currently shown. Guide users towards DynamicPageTitle together with a PageTitleGenerator, which resolves the title from the navigation target class and its route parameters without an instance and therefore also works for routes rendered in breadcrumbs, menus and other navigation aids. Deprecate the interface and suppress the resulting warnings in the internal call sites that still consult it.
| * aids. Use this interface only when the title genuinely needs to | ||
| * reflect the live state of an already shown view. | ||
| */ | ||
| @Deprecated(since = "25.3") |
There was a problem hiding this comment.
| @Deprecated(since = "25.3") | |
| @Deprecated(since = "25.2") |
|
|
I don't like this deprecation and afterwards removal. We have use-cases where we want to generate the title dynamically once the view was build. Example: We have an FAQ where the page title contains the question. The user is redirected to the page based on the ID of the question. We execute a costly look-up of the question once and store it as instance variable inside the view. This allows us access Without the view instance this lookup has to be done twice - once for the title and once for the view. |
|
Is there a particular reason you want cache it inside the view instance and not in a service layer cache or similar? |
|
Complexity and convenience :) View / Route is the perfect place for such short-living information. |



HasDynamicTitle resolves a route title from a live instance, so it can
only produce a title for the route currently shown. Guide users towards
DynamicPageTitle together with a PageTitleGenerator, which resolves the
title from the navigation target class and its route parameters without
an instance and therefore also works for routes rendered in breadcrumbs,
menus and other navigation aids.
Deprecate the interface and suppress the resulting warnings in the
internal call sites that still consult it.