-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use streaming responses #67
Comments
This is essentially how Phlex works and it’s really fast because you don’t need to allocate an object for each element. The generated HTML tag methods are essentially: def h1(**)
@buffer << "<h1" << build_attributes(**) << ">"
yield
@buffer << "</h1>"
end |
Yes, see varyonic@312ee73?diff=split&w=1 for my less elegant but working replacement of Element#to_s. I think it would be interesting to replace Arbre or Arbo with Phlex in ActiveAdmin but I am not familiar with how Phlex interoperates with ActionView and Rails helpers (especially form builders, though replacing Formtastic would also be good). Could it be done in a way that is (mostly) backward compatible or has a simple migration path? |
I expect so. Phlex Rails defines wrappers for each ActionView helper because it needs to behave in different ways depending on the kind of helper. There are essentially two kinds of helpers:
For example, here the link_to(dashboard_path) { "Dashboard" } We don’t need to do anything like unsafe_raw(
link_to(dashboard_path) { "Dashboard" }
) All the helpers are defined here. https://github.com/phlex-ruby/phlex-rails/tree/main/lib/phlex/rails/helpers Some helpers such as form builder helpers need some extra managing to maintain compatibility. Helpers like |
See activeadmin/activeadmin#2689
The text was updated successfully, but these errors were encountered: