Replies: 0 comments 4 replies
-
I thought about this once. But then didn’t like the idea of having another dependency to work with if I need to make changes, displaying error messages is a pain, reinitalising fields with js, creating custom components will have to work with the js. Debugging errors becomes harder as hidden in network tabs etc, handling session timeouts and expired csrf tokens etc. Is big job to do wel! |
Beta Was this translation helpful? Give feedback.
-
Ugh... You might be right @OwenMelbz - might be better to "keep it simple"... |
Beta Was this translation helpful? Give feedback.
-
I don't know, but this is my understanding of your concerns:
Maybe I am missing the point here, but anyway at first I though this is a good idea. I think user experience will be greatly improved, also resource usage etc. I don't expect this to be a straight foward change, but I see it as an improvement. |
Beta Was this translation helpful? Give feedback.
-
I agree the end user experience could be better, but I believe one of the fundamental features of backpack is that it is an easy development tool, which newcomers can adopt. When I said error messages, I meant general debugging eg if there’s a stack trace displaying on the webpage people won’t see it and maybe confuse less experienced. Custom components - this is assuming that people are making the components “compatible” for example we used to create mostly custom components in Vue. These components would take properties from the blade files, and would take validation errors from the $errors variable in blade. By moving the form to JS it means that those components will need to adhere to your specific way of doing things. Eg if Ajax errors come back, you’ll need your custom JS to then handle from JavaScript rather than blade. Which again just makes it harder for new comers. Csrf and session timeouts can happen yeah, but it again just goes back to the it’s harder for newcomers. They will then need to learn how your JavaScript layer works as well as the laravel layer, eg do you offer a “login prompt” if it expires on JS? If so, what about users that do not use passwords to login, and use socialite, you need to make the user flow work with both of these. So in summary, yes it would be nice for the end user (maybe? Not sure what qualifies it as being nicer? What benefit does the user actually get?) But this would come at the price of added complexity, which could increase entry hurdles for new Devs. So those would just be some considerations :) |
Beta Was this translation helpful? Give feedback.
-
Save/Update forms submit AJAX, so there's only one validation (PHP, in FormRequest), but the page does not refresh at all.
Beta Was this translation helpful? Give feedback.
All reactions