Closed ritec closed 3 years ago
Hi. Thank you for trying Hamlit.
As I commented in https://github.com/k0kubun/hamlit/issues/71#issuecomment-224018926, some helpers are absent since Hamlit's compiled code doesn't use Haml::Buffer. It should be implemented in a different way and we don't have the one for now.
By the way, why do you prefer haml_tag rather than content_tag?
Oh, ok, I see now. Well thanks, I will try to work around these constraints. You can close this issue if you want. 👍
Please let me close this until somebody really needs haml_tag rather than content_tag. Thanks.
just my $.02: It might have offered a smoother migration to first support haml_tag
but with a deprecation warning, before removing it completely.
It never really existed in this gem. Hamlit::HamlHelpers was copied as part of the parser implementation. It's not supposed to be used outside Hamiit's engine. Hamlit does not have anything like Haml::Buffer, which powered the helpers missing in Hamlit. If it did, it would have been just as slow as original Haml, so that defeats the purpose.
If you're not talking about this repository but haml, yes, I think it's a fair point (but please report to the actual repository to avoid confusion next time). I think we can cut a Haml v5 release that only prints warnings in removed helpers. Would that help your current situation?
Thank you, @k0kubun. At this point I've just about worked through incompatibilities between hamlit and haml (actually just the disappearance of haml_tag
, so my previous comment was just a suggestion for how revs to widely-used code can be organized to smooth out migration for users. No need to do anything on my account. Thanks for offering, though, and most importantly, thanks for v6/hamlit. Your work is appreciated.
Hello, first and foremost, thanks for creating this project, really looking forward to replacing the haml gem with hamlit! Now to my issue, I have the following helper method in ApplicationHelper
However when the method is called from a view I get the following error:
NoMethodError - undefined method haml_tag
So I go ahead and add
include Hamlit::HamlHelpers
in my application_helper.rb file. But then I get a different error:NoMethodError - undefined method html? for nil:NilClass: hamlit (2.5.0) lib/hamlit/parser/haml_helpers.rb:505:in haml_tag
It looks like
haml_buffer
is nil at this point would you know why this is? Thanks.