Releases: edgurgel/solid
Releases · edgurgel/solid
Solid 1.1.1
What's Changed
- Fix replace_first filter for nil argument by @google-labs-jules[bot] in #174
- Fix: Handle non-list inputs in sort_natural filter by @google-labs-jules[bot] in #175
- Fix:
replace_lastfilter bug with duplicate substrings by @google-labs-jules[bot] in #176 - Fix(filter): Handle nil argument for replace_last by @google-labs-jules[bot] in #177
- Fix(strip_html): handle multiline comments by @google-labs-jules[bot] in #178
- fix: Return error when both strict variables and filters are enabled by @Cervajz in #179
- Improve UndefinedVariableError and UndefinedFilterError error messages by @Cervajz in #180
New Contributors
Full Changelog: v1.1.0...v1.1.1
Solid 1.1.0
What's Changed
- fix: render loop should not access parentloop by @edgurgel in #170
- Fix incorrect typespec in If/Unless tag by @google-labs-jules[bot] in #171
- feat(sigil): Allow custom tags via @liquid_tags by @google-labs-jules[bot] in #172
New Contributors
- @google-labs-jules[bot] made their first contribution in #171
Full Changelog: v1.0.1...v1.1.0
Solid 1.0.1
Solid 1.0.0
What's changed
Parsing has been rewritten and there are a few breaking changes.
Check this PR for a bit more information.
Enhancements
- Error messages are now more detailed;
- Parsing can now fail with a list of errors instead of stopping on the first error;
liquidand the inline comment tag are now supported;
Bug fixes
Too many to list here.
Breaking changes
- Parsing engine has been rewritten from scratch. Any custom tags will need to re-implemented using the
Solid.Parser&Solid.Lexerfunctions. See existing tags as example; Solid.parse/2returns more meaningful errors and it tries to parse the whole file even when some errors are found. Example:
"""
{{ - }}
{% unknown %}
{% if true %}
{% endunless %}
{% echo 'yo' %}
"""
|> Solid.parse!()
** (Solid.TemplateError) Unexpected character '-'
1: {{ - }}
^
Unexpected tag 'unknown'
3: {% unknown %}
^
Expected one of 'elsif', 'else', 'endif' tags. Got: Unexpected tag 'endunless'
6: {% endunless %}
^
Unexpected tag 'endunless'
6: {% endunless %}
^
(solid 1.0.0-rc.0) lib/solid.ex:77: Solid.parse!/2
iex:2: (file)
Solid.render/3now always return{:ok, result, errors}unlessstrict_variablesorstrict_filtersare enabled and a filter or a variable was not found during rendering. See examples below:
"""
{{ 1 | base64_url_safe_decode }}
"""
|> Solid.parse!()
|> Solid.render(%{})
{:ok,
["Liquid error (line 1): invalid base64 provided to base64_url_safe_decode",
"\n"],
[
%Solid.ArgumentError{
message: "invalid base64 provided to base64_url_safe_decode",
loc: %Solid.Parser.Loc{line: 1, column: 8}
}
]}"{{ missing_var }} 123"
|> Solid.parse!()
|> Solid.render(%{})
{:ok, ["", " 123"], []}"{{ missing_var }}"
|> Solid.parse!()
|> Solid.render(%{}, strict_variables: true)
{:error,
[
%Solid.UndefinedVariableError{
variable: ["missing_var"],
loc: %Solid.Parser.Loc{line: 1, column: 4}
}
], [""]}"{{ 1 | my_sum }}"
|> Solid.parse!()
|> Solid.render(%{})
{:ok, ["1"], []}"{{ 1 | my_sum }}"
|> Solid.parse!()
|> Solid.render(%{}, strict_filters: true)
{:error,
[
%Solid.UndefinedFilterError{
filter: "my_sum",
loc: %Solid.Parser.Loc{line: 1, column: 8}
}
], ["1"]}Solid.FileSystem.read_template_file/2now must return a tuple with the file content or an error tuple.
Solid 1.0.0-rc.0
What's changed
Parsing has been rewritten and there are a few breaking changes.
Check this PR for a bit more information.
Enhancements
- Error messages are now more detailed;
- Parsing can now fail with a list of errors instead of stopping on the first error;
liquidand the inline comment tag are now supported;
Bug fixes
Too many to list here.
Breaking changes
- Parsing engine has been rewritten from scratch. Any custom tags will need to re-implemented using the
Solid.Parser&Solid.Lexerfunctions. See existing tags as example; Solid.parse/2returns more meaningful errors and it tries to parse the whole file even when some errors are found. Example:
"""
{{ - }}
{% unknown %}
{% if true %}
{% endunless %}
{% echo 'yo' %}
"""
|> Solid.parse!()
** (Solid.TemplateError) Unexpected character '-'
1: {{ - }}
^
Unexpected tag 'unknown'
3: {% unknown %}
^
Expected one of 'elsif', 'else', 'endif' tags. Got: Unexpected tag 'endunless'
6: {% endunless %}
^
Unexpected tag 'endunless'
6: {% endunless %}
^
(solid 1.0.0-rc.0) lib/solid.ex:77: Solid.parse!/2
iex:2: (file)
Solid.render/3now always return{:ok, result, errors}unlessstrict_variablesorstrict_filtersare enabled and a filter or a variable was not found during rendering. See examples below:
"""
{{ 1 | base64_url_safe_decode }}
"""
|> Solid.parse!()
|> Solid.render(%{})
{:ok,
["Liquid error (line 1): invalid base64 provided to base64_url_safe_decode",
"\n"],
[
%Solid.ArgumentError{
message: "invalid base64 provided to base64_url_safe_decode",
loc: %Solid.Parser.Loc{line: 1, column: 8}
}
]}"{{ missing_var }} 123"
|> Solid.parse!()
|> Solid.render(%{})
{:ok, ["", " 123"], []}"{{ missing_var }}"
|> Solid.parse!()
|> Solid.render(%{}, strict_variables: true)
{:error,
[
%Solid.UndefinedVariableError{
variable: ["missing_var"],
loc: %Solid.Parser.Loc{line: 1, column: 4}
}
], [""]}"{{ 1 | my_sum }}"
|> Solid.parse!()
|> Solid.render(%{})
{:ok, ["1"], []}"{{ 1 | my_sum }}"
|> Solid.parse!()
|> Solid.render(%{}, strict_filters: true)
{:error,
[
%Solid.UndefinedFilterError{
filter: "my_sum",
loc: %Solid.Parser.Loc{line: 1, column: 8}
}
], ["1"]}Solid.FileSystem.read_template_file/2now must return a tuple with the file content or an error tuple.
Solid v0.18.0
Solid v0.17.2
Solid v0.17.1
Solid 0.17.0
Solid 0.16.0
What's Changed
- chore: update docs around render/3 and README by @msutkowski in #134
- Update Elixir requirement to ~> 1.16 by @edgurgel in #139
- Echo tag, test cases restructure and custom matcher by @edgurgel in #141
New Contributors
- @msutkowski made their first contribution in #134
Full Changelog: v0.15.2...v0.16.0