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: Dispatcher psr overhaul #3311
Draft
mhsdesign
wants to merge
38
commits into
9.0
Choose a base branch
from
feature/dispatcher-returns-psr-responses
base: 9.0
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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
WIP This change needs an accompanying adjustment to Neos to adjust the PluginImplementation as well as Modules. The new `SimpleActionController` gives you a direct and simple way to route an ActionRequest and return an ActionReponse with nothing in between. Routing should work just like with other ActionControllers. This is breaking if you implemented your own ControllerInterface or overwrote or expect some of the api methods of the ActionController. We now use a direct pattern of f(ActionRequest) => ActionResponse in more places. Adjusting existing controllers should be easy though. We discourage to manipulate `$this->reponse` in controllers, although it should still work fine in actions for now, please consider other options.
…er-simplecontroller
Original this method and logic was introduced via: b780118 The previous try catch would still work but mutating `$this->response` AFTER throwing an exception is pretty ugly.
…ler.php Co-authored-by: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com>
…`afterControllerInvocation` The parameter `$response` was removed from the `beforeControllerInvocation` signal, as it would be just always empty at that point and misleading and any mutations would be ignored. The parameter `$response` was made nullable for the `afterControllerInvocation` signal, as it's not set after a `forwardToRequest`. Also, it's to be noted, that modifying the response in an `afterControllerInvocation` is not always going to take effect, for example if the dispatcher is still in the loop.
Explain that the details/exception message dont matter, and set a default.
…stionmark !!! TASK: Separate `ForwardException` from `StopActionException`
Will be split up into an own pr #3297
Will be split up into an own pr #3298
…econtroller !!! FEATURE: WIP Dispatcher and controller return `ActionResponse` (simpler controller pattern)
This was referenced Feb 6, 2024
mhsdesign
changed the title
!!! FEATURE: Dispatcher returns psr responses
!!! FEATURE: Dispatcher psr overhaul
Feb 22, 2024
This will not open a memory stream
`replaceHttpResponse` is unsafe to use and has hard to tell behaviour. Instead, we up-merge the headers explicitly
!!! TASK: Deprecate and replace `ActionResponse` in dispatcher
…urns-psr-responses
Neos passes an object for the node frontend routing: expects array<string, string>, array<string, Neos\Neos\FrontendRouting\NodeAddress> given.
This was referenced Mar 23, 2024
…urns-psr-responses
mhsdesign
force-pushed
the
feature/dispatcher-returns-psr-responses
branch
from
April 24, 2024 18:56
29694c2
to
f4c5479
Compare
mhsdesign
commented
Apr 24, 2024
} | ||
return $parentResponse; | ||
// TODO $response is never _null_ at this point, except a `forwardToRequest` and the `nextRequest` is already dispatched == true, which seems illegal af |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be fixed via #3301
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.
This is the main PR.
Contains: #3232
Contains: #3294
Neos adjustments: neos/neos-development-collection#4738
Todo;
Upgrade instructions
WIP Upgrade notes: #3232 (comment)
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions