Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The State of Fluid (2025)

The State of Fluid (2025)

Fluid is at the heart of nearly every TYPO3 project, but its development often flies under the radar. This talk from TYPO3 Developer Days 2025 explores the new features that have landed in Fluid and takes a glimpse at what's next for TYPO3's templating language.

https://t3dd.typo3.com/schedule/sessions/the-state-of-fluid-whats-new-and-whats-next-976

#typo3 #t3dd25

Avatar for Simon Praetorius

Simon Praetorius

August 08, 2025
Tweet

More Decks by Simon Praetorius

Other Decks in Programming

Transcript

  1. Fluid Maintainer Team Vite Integration for TYPO3 13 years in

    TYPO3 agencies independent since 2023 Simon Praetorius
  2. Simon Praetorius The State of Fluid – Practical Fluid New

    ViewHelpers ✦ <f:constant> ✦ <f:first> and <f:last> ✦ <f:join> and <f:split> ✦ <f:replace> ✦ TYPO3 ViewHelpers moved to Fluid Standalone Fluid 2
  3. Simon Praetorius The State of Fluid – Practical Fluid New

    ViewHelpers ✦ <f:flatten> ✦ <f:shuffle> ✦ more to come … Fluid 4
  4. Simon Praetorius The State of Fluid – Practical Fluid Arbitrary

    Arguments Fluid 2 <f:for m .textfield name="zipcode" additionalAttributes="{ pattern: '^[0-9]{5} $ ' }" />
  5. Simon Praetorius The State of Fluid – Practical Fluid Arbitrary

    Arguments Fluid 2 <f:for m .textfield name="zipcode" pattern="^[0-9]{5} $ " />
  6. Simon Praetorius The State of Fluid – Practical Fluid Boolean

    Arguments Fluid 4 <f:for m .textfield name="zipcode" readonly="{isReadonly}" />
  7. Simon Praetorius The State of Fluid – Practical Fluid Boolean

    Literals Fluid 4 <f:for m .textfield name="zipcode" readonly="{true}" />
  8. Simon Praetorius The State of Fluid – Practical Fluid Access

    Condition Result Fluid 4 <f:variable name="userIsAuthenticated" value="{f:security.ifAuthenticated()}" />
  9. Simon Praetorius The State of Fluid – Practical Fluid Access

    Condition Result Fluid 4 <f:variable name="isValidAddress" value="{f:if(condition: '{street} && {city}')}" />
  10. Simon Praetorius The State of Fluid – Practical Fluid Access

    Condition Result Fluid 4 <f:for m .textfield name="vat" readonly="{f:if(condition: '!{company}')}" />
  11. Simon Praetorius The State of Fluid – Practical Fluid renderStatic()

    ✦ unified ViewHelper API ✦ less boilerplate ✦ Dependency Injection ✦ stops working in ✦ Rector rule available Fluid 2 Fluid 5
  12. Simon Praetorius The State of Fluid – Practical Fluid Ignore

    Errors in Comments <f:comment> <f:undefinedViewHelper /> <f:viewHelperLeftOpen> </f:comment> Fluid 4 🥳
  13. Simon Praetorius The State of Fluid – Reusable Fluid Define

    Partial API Fluid 4 <f:argument name="title" type="string" /> <f:argument name="tags" type="string[]" optional="{true}" /> <f:argument name="user" type="string" optional="{true}" default="ad mi n" />
  14. Simon Praetorius The State of Fluid – Reusable Fluid ✦

    strong defaults: arguments required by default ✦ strict validation: exception for missing arguments & wrong types ✦ progressive enhancement: no exceptions for undefined arguments Define Partial API Fluid 4
  15. Simon Praetorius The State of Fluid – Reusable Fluid Definition:

    TeaserCard.html <f:argument name="title" type="string" /> <f:argument name="link" type="string" /> <f:argument name="icon" type="string" optional="{true}" /> <div class="teaserCard"> . <f:slot /> Fluid 4 API implementation
  16. Simon Praetorius The State of Fluid – Reusable Fluid Usage:

    MyTemplate.html <my:teaserCard title="TYPO3" link="https: // typo3.org" icon="typo3" > the Professional, Flexible Content Management System </my:teaserCard> Fluid 4 slot content
  17. Simon Praetorius The State of Fluid – Reusable Fluid ✦

    code reuse: no partialRootPaths configuration ✦ visual consistency: define markup once ✦ encapsulation: strict API enables refactoring ✦ separation of integration & frontend Why Components? Fluid 4
  18. Simon Praetorius The State of Fluid – Reusable Fluid ComponentCollection

    Fluid 4 <my:teaserCard title="TYPO3" link="https: // typo3.org" icon="typo3" > the Professional, Flexible Content Management System </my:teaserCard>
  19. Simon Praetorius The State of Fluid – Reusable Fluid ComponentCollection

    Fluid 4 <h t ml data-namespace-typo3-fluid="true" x ml ns:my="http: // typo3.org/ns/Vendor/Sitepackage/ Components/ComponentCollection" > <my:teaserCard title="TYPO3" actual class!
  20. Simon Praetorius The State of Fluid – Reusable Fluid ComponentCollection

    Fluid 4 namespace Vendor\Sitepackage\Components; use TYPO3Fluid\Fluid\Core\Component\AbstractComponentCollection; # [Autoconfigure(public: true)] class ComponentCollection extends AbstractComponentCollection { }
  21. Simon Praetorius The State of Fluid – Reusable Fluid ComponentCollection

    Fluid 4 public function ge t T emplatePaths(): TemplatePaths { $t emplatePaths = new TemplatePaths(); $t emplatePaths->se tT emplateRootPaths([ ExtensionManagementUtility::extPath( 'sitepackage', 'Resources/Private/Components', ), ]); return $t emplatePaths; }
  22. Simon Praetorius The State of Fluid – Reusable Fluid ✦

    Integration: Templates, Layouts & Partials ✦ Frontend: Components ✦ Public Extensions: (mostly) Templates, Layouts & Partials PSR-14 events in ComponentCollection Templates vs. Components
  23. Simon Praetorius The State of Fluid – Reusable Fluid ✦

    component API ≠ TYPO3 data structure ✦ prefer “atomic” types: DateT i m eInterface, FileInterface, TypolinkParameter ✦ avoid optional arguments API Design Domain\Model\Product Record
  24. Simon Praetorius The State of Fluid – Reusable Fluid ✦

    no <f:format.raw> inside components ✦ use <f:format.h t ml > / <f:transfor m .h tml > outside components ✦ multiple slots possible: named slots Slots
  25. Simon Praetorius The State of Fluid – Reusable Fluid Named

    Slots Fluid 4 <div class=" tw oColumns"> <div class="col"> <f:slot name="column1" /> </div> <div class="col"> <f:slot name="column2" /> </div> </div>
  26. Simon Praetorius The State of Fluid – Reusable Fluid Named

    Slots Fluid 4 <my: tw oColumns> <f:fragment name="column1"> <b>content 1</b> </f:fragment> <f:fragment name="column2"> <i>content 2</i> </f:fragment> </my: t w oColumns>
  27. Simon Praetorius The State of Fluid – Reusable Fluid Components

    / Molecule / Slider / ✦ Slider.html ✦ Slider.css ✦ Slider.js ✦ Slider.labels.xlf Asset Co-Location bundle with frontend toolchain
  28. Simon Praetorius The State of Fluid – Flexible Fluid ViewFactory

    TYPO3 13 ✦ new StandaloneVie w () ✦ new TemplateVie w () ✦ goal: replaceable views via Dependency Injection
  29. Simon Praetorius The State of Fluid – Flexible Fluid ViewFactory

    TYPO3 13 use TYPO3\C M S \Core\View\Vie wF actoryInterface; public function __construct( private readonly Vie wF actoryInterface $v ie w F actory, ) {}
  30. Simon Praetorius The State of Fluid – Flexible Fluid ViewFactory

    TYPO3 13 $v ie wF actoryData = new Vie wF actoryData( templateRootPaths: ['EXT:myExt/Resources/Private/Templates'], partialRootPaths: ['EXT:myExt/Resources/Private/Partials'], layoutRootPaths: ['EXT:myExt/Resources/Private/Layouts'], request: $request, ); $v iew = $t his->vie w F actory->create( $v ie wF actoryData);
  31. Simon Praetorius The State of Fluid – Flexible Fluid ViewFactory

    TYPO3 13 $v iew->assign('myData', 'myData'); $result = $v iew->render('path/to/template');
  32. Simon Praetorius The State of Fluid – Flexible Fluid Replacing

    a View TYPO3 13 Vendor\SomeExtension\Service\SomeService: arguments: $v ie wF actory: '@Praetorius\Sitepackage\View\MyVie wF actory'
  33. Simon Praetorius The State of Fluid – Flexible Fluid ✦

    API behind components implementation ✦ take control of ViewHelper namespace (instead of just one ViewHelper) ✦ extension opportunities ✦ connect external component libraries (Mustache, Twig, …) ViewHelperResolver Delegates Fluid 4 ✨
  34. Simon Praetorius The State of Fluid What’s Next? Fluid 5

    ✦ straightforward cache warmup ✦ deprecation checker ✦ improved ViewHelper argument validation ✦ refactoring & cleanup
  35. Simon Praetorius The State of Fluid Takeaways ✦ improved ViewHelpers

    ✦ API for partials ✦ components ✦ create & replace views in TYPO3 ✦ extension opportunities with new Fluid APIs