You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The define.*_output_helper methods could be exposed directly to ApplicationComponent as class methods to make adapting to third party helpers, like local_time, slightly easier without having to implement a module, like this:
I think we could go further and include them in a patch to Phlex::HTML directly. We already have register_element.
We can simplify things by only providing output_helper_with_capture_block and value_helper_with_capture_block, since those two work with or without blocks, and the 0.1% performance gain from not taking a block isn’t worth it here in my opinion.
We should probably call them register_value_helper and register_output_helper, though I’m open to suggestions for the names.
To adapt a Rails helper today, developers have to follow the pattern of creating an adapter that's established at https://github.com//phlex-ruby/phlex-rails/blob/version-1-9/lib/phlex/rails/helpers.rb
The
define.*_output_helper
methods could be exposed directly toApplicationComponent
as class methods to make adapting to third party helpers, likelocal_time
, slightly easier without having to implement a module, like this:The method names may need to be tweaked slightly, like
define_output_helper
becomesoutput_helper :local_time
ordelegate_to_output_helper :local_time
The text was updated successfully, but these errors were encountered: