Breaking: #97816 - New TypoScript parser in Frontend
See forge#97816
Description
The rewrite of the TypoScript parser has been enabled for Frontend rendering.
See Breaking: #97816 - TypoScript syntax changes and Feature: #97816 - TypoScript syntax improvements for more details on the new parser.
Impact
The change has impact on Frontend caching, hooks, some classes and properties. In detail:
- Hook
$GLOBALS
is gone and substituted by['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['Core/ Typo Script/ Template Service'] ['run Through Templates Post Processing'] After
. See Feature: #97816 - New AfterTemplatesHaveBeenDeterminedEvent for more details.Templates Have Been Determined Event - The classes
\TYPO3\
andCMS\ Core\ Typo Script\ Template Service \TYPO3\
have been marked as deprecated and shouldn't be used anymore. An instance ofCMS\ Core\ Typo Script\ Parser\ Typo Script Parser Template
is still kept as propertyService Typo
(Script Frontend Controller->tmpl $GLOBALS
TemplateService->setup` is still set. To avoid using these properties, the Frontend request object will contain this state. In rare cases, where extensions need to parse TypoScript on their own, they should switch to the Tokenizer and AstBuilder structures of the new parser. Note these classes are still young and currently marked @internal, the API may still slightly change with further v12 development.['TSFE']->tmpl) as backwards compatible layer, and the most important properties within the class, namely especially : php: - The
pagesection
cache has been removed. This was a helper cache that grew O(n) with the number of called Frontend pages. The newtyposcript
cache is used instead: This grows only O(n) with the number of different sys_template and condition combinations and is a filesystem basedPhp
implementation. When upgrading, the database tablesFrontend cache_
andpagesection cache_
can be safely removed, the install tool will also silently remove any existing entries frompagesections_ tags settings.
that reconfigure the cache.php -
The Frontend rendering changed TypoScript cache behavior slightly, which may have an impact on integrators developing and testing TypoScript in the Frontend. The short version is: When changing
sys_
records, changes have immediate effect, and when changing included TypoScript files, the Frontend browser tab should be reloaded using "shift-reload" or the browser inspector should be opened and the "Disable cache" toggle turned on. Note when changes like this should go live for everyone, Frontend caches must still be cleared using the Backend toolbar "Flush frontend caches" to have an effect on "normal users" without active Backend login.template Some more details on this: Frontend TypoScript in general now uses caches across multiple pages, which increases rendering performance. After calling a first page with empty caches, a second page call to a different page will re-use most, if not all, TypoScript from cache entries created by the first page access.
This has impact on cache invalidation when developing Frontend TypoScript: First, changing
sys_
records always has immediate effect to all requests, even without clearing caches manually. The system detects field changes oftemplate sys_
changes automatically, reloading a page in the Frontend will trigger re-calculation of TypoScript and thus re-rendering of the page. Note this is only true for directly loadedtemplate sys_
records. Changes on records included indirectly via the relatively seldom usedtemplate based
field are not detected automatically, and the same systematics as outlined below for file includes kicks in.On The cache behavior is slightly different for files included using
@import
,<INCLUDE_
and forTYPOSCRIPT: ... sys_
records included using thetemplate based
field. To suppress expensive filesystem calls in production, the cache layer for included files is more aggressive and does not automatically trigger Frontend page re-rendering when included TypoScript files are changed. There are however some ways to easily work around this as an integrator: When a backend user is logged in, a Frontend call recognizes this since various functionality is bound to logged in Backend users in the Frontend, most notably the ability to preview hidden pages or hidden content, and the admin panel functionality. When changing Frontend TypoScript in included files, being logged in with a Backend user, and then pressing "shift-reload" for the Frontend page, this will trigger "no cache", which forces content re-rendering including TypoScript re-calculation. Additionally, the "Browser Inspectors" in Chrome and Firefox both have a "Disable cache" toggle, which sends the same HTTP header as done with "shift-reload", which will also force re-rendering. Note integrators should still "Flush frontend caches" when changes in included TypoScript files should go-live for all other Frontend requests and thus "normal users" as well.On -
The following properties and methods in
Typo
have been set toScript Frontend Controller @internal
and should not be used any longer since they may vanish without further notice:Typo
Script Frontend Controller->no_ cache Typo
Script Frontend Controller->tmpl Typo
Script Frontend Controller->page Content Was Loaded From Cache Typo
Script Frontend Controller->get From Cache_ query Row () Typo
Script Frontend Controller->populate Page Data From Cache () Typo
Script Frontend Controller->should Acquire Cache Data () Typo
Script Frontend Controller->acquire Lock () Typo
Script Frontend Controller->release Lock ()
-
The following methods in
Typo
have been removed:Script Frontend Controller Typo
Script Frontend Controller->get Hash () Typo
Script Frontend Controller->get Lock Hash () Typo
Script Frontend Controller->get Config Array () Typo
Script Frontend Controller-> ()
Affected installations
Many instances will only recognize that the pagesection
cache is gone and should continue to work.
Instances with extensions that use Template
or Typo
, or access the
property Typo
may need adaptions.
Migration
See the impact description above for some migration hints.