-
Notifications
You must be signed in to change notification settings - Fork 0
[Live] add batch action controller #4
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
[Live] add batch action controller #4
Conversation
If this happens only after the request, then the first field that is modified, which then triggers a request will think that it is out-of-sync.
* origin/2.x: Restricting chart.js to 3.8.2 Add missing use statement for LiveCollectionType
$response = null; | ||
|
||
// todo ensure live | ||
// todo check csrf token |
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.
You'll be sending the csrf token, right?
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.
yup - it'll be 1 CSRF token - stored on the header like normal - for the entire request.
'_component_action_args' => $action['args'] ?? [], | ||
'_route' => 'live_component', | ||
]); | ||
// todo - only render on final action |
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.
Thinking to set a _render_component
flag to false
on every subrequest except the final one. In the subscriber, if this flag is set to false, just set the response to new Response()
. Of course, only if the response from the action method is not provided.
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.
Oh, actually, this might not be necessary. We could tell ALL sub-requests to NOT render. Then, the ViewEvent
/ onKernelView()
of our subscriber would trigger for the MAIN request and render the component in its "final" state. The "rendered" version of a component after the final action should === the rendered version on the main request after rendering all of the actions, unless I'm mistaken.
a1379cc
to
a285e2f
Compare
} | ||
|
||
$componentObject = $this->factory->get($component); | ||
$mountedComponent = $this->hydrator->hydrate($componentObject, $data, $component); |
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.
I was expecting all the stuff above this would still live in LiveComponentSubscriber
- and then this controller is called (instead of __invoke()
on the component or a real action method) only to handle the action execution.
a285e2f
to
b4d546d
Compare
49273ce
to
4fbcebe
Compare
# This is the 1st commit message: WIP heavy refactoring to Component Initial "hook" system used to reset model field after re-render Adding a 2nd hook to handle window unloaded reinit polling after re-render Adding Component proxy # This is the commit message #2: fixing some tests # This is the commit message #3: Refactoring loading to a hook # This is the commit message #4: fixing tests # This is the commit message #5: rearranging # This is the commit message #6: Refactoring polling to a separate class
No description provided.