k0kubun / hamlit

High Performance Haml Implementation
https://rubygems.org/gems/hamlit
Other
981 stars 59 forks source link

Help wanted: Conflict between hamlit and render_asyn gem #143

Closed jonatasrancan closed 5 years ago

jonatasrancan commented 5 years ago

Hi I'm using hamlit in a project without problems, but when I added the gem https://github.com/renderedtext/render_async to the project, I started to get the following error

undefined method 'haml_tag' for #<#:0x00007fc92434b0d0> I opened an issue on render_async with more details about the problem: renderedtext/render_async#86

Looks like the problem is related to ActionView::Base been accessed on render_async, more specific on this line: https://github.com/renderedtext/render_async/blob/master/lib/render_async.rb#L6

Also created a demo project to reproduce the bug: https://github.com/jonatasrancan/bug-render-async

Do you guys have any idea or suggestion on this?

Thanks in advance.

k0kubun commented 5 years ago

Thanks for making the reproductive repository. It's really helpful.

So, the backtrace is:

ActionView::Template::Error (undefined method `haml_tag' for #<#<Class:0x00007f45181121f0>:0x00007f4518316708>):
    1: - render_hello

app/helpers/application_helper.rb:3:in `render_hello'
app/views/home/root.html.haml:1:in `_app_views_home_root_html_haml__530090924491142380_69967366625700'

I think this has nothing to do with Hamlit, because haml_tag is not a feature of Hamlit yet. The issue is filed as #73.


And, let's see your Gemfile:

gem 'hamlit'
gem 'haml-rails'
gem 'render_async'

This means that you installed both haml.gem and hamlit.gem (use hamlit-rails instead of haml-rails if you meant to use Hamlit). And it looks like haml_tag of haml.gem has worked if render_async.gem is not installed.

Therefore, the issue lives in between haml.gem and render_async.gem. Please file the issue in haml.gem instead. Thank you.

jonatasrancan commented 5 years ago

Hi @k0kubun

Thanks for the quick answer.

You are right, in isn't hamlit fault. When I changed everything to haml and haml-rails, even with render_async everything works fine.

Maybe using hamlit and haml-rails together caused a strange behavior. Because using only both I can use haml_tag without problem. But when I add render_async the problem show up.

So for now on my project, I will just change to haml.

Thanks for the help again.