-
-
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: Introduce routingArguments
and queryParameters
to Fusion link prototypes to eventually replace arguments
and additionalParams
#3914
base: 8.4
Are you sure you want to change the base?
Conversation
5911f45
to
a707730
Compare
Not entirely sure wether the appending of queryParameters via
is already the best way. |
thx for that clean up !!! yummi pass by reference 😄 but there seems no better way - other than have some flow uri helper. |
Played with Guzzle/Psr7/Query::parse and build but those do not work well with nested parameters |
hmm okay but in that case this is even more complex behavior. Sorry to suggest that (as nobody likes the current fusion tests) but we need to test a bit... |
711a525
to
b34016a
Compare
@mhsdesign added tests for the actionUriImplementation ... i would like to discuss the following questions
|
b34016a
to
60303de
Compare
i think one should not be allowed to use the new option side by side: this should throw an exception to be on the safe side ;) eg - either new or old would be my guess |
60303de
to
a74bcfb
Compare
@bwaidelich as sidenote: Since adding parameters to an existing url is not that comfortable i now think that the future solution should still have a way to define queryParameters directly. |
e3c1bf5
to
bf22d06
Compare
I push this back to in progress... we need to rebase to 8.3 and resolve the conflict. But guess we will be back soonish in in review ;) |
e161315
to
9f1fec7
Compare
7f87e79
to
a77f6ef
Compare
… link prototypes to replace `arguments` and `additionalParams` The Fusion prototype `Neos.Fusion:ActionUri` has two additional properties: - :routingArguments: (array) That are handled by the router - :queryParameters: (array) Query parameters that are appended after routing Those will eventually replace the properties `arguments` and `additionalParams` which are deprecated and will be removed with Neos 9. The Fusion prototypes `Neos.Fusion:NodeUri` and `Neos.Fusion:NodeLink` have one additional property: - :queryParameters: (array) Query parameters that are appended after routing This will eventually replace the property `additionalParams` which is deprecated and will be removed with Neos 9. Also this pr deprecates the fusion properties `addQueryString` and `argumentsToBeExcludedFromQueryString` from the `Neos.Fusion:ActionUri`, `Neos.Neos:NodeUri`, and `Neos.Neos:NodeLink`.
a77f6ef
to
9f8bd9a
Compare
I think its a bit hard to process in my head what should happen in certain cases when both arguments of the deprecated and new api are used. How about before evaluation we check if the combination is valid? Basically what we already did with: This is based on the assumption, that you dont need to use the legacy api anymore but can rewrite the behavior always with the new api ... |
@mhsdesign the weirdness is in the handling of the "additionalParams" that are passed to "$uriBuilder->setArguments" here https://github.com/neos/neos-development-collection/pull/3914/files#diff-d87939b0060650e9ffd72fdde486f702f8b668a35673f74b5eaa49243c5804caL172-L175 We could throw an exception when "additionalParams" are used together with "queryParameters" but since this is not needed for this to work i would only deprecate this now. The other deprecations |
if (empty($queryParameters)) { | ||
return $uriString; | ||
} | ||
$uri = new Uri($uriString); |
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.
That would look great in a flow uri utility or service, but I know the hassle since it’s in another repo… it might be enough time to pull it up (and you have my +1)
Advantage beeign that we can super easily tests this ugly code snippet isolated against all scenarios.
… or we can always later adjust it too (which is more likely a never thought ^^)
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.
Eventually this code will be replaced by an all new action-uri-builder on the flow side. See neos/flow-development-collection#2744 (not finished and still in discussion). Once this is in place ActionUri should be adjusted to use this internally.
In the meantime this pr allows to handle the negative effects of additionalParams ending up in the routingCache and introduces the distinction between routingArguments
and queryParameters
.
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.
Okay i see then its totally fine with inlining this temporarily ;)
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.
FYI now with neos/flow-development-collection#3316 in place we can actually use a proper helper instead ;)
I think this is ready to review again. |
I have a couple of questions, born out of the discussion in the sprint huddle right now, I guess conceptual things that might have been discussed before? argumentsToBeExcludedFromQueryString route encoded strings that should not be part of the route according to the new concept appendExceedingArguments |
Regarding "route encoded strings that should not be part of the route according to the new concept" i do not get how this is affected. Even today one would create a special route with that parameter. Nothing will stop anyone of doing that. Maybe i did not get that point. Regarding |
I think we discussed at the sprint to remove the appendExceeding arguments stuff and co (patterns from typo 3 times) as this will be no longer supported after the overhauled node uri building: #4892 |
Fyi extracted the discussion regarding |
Btw what is the way we would like to promote to access query parameters in fusion? currently documented: vs
the latter, more correct? way is definitely more cumbersome ... |
Those are two different things and IMO we should really make that distinction clear. |
We are mixing two things here, actual (MVC) route parameters and other (http) queryParameters, IMHO the two removed concepts were mostly about other query parameters. So I would putt any query parameter handling outside of the router and thus |
@kitsunet that is why the original suggestion added AppendExceedingArguments would then only be relevant if someone passes stuff to as routingArgument that should be a |
Ype very good! :) |
The only problem i see here is that it kindof implements the Neos side of a change in the Flow behavior that is not yet implemented. Such changes caused trouble in the past so i would rather add |
If and only if everything would be as (i) wish this would be the flow change: neos/flow-development-collection#2744 At its current state it has the flaw of not working for subrequests, but its basically the new uribuilder for flow because its better to start on a blank sheet in this case. (Same what were doing with the new node uri builder #4892) |
Reactivated as the concept of routingArguments and queryParameters is a concept that is already in the new NodeUriBuilder in Neos 9 so this makes sense even when Flow will need a bit more time to implement this aswell. We can optimize this later and use an Improved flow functionality when the old |
…tsAndQueryParametersForUriFusionObjects
routingArguments
and queryParameters
to Fusion link prototypes to replace arguments
and additionalParams
routingArguments
and queryParameters
to Fusion link prototypes to eventually replace arguments
and additionalParams
This reintroduces ```yaml appendExceedingArguments: true ``` for the preview route so that uris could still build via plain fusion or flows `Neos\Flow\Mvc\Routing\UriBuilder` ``` previewAction = Neos.Fusion:ActionUri { request = ${request.mainRequest} package = 'Neos.Neos' controller = 'Frontend\\\Node' action = 'preview' arguments = ${{node: someNodeAddress}} } ``` This was initially reverted via 2c4670c in neos#4892 in effort to get slowly rid of the `appendExceedingArguments` ugliness. But in the Dresden sprint '24 was considered to big of a change for now, especially as there is no alternative to build the uris in fusion without the `queryParameters` option introduced for the `Neos.Fusion:ActionUri` which will only be part of: neos#3914
The Fusion prototype
Neos.Fusion:ActionUri
has two additional properties:Those will eventually replace the properties
arguments
andadditionalParams
which are deprecated and will be removed with Neos 9.The Fusion prototypes
Neos.Fusion:NodeUri
andNeos.Fusion:NodeLink
have one additional property:This will eventually replace the property
additionalParams
which is deprecated and will be removed with Neos 9.Also this pr deprecates the fusion properties
addQueryString
andargumentsToBeExcludedFromQueryString
from theNeos.Fusion:ActionUri
,Neos.Neos:NodeUri
, andNeos.Neos:NodeLink
.Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions