[openstreetmap/openstreetmap-website] WIP: simple_form (#2655)
notifications at github.com
Sun Jun 21 06:16:16 UTC 2020
Hi Andy, I hope this helps and is useful.
I don't think simple_form is a bad option; I just don't think it's the best option out there anymore. There was a time, when they where the only good option to quickly build nice forms in rails (and they still hold that image/brand), but today there are more specialized options.
> I'm particularly interested in your comment about simple_form-bootstrap not being well maintained, …
This opinion is probably tainted by my experience with simple_form + bootstrap4. But I think most of it is still true today.
Back then, there was no initializer for the new bootstrap and it was not possible to even create one without changing the simple_form core to work around requirements that bootstrap had ([Example](https://github.com/heartcombo/simple_form/pull/1552)) and kind-of-bugs in simple_form ([Example](https://github.com/heartcombo/simple_form/pull/1369#issuecomment-312208316)). However, IMO the process to get those changes going took too long for a project that I would like to base my forms upon for the years to come.
When we tried to contribute to simple_form, understanding and creating a configuration for the initializer did not feel great. It became very complex very quickly. So even the "I will do it myself"-option did not work out in a sane timeframe.
I started a initializer for the bootstrap4-alpha at https://github.com/heartcombo/simple_form/pull/1337 (Dec 2015) and there are a few re-tries over the years to get this general issue forward in this thread.
One think I noticed is, that there wasn't a strong community of community-contributions to collaborate on this issue even though a lot of people had the same problem. For a while all that happened was people pasting their WIP-initializers in issue-comments.
Also, it was quite hard to get input or support from the maintainers; thinks they wrote in 2017 suggested to me that they see the project in maintanance mode (https://github.com/heartcombo/simple_form/pull/1337#issuecomment-350709787) and that the initilizer setup is not what they would build today (https://github.com/heartcombo/simple_form/pull/1337#issuecomment-350889176). At that time the simple_form repo was hosted at plataformatec/simple_form and [they seem to to Elixir for a living now](https://plataformatec.com/en/) which suggested to me, that they moved on. However, I see now that the ownership of the repo has changed to heartcombo/simple_form, so maybe there is new vigor on the project now.
However, the public communication still seems off to me. The repo-Link in the header of https://github.com/heartcombo/simple_form still [links to a Blog with the last entry about bootstrap from 2014](http://blog.plataformatec.com.br/tag/simple_form/). And the readme still just say "bootstrap" without referencing the actual version.
> …along with any thoughts on using a bootstrap-specific form builder vs a form builder that fully supports multiple outputs.
I really like the way simple_form allows to write form – especially the hint-Attribute!
However, the form builder is specific to simple_form, which will result in a situation like I referenced above: If you want to update bootstrap, you need a new initializer which makes simple_form a blocking dependency. And updating the initializer is hard.
In contrast – and this is where my technical understanding becomes even muddier – the form build syntax of https://github.com/bootstrap-ruby/bootstrap_form is the same as the default-rails syntax https://guides.rubyonrails.org/v5.2/form_helpers.html; it's just the `form_for` that is replaced and thereby changes the output of the rails form builder.
In case an update to a new bootstrap is needed, one still needs to understand [the gigantic form builder code](https://github.com/bootstrap-ruby/bootstrap_form/blob/master/lib/bootstrap_form/form_builder.rb), but at least there is no additional complexity due to the abstraction of an initializer and framework. And the files only need to work for the new bootstrap (and not also Zurb Foundation …).
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rails-dev