Feature #91715
closedMake new AssetCollector class searchable
100%
Description
Sometimes the generation of inline code is quite heavy and one wants to avoid doing it multiple times. In my opinion, the class "TYPO3\CMS\Core\Page\AssetCollector" from TYPO3 10+ should have methods to query the internal status of the class.
The existence of a generated inline JavaScript could be asked by using a hypothetical "hasInlineJavaScript(string $identifier): bool" method, thus avoiding to generate it again when used multiple times during the same request.
An analog method "getInlineJavaScript" could also be of some use, but I still didn't found any advantage for it.
Possible implementation of proposed methods:
public function hasInlineJavaScript(string $identifier): bool
{
return isset($this->inlineJavaScripts[$identifier]);
}
public function getInlineJavaScript(string $identifier): ?array
{
return $this->inlineJavaScripts[$identifier] ?? null;
}
Updated by Susanne Moog over 2 years ago
- Complexity changed from no-brainer to easy
Updated by Gerrit Code Review over 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Gerrit Code Review over 2 years ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74162
Updated by Shehfinaz Kadavil over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4fe605f75ba36b7bc9c51114fa449cd643907444.