Problem/Motivation

HtmlRenderer and HtmxRenderer build different HTML documents.

Once each renderer has prepared its render array, both however use the exact same code to render it, collect attachments and cacheability metadata, and create an HtmlResponse.

Proposed resolution

Introduce AbstractHtmlRendereras an @internal abstract base class and consolidate the shared code into AbstractHtmlRenderer::doRender().

Also provide a AbstractHtmlRenderer::resolveTitle() method, since both renderers use the main content's #title and fall back to the route title.

Add a successful anonymous request as a second test case to HtmxRendererCacheTest alongside the preexisting access-denied case to verify a main content cache tag reaches the response, the second request being served from cache.

Remaining tasks

Review.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

n/a

Issue fork drupal-3642002

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pancho created an issue. See original summary.