Releases: haml/haml
v6.0.4
v6.0.3
v6.0.2
6.0.1
6.0.0
Haml 6 became 1.7x faster than Haml 5, and it's now faster than Slim and Erubi in this benchmark that was originally written by Slim developers.
$ bundle exec ruby benchmark/slim/run-benchmarks.rb
Calculating -------------------------------------
erubi v1.11.0 34.595k i/100ms
slim v4.1.0 30.931k i/100ms
haml v6.0.0.beta.1 35.621k i/100ms
-------------------------------------------------
erubi v1.11.0 411.827k (± 0.4%) i/s - 2.076M
slim v4.1.0 361.660k (± 0.4%) i/s - 1.825M
haml v6.0.0.beta.1 427.207k (± 0.6%) i/s - 2.137M
Comparison:
haml v6.0.0.beta.1: 427206.9 i/s
erubi v1.11.0: 411826.6 i/s - 1.04x slower
slim v4.1.0: 361659.8 i/s - 1.18x slower
Changes
- Replace the implementation with Hamlit
- Haml 6 is about 1.7x faster than Haml 5 in this benchmark.
- The parser is kept as is, but everything else is replaced.
- The
haml
CLI interface was also replaced. - The interface of
Haml::Engine
is changed.Haml::Template
is most likely what you need now. - Most Haml helpers are removed.
- Rails:
- Kept:
find_and_reserve
,preserve
,surround
,precede
,succeed
,capture_haml
- Removed:
block_is_haml?
,flatten
,haml_concat
,haml_indent
,haml_tag
,haml_tag_if
,html_attrs
,
html_escape
,init_haml_helpers
,is_haml?
,list_of
,non_haml
,tab_down
,tab_up
,with_tabs
- Kept:
- Tilt:
- Kept:
preserve
- Removed:
block_is_haml?
,capture_haml
,escape_once
,find_and_preserve
,flatten
,haml_concat
,
haml_indent
,haml_tag
,haml_tag_if
,html_attrs
,html_escape
,init_haml_helpers
,is_haml?
,
list_of
,non_haml
,precede
,succeed
,surround
,tab_down
,tab_up
,with_tabs
- Kept:
- Rails:
- Only the attributes in
Haml::AttributeBuilder::BOOLEAN_ATTRIBUTES
are handled as boolean attributes. - Some legacy Rails integration is removed.
6.0.0.beta.1
Haml 6 became 1.7x faster than Haml 5, and it's now faster than Slim and Erubi in this benchmark that was originally written by Slim developers.
$ bundle exec ruby benchmark/slim/run-benchmarks.rb
Calculating -------------------------------------
erubi v1.11.0 34.595k i/100ms
slim v4.1.0 30.931k i/100ms
haml v6.0.0.beta.1 35.621k i/100ms
-------------------------------------------------
erubi v1.11.0 411.827k (± 0.4%) i/s - 2.076M
slim v4.1.0 361.660k (± 0.4%) i/s - 1.825M
haml v6.0.0.beta.1 427.207k (± 0.6%) i/s - 2.137M
Comparison:
haml v6.0.0.beta.1: 427206.9 i/s
erubi v1.11.0: 411826.6 i/s - 1.04x slower
slim v4.1.0: 361659.8 i/s - 1.18x slower
This is a beta release of Haml 6. It has breaking changes from Haml 5, so please be sure to test it with your application.
Changes
- Replace the implementation with Hamlit
- The parser is kept as is, but everything else is replaced.
- All Haml helpers except for
preserve
are removed. - Some legacy Rails integration is removed.
Look Under Your Seats, It's an All Expense Paid Annotation!
Howdy Haml-faml,
The 5.x.x line of Haml keeps chugging along, and we will likely keep this codebase going for those who want this full-fat version of Haml and addressing little issues here and there.
In this version, the wonderful @jdelStrother brought in a new feature for adding annotations to your output during development showing which template the html came from.
<div class='navbar-light navbar-collapse collapse wi-100 d-md-none' id='navbar-collapse'>
<div class='navbar-nav phm mbm' role='menu'>
<!-- BEGIN app/views/page_header/_user_profile_links.html.haml -->
<a class="nav-link" href="/profile">Profile</a>
<a class="nav-link" href="/account/edit">Settings</a>
<div class='dropdown-divider'></div>
<a class="nav-link" href="/logout">Log out</a>
<!-- END app/views/page_header/_user_profile_links.html.haml -->
</div>
</div>
This was added in Rails 6.1 for ERB files, and now all you wonderful Haml-ers out there get the same useful feature.
As for the future of Haml, we are likely going to be moving over the main branch and 6.x.x development to be based off of @k0kubun's awesome Hamlit implementation. It does lack some of the features that 5.x has, but it comes with almost 2x speed improvement and honestly, even the way I (Hampton) use Haml – is well covered by Hamlit. You really have to be doing some weird stuff for it to be an issue. So, we'll likely be releasing an alpha of that 6.x-based-on-Hamlit code soon.
A Surprise Visit
It's time to face the facts that the last release was a LIE. I said we weren't going to release another version of Haml 5.x... and yet, here we are again.
"What's this all about?!?!", you must be screaming at your computer.
Well, our wonderful @k0kubun has given all of us a wonderful present– which is proper multiline-attributes support for Haml. No longer are we forced to either have super long lines or have kinda wonky spacing on our attributes.
How it started:
.messages-overflow-container{"data-simplebar": true}
.messages{data: {controller: "chat-messages"}}
.like-notification{data: {controller: "reaction-notification"}}
- unless video.finished?
.message-write{data: { "controller": "chat", "show-when-logged-in": true }}
.chat-controls
.write-area{placeholder: 'Send a message', contenteditable: true, role: "textbox", data: {action: "keydown->chat#chatBoxKeyDown", target: "chat.messageInput"}}
= render "shared/reaction_button"
.message-login-prompt{data: { "show-when-logged-out": true }}
%button{data: {action: "authentication#showModal"}} Login To Chat
How it's going:
.messages-overflow-container{"data-simplebar": true}
.messages{
data: { controller: "chat-messages" }
}
.like-notification{
data: { controller: "reaction-notification" } }
- unless video.finished?
.message-write{
data: {
"controller": "chat",
"show-when-logged-in": true
}
}
.chat-controls
.write-area{
placeholder: 'Send a message',
contenteditable: true,
role: "textbox",
data: {
action: "keydown->chat#chatBoxKeyDown",
target: "chat.messageInput"
}
}
= render "shared/reaction_button"
.message-login-prompt{data: { "show-when-logged-out": true }}
%button{
data: {
action: "authentication#showModal"
}
} Login To Chat
How about THAT! I don't know about you, but this is going to improve my markup by a huge margin. I am super thrilled to get this into our code at @veuelive!
The Long Goodbye
This release is meant to be the final release that's got all the bells and whistles of Haml from the last 10 years. Going forward, new releases will be in the 6.x.x series and will NOT be backwards compatible for many features.
We may do a release of 5.2.1+ if we have security issues come up.