From 559905ebb39a6150ec91478cbea26bdfd24a6177 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Wed, 15 Apr 2020 23:07:23 +0200 Subject: [PATCH] [TASK] Mark various functionality in TSFE internal Some code related to templating / cached TypoScript, inclusion of CSS/JS and internals like "indexedDocTitle" which has now a proper PageTitle API, is marked as internal now, so further refactorings can happen in the next major release. As all replacements are in place for this functionality, extension authors can and should already use new APIs instead of relying on TSFE for this logic. Resolves: #91079 Releases: master Change-Id: Ic24c607dd620d1cfe7966484d5272491aa5f429a Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64199 Tested-by: Susanne Moog <look@susi.dev> Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Susanne Moog <look@susi.dev> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> --- ...tendRendererFunctionalityIsNowInternal.rst | 47 +++++++++++++++++++ .../TypoScriptFrontendController.php | 9 ++++ 2 files changed, 56 insertions(+) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Important-91079-VariousTypoScriptFrontendRendererFunctionalityIsNowInternal.rst diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-91079-VariousTypoScriptFrontendRendererFunctionalityIsNowInternal.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-91079-VariousTypoScriptFrontendRendererFunctionalityIsNowInternal.rst new file mode 100644 index 000000000000..c0681bfcc9d7 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Important-91079-VariousTypoScriptFrontendRendererFunctionalityIsNowInternal.rst @@ -0,0 +1,47 @@ +.. include:: ../../Includes.txt + +==================================================================================== +Important: #91079 - Various TypoScriptFrontendRenderer functionality is now internal +==================================================================================== + +See :issue:`91079` + +Description +=========== + +TypoScriptFrontendController has methods and properties which +are marked as "@internal" in TYPO3 v10. + +They are still used in TYPO3 v10 from within TYPO3 Core, but +extension authors should use the actual APIs directly. + +The properties + +* :php:`TypoScriptFrontendController->sPre` +* :php:`TypoScriptFrontendController->pSetup` +* :php:`TypoScriptFrontendController->all` + +are related to unpacking TypoScript details related +to a page object in TypoScript and to its caching part, +this is now officially marked as internal - if needed, +TemplateService should be queried directly. These properties +will likely be removed in future TYPO3 versions, in order to +decouple TypoScript Parsing from the global `TSFE` object. + +The properties + +* :php:`TypoScriptFrontendController->additionalJavaScript` +* :php:`TypoScriptFrontendController->additionalCSS` +* :php:`TypoScriptFrontendController->JSCode` +* :php:`TypoScriptFrontendController->inlineJS` + +and the method :php:`TypoScriptFrontendController->setJS()` are +marked as internal. The AssetCollector API and the PageRenderer +can be used instead, and TYPO3 Core will move towards these +APIs completely internally. + +The property :php:`TypoScriptFrontendController->indexedDocTitle` +is now marked as internal as the PageTitle API is in place since +TYPO3 v9 LTS. + +.. index:: Frontend, ext:frontend \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index fa5862ef914d..a063b2cd6c91 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -308,12 +308,14 @@ class TypoScriptFrontendController implements LoggerAwareInterface * the template. If $this->all is empty it's because the template-data is not * cached, which it must be. * @var array + * @internal */ public $all = []; /** * Toplevel - objArrayName, eg 'page' * @var string + * @internal should only be used by TYPO3 Core */ public $sPre = ''; @@ -321,6 +323,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * TypoScript configuration of the page-object pointed to by sPre. * $this->tmpl->setup[$this->sPre.'.'] * @var array|string + * @internal should only be used by TYPO3 Core */ public $pSetup = ''; @@ -390,6 +393,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * additionalHeaderData. Reserved keys at 'openPic' and 'mouseOver' * * @var array + * @internal only used by TYPO3 Core, use AssetCollector or PageRenderer to add JavaScript */ public $additionalJavaScript = []; @@ -397,16 +401,19 @@ class TypoScriptFrontendController implements LoggerAwareInterface * Used to accumulate additional Style code. Works like additionalHeaderData. * * @var array + * @internal only used by TYPO3 Core, use AssetCollector or PageRenderer to add CSS */ public $additionalCSS = []; /** * @var string + * @internal only used by TYPO3 Core, use AssetCollector or PageRenderer to add inline JavaScript */ public $JSCode; /** * @var string + * @internal only used by TYPO3 Core, use AssetCollector or PageRenderer to add inline JavaScript */ public $inlineJS; @@ -583,6 +590,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * This value will be used as the title for the page in the indexer (if * indexing happens) * @var string + * @internal only used by TYPO3 Core, use PageTitle API instead. */ public $indexedDocTitle = ''; @@ -3499,6 +3507,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * @param string $key is the key in the array, for num-key let the value be empty. Note reserved key: 'openPic' * @param string $content is the content if you want any * @see ContentObjectRenderer::imageLinkWrap() + * @internal only used by TYPO3 Core, use PageRenderer or AssetCollector API instead. */ public function setJS($key, $content = '') { -- GitLab