81078[TASK] Have an event to modify constants AST in FE
Commit message
Review
-
Code review CR +2 Done
- Andreas Kienast +2
- Christian Kuhn +1
-
Verified V +2 Done
- Andreas Kienast +2
- Julian Mair +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2431
Show 46 earlier messages
-
Julian Mair uploaded patch set 1 09/19/23, 07:51
-
Georg Ringer commented on patch set 1 09/19/23, 07:56
this is clearly a feature but I would be fine to backport that to 12. however it needs a feature rst! -
core-ci voted on patch set 1 V +1 09/19/23, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46735
-
Julian Mair uploaded patch set 2
V +109/19/23, 09:07 -
Julian Mair commented on patch set 2 09/19/23, 09:08
Reply
done -
core-ci voted on patch set 2 V +1 09/19/23, 09:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46744
-
Christian Kuhn commented on patch set 2 CR -1 09/19/23, 14:59
will review somewhere next days. we also may want to mark this event @internal or slightly move it around a bit. -
Benni Mack commented on patch set 2 09/19/23, 15:00
I personally think this is the wrong spot to deal with flattened constants, as this would only affect TSFE / Frontend. -
Stefan Bürk commented on patch set 2 09/19/23, 16:29
Feature-101752-IntroduceNewEventForAlteringTypoScriptConstants.rst:17We usually add a example event-listener implementation for a introduced event. Therefore, a example should be added here too. Beside this, the example can be used to verify this change and the new event. -
Stefan Bürk commented on patch set 2 09/19/23, 16:29
Feature-101752-IntroduceNewEventForAlteringTypoScriptConstants.rst:17ReplyAfter deciding if the event is okay and in the right place. -
Julian Mair uploaded patch set 3
CR -1V +109/21/23, 08:55 -
Julian Mair commented on patch set 3 09/21/23, 09:00
Reply
AckReply
your right, i didn't think that through ... in that case, I'm have no idea where the right spot for this event isFeature-101752-IntroduceNewEventForAlteringTypoScriptConstants.rst:17ReplyDone -
core-ci voted on patch set 3 V +1 09/21/23, 09:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46989
-
Jörg Bösche voted on patch set 3 CR +1 10/27/23, 07:30
-
Chris Müller commented on patch set 3 10/27/23, 08:22
Feature-101752-IntroduceNewEventForAlteringTypoScriptConstants.rst:48The event as argument is superfluous, as it is evaluated via reflection on compile time due to the type declaration. But the identifier is missing (although this is not required). I also suggest to move the attribute to the class level to be in line with all other changelogs. -
Christian Kuhn commented on patch set 3 CR -1 10/27/23, 17:15
working on it.TypoScriptFrontendController.php:1158i think an event listener should work on the AST and not flatConstants. -
Christian Kuhn uploaded patch set 4
CR +1V +110/27/23, 17:48 -
Christian Kuhn commented on patch set 4 10/27/23, 17:49
Feature-101752-IntroduceNewEventForAlteringTypoScriptConstants.rst:48Replyi removed the ReST file. see commit message.TypoScriptFrontendController.php:1158ReplyDone -
Christian Kuhn updated the commit message in patch set 5 10/27/23, 17:52
-
Christian Kuhn updated the commit message in patch set 6 10/27/23, 17:54
-
core-ci voted on patch set 4 V -1 10/27/23, 17:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48306
-
Christian Kuhn uploaded patch set 7 10/27/23, 18:01
-
core-ci voted on patch set 6 V -1 10/27/23, 18:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48308
-
core-ci voted on patch set 5 V -1 10/27/23, 18:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48307
-
core-ci voted on patch set 7 V +1 10/27/23, 18:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48309
-
Christian Kuhn commented on patch set 7 10/27/23, 18:23
Note: this is still a bit fiddly. Event consumers now need to understand and change the AST. The proposed solution from earlier patches did hand over 'flat constants' instead, which I think is much more brittle, so I went with the AST instead. Additionally, 'flat constants' in not a cool construct, it's more a tribute to quick constant substitution lookups later, and I'm still thinking about different solutions for this. As such, I think the 'AST' solution is more stable mid-term, while the 'flat constants' solution uses an internal structure that may eventually vanish altogether. -
Julian Mair commented on patch set 7 V +1 10/30/23, 08:29
Thanks, this solution works perfectly! However, I hope that this Event won't just quietly disappear in a bugfix version. Instead, we should have at least a few months or perhaps wait for a major Typo3 version to react and adapt to such changes. -
Christian Kuhn commented on patch set 7 V +1 CR +1 10/31/23, 15:16
Hey. For the lifetime of this event: I'd estimate at the moment that this event won't just vanish at least in v13. Maybe internals of AST may change, but we'll see. Julian. In case you get something up and running regarding a 'nested constants' solution, it would be really if that could be documented somehow, for instance by adding a comment to the forge issue linking some code or repository or pasting the main code or something like that. This could help others looking for some solution. I'll vote this up now and will see if we can manage to get it merged. -
Julian Mair commented on patch set 7 11/02/23, 14:39
Reply
Regarding the lifetime: That sounds promising. And IMHO by adhering to Interfaces, we can potentially avoid significant breaking changes... As for documentation, I've uploaded an extension to GitHub and Packagist at https://packagist.org/packages/m41r/nested-typoscript-constants and noted the solution into the forge issue https://forge.typo3.org/issues/101752 -
Andreas Kienast voted on patch set 7 V +2 CR +2 11/02/23, 15:00
-
Andreas Kienast merged patch set 8 11/02/23, 15:00