90714[BUGFIX] Lazily instantiate JavaScriptRenderer
Commit message
Review
-
Code review CR -1
- Benjamin Franzke -1
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 1
Review log 69
-
Helmut Hummel uploaded patch set 1 09/17/25, 20:44
-
core-ci voted on patch set 1 V -1 09/17/25, 20:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85096
-
Helmut Hummel uploaded patch set 2
V -109/17/25, 21:11 -
core-ci voted on patch set 2 V -1 09/17/25, 21:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85098
-
Helmut Hummel uploaded patch set 3
V -109/17/25, 21:48 -
core-ci voted on patch set 3 V +1 09/17/25, 21:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85102
-
Benjamin Franzke commented on patch set 3 CR -1 09/18/25, 06:53
That'll be a great improvement. …but i don't think that means that JavaScriptRenderer needs to be lazy, I actually think that will not solve the problem. The JavaScriptRenderer is used as a registry by other components to park javascript module instructions via `PageRenderer->getJavaScriptRenderer()` (see DashboardController for an example), and therefore theoretically instantiated at any possible time (e.g. by middlewares). That means lazy instantiation can happen before PageRenderer `render()` is called. This will impose problems if the request object is not available by that time, since PageRenderer `render()` was not called yet. I'd instead suggest to change the JavaScriptRenderer when the *actual* PageRenderer change is done (so we can review and discuss less theoretical). The JavaScriptRenderer should be adapted to use a non-request dependant constructor (removing `$handlerUri`) and instead adding required arguments to `render()` and `renderImportMap()`. (We already started to do that with `$sitePath` and we could go on with more requirements once needed.) -
Helmut Hummel commented on patch set 3 09/18/25, 09:17
Reply Unresolved
Hm, sitePath is actually the only request dependency this thing has. For my change, that replaces the getStreamlinedFileName method with a new API that requires a request, but does not replace all PathUtility URL generating methods yet. I will therefore suggest to only remove passing the URI to the JavaScriptRenderer from the PageRenderer and refactor URI generation in JavaScriptRenderer and its child objects once replacing and deprecating the PathUtility calls in core. -
Helmut Hummel abandoned the change 09/18/25, 09:17
Unresolved