!!! FEATURE: http response support in fusion fusion view#4899
Closed
!!! FEATURE: http response support in fusion fusion view#4899
Conversation
+ working legacy layer for manipulating getResponse and accessing getRequest
…s->get('request');`
…o allow setting headers dynamically Instead, the legacy layer > $this->runtime->getControllerContext()->getResponse(); should be continued to be used by fusion forms and fusion plugin impl.
…s->get('request');`
…yControllerContext
Previously the pattern was that the utmost caller of the runtime would unwrap the exception. To simplify this, as the runtime now has a single entry point, we add this behaviour into the runtime.
... to centralise tricking phpstan
This will be discussed separately and not part of the change of the Neos Node `FusionView`
6 tasks
Member
Author
|
We concluded that it does not make sense to split this up. Will be added to #4856 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #4856
With the introduction of
Runtime::renderResponsethe Fusion Runtime will internally handle the specialities ofNeos.Fusion:Http.Message.Previously when using the
Http.Messagein plain fusion it would actually render the http response as string, soHTTP/was part of the content and visible in the dom.As this logic is now encapsulated in
renderResponse, we can easily use it.Additionally the mentioned pr restricts the functionality of
Neos.Neos:PluginandNeos.Fusion.Formto only work whenRuntime::renderResponseis used. So these adjustments are necessary to restore this functionality.But there is a little catch, the current Fusion FusionView behaves incorrect.
The ViewInterface allows to return
string|ActionResponse|ResponseInterface|StreamInterface|\StringableBut we violate this by returning the raw runtime value instead, which is
mixedas it could contain raw arrays or non string-able objects or integers...My idea is to return
ResponseInterfaceby default and introduce a flag likereturnMixedorunsafeRawModeto restore the old "wrong" functionality. By that we empathise that this is not the correct way and it violates the interface. An alternative would be of course to set the flag totrueby default which would make it non breaking, but leaves it to the integrators responsibility to set it tofalseso the mentioned things work.Ideally people using the FusionView should not notice this change as returning a
ResponseInterfaceis okay by definition and must (is) accounted by the controllers.As a migration people could either use the propsed unsafe rawmode, or call
getContentson the response to get a string.Also we need a flag for our own as without the flag a lot of "false" test would fail, when we f.x. try to return directly an array or object from the runtime:
But our tests could easily set that flag to render the mixed output directly, in the cases where needed and for (hopefully) most cases we can use the
ResponseInterface.Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX!!!and have upgrade-instructions