-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! FEATURE: http response support in fusion fusion view #4899
Closed
mhsdesign
wants to merge
18
commits into
neos:9.0
from
mhsdesign:feature/httpResponseSupportInFusionFusionView
Closed
!!! FEATURE: http response support in fusion fusion view #4899
mhsdesign
wants to merge
18
commits into
neos:9.0
from
mhsdesign:feature/httpResponseSupportInFusionFusionView
Conversation
This file contains 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
+ 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
We concluded that it does not make sense to split this up. Will be added to #4856 |
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::renderResponse
the Fusion Runtime will internally handle the specialities ofNeos.Fusion:Http.Message
.Previously when using the
Http.Message
in 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:Plugin
andNeos.Fusion.Form
to only work whenRuntime::renderResponse
is 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|\Stringable
But we violate this by returning the raw runtime value instead, which is
mixed
as it could contain raw arrays or non string-able objects or integers...My idea is to return
ResponseInterface
by default and introduce a flag likereturnMixed
orunsafeRawMode
to 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 totrue
by default which would make it non breaking, but leaves it to the integrators responsibility to set it tofalse
so the mentioned things work.Ideally people using the FusionView should not notice this change as returning a
ResponseInterface
is okay by definition and must (is) accounted by the controllers.As a migration people could either use the propsed unsafe rawmode, or call
getContents
on 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