-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.5.0: Is API for EEx.Engine changed since 1.4? #6391
Comments
josevalim
pushed a commit
that referenced
this issue
Jul 29, 2017
Elixir v1.5.0 attempted to repurpose the value of init to use throughout the engine but such was a breaking change. To address this problem, we added handle_begin and handle_end which were designed exactly to handle inner buffers. This comes with the benefit that EEx.Engine can now have any data structure as state and no longer only quoted expressions. Closes #6391.
Thank you for the report. @grych can you please give branch v1.5 (or master) a try? I want to make sure it will work as you expect. |
Hi @josevalim,
And it fixed my issue grych/drab#31. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it an expected behaviour of
EEx.Engine
that it includes aninit
value in the middle expressions? Before 1.5.0,init/1
value were added only at the beginning of the buffer, in the middle it was always empty string.Observe the difference between 1.4.5 and 1.5.0 below:
Test engine
test.eex:
<%= for x <- ["A", "B"] do %><%= x %><% end %>
1.4.5:
1.5.0:
If it is expected, shouldn't be
handle_body/1
called at the end of each middle expression? That would be consistent withinit/1
.But I hope it is a bug, because previous behaviour was more intuitive.
Environment
The change was introduced here: b620445
The text was updated successfully, but these errors were encountered: