Closed (fixed)
Project:
JSON:API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jul 2018 at 15:29 UTC
Updated:
12 Oct 2018 at 21:39 UTC
Jump to comment: Most recent
Comments
Comment #2
gabesulliceAdded issue links to summary
Comment #3
gabesulliceSo far, the combined result of this is:
That does NOT include "Remove RequestHandler class and service and add EntityResource methods to each route definition" which will almost certainly be a large net reduction.
Comment #4
wim leersWoaahhhh! Where is this coming from all of a sudden?! I thought we were gonna focus on the bug reports. I guess you got annoyed by it one time too many? :)
(In any case, thanks for splitting up!)
Comment #5
gabesullicePrecisely. This has been on my bucket list for months. But it was blocked by the render context we had in the RequestHandler, which you moved to an event subscriber, and the complexity (perhaps perceived) of
Routes.php, which we already refactored.TBH, this was actually pretty low-effort because it's really just pure refactoring. I spent a few hours over the weekend doing this.. consider it therapeutic refactoring :P
Comment #6
wim leersAhhh, so now you feel empowered to make the change, like you can finally do it! Makes sense. (I made those changes in #2948666: Remove JSON API's use of $context['cacheable_metadata'] + #2984964: JSON API + hook_node_grants() implementations: accessing /jsonapi/node/article as non-admin user results in a cacheability metadata leak.)
I like the sound of the plan. And I like the sound of :D
Am reviewing all child issues!
Comment #7
e0ipsoI don't have a preference either way. My only concern is the complexity uptake of scattering a front controller into services that are not explicitly invoked. Imagine someone wanting to understand the flow of an incoming request.
In any case, I don't have a preference either way.
Comment #8
wim leersI think the purpose here is to decrease complexity. I think it should be in any case, otherwise this is not worth doing.
Can you confirm that, @gabesullice?
Comment #9
gabesullice@Wim Leers. That's definitely my intention!
"Complexity" is probably a bit in the eye of the beholder though, so @e0ipso, I see your point of view. You said that this could "[scatter] a front controller into services that are not explicitly invoked".
You're right that deserialization and parameter resolution will happen before to the controller is called and that's a little magical. But I don't know if I would say it's not explicit. It'll all be declared on the route definition.
In some ways, it'll become more explicit. I.e. the method that actually handles each operation wont be called dynamically through
call_user_function_arrayand the class that handles deserialization could be called something very explicit, likeIncomingEntityDeserializer.Comment #10
gabesulliceI've removed #2987606: Remove config mutation tests from EntityResourceTest from the list of sub-issues. It doesn't need to block this progress. It was just easier to remove the config tests than it was to fiddle with them to make them work again. I ended up doing that anyway in #2987608-8: Move deserialization from RequestHandler to JsonApiParamEnhancer, that means we can just move on with the rest of this issue and remove those tests independently.
Comment #11
gabesulliceFixing some issue summary formatting.
Comment #12
gabesulliceThis let's us start to clean up
EntityResource.Adding #2991841: Remove unused parameters from EntityResource methods.
Comment #13
gabesullice#2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes landed.
Comment #14
gabesulliceFormatting.
Comment #15
wim leers#2987608: Move deserialization from RequestHandler to JsonApiParamEnhancer landed yesterday! #2987610: Remove RequestHandler class and service and add EntityResource methods to each route definition landed today!
That leaves only #2991841: Remove unused parameters from EntityResource methods. :)
Comment #16
gabesullice#2991841: Remove unused parameters from EntityResource methods. landed.
this. is. DONE.