74435[!!!][FEATURE] Add PSR-14 IncludeStaticTypoScriptSources events
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 10
- typo3/sysext/core/Classes/Event/IncludeStaticTypoScriptSourcesBeforeEvent.php9new+55 −0
- typo3/sysext/core/Classes/Event/IncludeStaticTypoScriptSourcesEndEvent.php8new+43 −0
- typo3/sysext/core/Classes/TypoScript/TemplateService.php8+17 −22
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97210-TypesAddedToMethodSignaturesOrClassProperties.rst+1 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97453-RemovedStaticTypoScriptSourcesHooks.rstnew+35 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst7new+51 −0
- typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php+4 −1
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php2+11 −31
- typo3/sysext/frontend/Tests/Unit/Fixtures/NoopEventDispatcher.phpnew+34 −0
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php+12 −0
Review log 1520
-
crell uploaded patch set 1 04/26/22, 17:54
-
crell uploaded patch set 2 04/26/22, 17:55
-
core-ci voted on patch set 2 V -1 04/26/22, 18:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26465
-
core-ci voted on patch set 1 V -1 04/26/22, 18:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26464
-
crell uploaded patch set 3 04/26/22, 20:58
-
core-ci voted on patch set 3 V +1 04/26/22, 21:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26482
-
Stefan Bürk commented on patch set 3 04/27/22, 01:42
IncludeStaticTypoScriptSourcesBeforeEvent.php:26UnresolvedCore way for events are protected/private properties and providing corresponding getter/setters for the properties (setters only if needed to be set by event listeners). This is also valid if CPP is used. Do not add them as public properties. Please change accordingly.IncludeStaticTypoScriptSourcesEndEvent.php:7Events in core are final. Should be added.IncludeStaticTypoScriptSourcesEndEvent.php:21UnresolvedCore way for events are protected/private properties and providing corresponding getter/setters for the properties (setters only if needed to be set by event listeners). This is also valid if CPP is used. Do not add them as public properties. Please change accordingly.TemplateService.php:710Sounds little bit weired. Do you think we can use here something which really describes that this is before including static typo script sources - and let it not sounding like "before event" ? Would would you say to "BeforeIncludeStaticTypoScriptSourcesEvent" ?TemplateService.php:770UnresolvedSounds little bit weired. Do you think we can use here something which really describes that this is before including static typo script sources - and let it not sounding like "end event" ? Additionally, can we considir to use at least "after" instead of "end" ? Thinking of, old hook way using "pre" for before and "post" for after sounds more familar - what do you think ? Given the old used "hook" names, this shoudl be at least IncludeStaticTypoScriptSourcesAtEndEventFeature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:22Seems likly odd ...ContentObjectRendererTest.php:170Don't you think this variable name may be missleading if only reading the latest usage in the method ? Maybe we should name it more clearly as $noopEventDispatcher, would this be fine with you ?NoopEventDispatcher.php:9Please add a little description. The code is mainly "useless" if not explained that this may or can be used in unit tests as noop event dispatcher mock or anon classes. Let it now here - but would have been nice to introduce this in a dedicated pre-patch and self contained. Instead of a silent unexplained side-kick. -
Mathias Brodala commented on patch set 3 04/27/22, 06:51
IncludeStaticTypoScriptSourcesBeforeEvent.php:7How about BeforeStaticTypoScriptIncludesEvent?IncludeStaticTypoScriptSourcesEndEvent.php:7UnresolvedHow about AfterStaticTypoScriptIncludesEvent? -
Oli Bartsch commented on patch set 3 CR -1 04/27/22, 10:24
IncludeStaticTypoScriptSourcesBeforeEvent.php:4Copyright comment missingIncludeStaticTypoScriptSourcesBeforeEvent.php:6Class comment missingIncludeStaticTypoScriptSourcesEndEvent.php:4Copyright comment missingIncludeStaticTypoScriptSourcesEndEvent.php:6Class comment missingTemplateService.php:708UnresolvedSince TemplateService is public, such change might be breaking and should therefore be documented.TemplateService.php:712UnresolvedCore Events usually use getters to access the (modified) properties.TemplateService.php:770UnresolvedThis event seems to be quite useless now. The (modified) properties are never used and the TemplateService instance is no longer available by the subscribers.Feature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:4This seems to be not the correct title.Feature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:18UnresolvedThis rst currently does not describe a new feature. Readers will not know what they can do and how. So let's elaborate the purpose of those events and also name the available properties/methods.Feature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:41Could we please add an example usage here. "Somehow" sounds like we do not know what to do with this event ourselfs. Additionally two events are added, which should both be described here.NoopEventDispatcher.php:4Copyright comment missingNoopEventDispatcher.php:5Could we move this into some fixture namespace? -
crell commented on patch set 3 04/27/22, 18:32
IncludeStaticTypoScriptSourcesBeforeEvent.php:4ReplyAckIncludeStaticTypoScriptSourcesBeforeEvent.php:6ReplyAckIncludeStaticTypoScriptSourcesBeforeEvent.php:7ReplyDoneIncludeStaticTypoScriptSourcesBeforeEvent.php:7Reply UnresolvedNo strong preference. I was going for something that most closely matched the old hook name while still being reasonably descriptive. I'm good with whatever the consensus is.IncludeStaticTypoScriptSourcesEndEvent.php:4ReplyDoneIncludeStaticTypoScriptSourcesEndEvent.php:6ReplyDoneIncludeStaticTypoScriptSourcesEndEvent.php:7ReplyDoneFeature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:4ReplyGr. Git screw up I didn't catch. Thanks.Feature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:22ReplyDoneFeature-97453-PSR-14EventForIncludingStaticTypoScriptSources.rst:41Reply UnresolvedTo be honest, I don't fully understand what those hooks were doing as core has no examples that I found. I welcome feedback here because I'm not sure what you're supposed to do with them. The events should be a direct 1-1 replacement.ContentObjectRendererTest.php:170ReplyEh, no strong feeling either way, other than the tendency in core to err too far on the side of super-long variable names. :-) How about $mockDispatcher?NoopEventDispatcher.php:4ReplyDoneNoopEventDispatcher.php:5ReplyIt didn't really seem like a Fixture, but I checked and the only thing in the Unit/Fixtures directory right now is also a mock like this, it looks like, so, meh. I'll move it in there.NoopEventDispatcher.php:9ReplyDone -
crell uploaded patch set 4 04/27/22, 18:32
-
core-ci voted on patch set 4 V +1 04/27/22, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26534
-
Simon Schaufelberger commented on patch set 4 04/28/22, 01:03
TemplateService.php:288please keep the order of the method parameters with the assigned variables -
crell commented on patch set 4 04/28/22, 13:53
TemplateService.php:288ReplyDoneTemplateService.php:710Reply UnresolvedAs above, I don't have a strong feeling about the names here so I'm good with whatever; I don't fully understand what these hooks in particular were for or what you'd do with them, so it's hard to have an opinion on the matter. What are these hooks used for in practice? Both the names and the event class API should reflect that. -
crell uploaded patch set 5 04/28/22, 13:55
-
Christian Kuhn commented on patch set 5 CR -2 04/28/22, 14:00
Please don't fiddle with TemplateService and it's hooks at the moment: I'm rewriting the parser and the include logic entirely and will add more suitable events along the way. -
Christian Kuhn commented on patch set 5 04/28/22, 14:03
Reply Unresolved
see https://review.typo3.org/c/Packages/TYPO3.CMS/+/74285 for progress on this: i'm currently modeling the include strategy as an object tree and i'll break the three hooks inside TemplateService along the way, while adding (at leas one) event that allows manipulation of includes in a general better way. -
core-ci voted on patch set 5 V +1 04/28/22, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26599
-
Christian Kuhn commented on patch set 5 05/22/22, 07:26
hey. i hope it's ok to abandon this one for now: my ts-parser-rewrite is in still flow and this patch does not help us at the moment since the new implementation will break the hooks anyways. -
Christian Kuhn abandoned the change 05/22/22, 07:26
IncludeStaticTypoScriptSourcesBeforeEvent.php:7