Skip to content
Snippets Groups Projects
Commit 66cdc963 authored by Hannes Lau's avatar Hannes Lau Committed by Benni Mack
Browse files

[TASK] Use ext:core ViewInterface in extbase

TYPO3 v12 added a new ViewInterface to ext:core that allows
implementing *any* view as long as it sticks to this interface.

This interface has been put into use for all backend modules,
combined with a factory that allows to set custom stuff per module.

Extbase however has not been touched: Extbase is still
tailored towards ext:fluid and Fluid standalone.

The patch changes this by adapting the Extbase related views towards
ext:core ViewInterface. This allows implementing "own" views not
depending on Fluid standalone.

The patch has to hop through quite some loops to allow this:

ext:core FluidViewAdapter is a class implemented in v12 that
is a facade between core views and Fluid. Unfortunatly,
extbase uses some "specialities" like "renderPartial()" from
Fluid, which ext:core ViewInterface does not implement. We
can not get rid of those within extbase any time soon. As such,
FluidViewAdapter now implements all the nasty details that
Fluid provides: FluidViewAdapter is now the main class between
extbase and Fluid views - it implements both the Fluid view
interface, plus ext:core ViewInterface. FluidViewAdapter in
itself is rather simple: It only holds the Fluid view instance.
Historically, many further operations were possible on
Fluid view classes, those were only wrappers around
RenderingContext, though. To keep backwards compatibility,
FluidViewAdapter now re-implements all these methods, but
deprecates them.

In addition to ext:core ViewInterface, FluidViewAdapter will continue
to implement getRenderingContext(), setRenderingContext() (probably),
renderSection() and renderPartial(). All other methods that are
wrappers around details of RenderingContext are marked @deprecatded.
Systems that need to work with details of Fluid, now need to test
for an instance of FluidViewAdapter to manipulate setRenderingContext
if needed.

This strategy will allow us to phase out ext:fluid StandaloneView and
ext:fluid TemplateView with further patches, which will further
simplify the layer towards Fluid standalone.

Within Extabse, the main view interface is now ext:core ViewInterface,
which free's the dependency to Fluid. JsonView is now the primary
example for a view that has no relation to Fluid anymore.

TYPO3 v14 can continue with hardening various type hints related
to views, those have been marked accordingly.

Note the handling related to ServerRequestInterface will see
some additional patches in this area as well.

Resolves: #101559
Related: #96730
Related: #104463
Releases: main
Change-Id: I4be3e6be191b8bce599523a1055fc6136a86a879
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80329


Tested-by: default avatarSimon Praetorius <simon@praetorius.me>
Reviewed-by: default avatarSimon Praetorius <simon@praetorius.me>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarHannes Lau <office@hanneslau.de>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent f7c533a8
Branches
Tags
Showing
with 395 additions and 80 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment