sycamore-rs / sycamore

A library for creating reactive web apps in Rust and WebAssembly
https://sycamore.dev
MIT License
2.88k stars 153 forks source link

Form handling #363

Open pythoneer opened 2 years ago

pythoneer commented 2 years ago

What is the idea on form handling in sycamore? Should there be, at least, a simple way of form handling build into sycamore or is this something that should be fully handled by an external crate?

In the case of "yes there should be, at least a simple way integrated" what should this look like and at which point should this be handed over to an external crate. Currently its a little bit tedious to make a form. And i think forms are quite important for SPA's (at least in the cases i create those, that might be different to others).

So what still counts under this "at least a simple way" under this umbrella? What i needed in the past was mostly:

These are just some of the things that come to my mind right now.

lukechu10 commented 2 years ago

Ergonomic form handling in Sycamore is pretty much non-existent right now. I believe the first step should be to improve the bind:x attribute for DOM nodes to make it easier to retrieve data from inputs. I think however that the form validation logic should be handled by a third party crate so as not to bloat up the main sycamore crate, allow more flexibility, and also allow different approaches instead of a single "official approach".