Note: This changelog is no longer manually maintained. Release notes are now generated by semantic-release
and included in each GitHub Release.
For release notes on versions >3.0.0, see github.com/docs/liquid/releases
- Migrated from native-or-bluebird to any-promise (thanks @swashcap).
- Upgraded developer dependencies (thanks @RobLoach).
- Migrated to
native-or-bluebird
so that native Promises are used (thanks @dotnil).
- Added
include
with a file-system layer (very big thanks to @imjoshholloway).
- For-Loops now can iterate over objects (like Ruby's Hashes).
- Added
default
filter (thanks to @sebastianseilund).
- Make
assign
support filters.
- Performance optimizations.
- Make
bluebird
apeerDependency
.
- Fixed undefined properties causing exceptions (thanks to @vmira).
- Fixed
undefined variable Liquid
in join-helper.
- Removed a stray
console.log
in the library.
- Added support for
case
tag.
LiquidNode always had the Drop
class but it never worked
and it was never tested. This has changed with 2.0.0.
In 1.x the template "{{ user.save }}" with the variable configuration
variables =
user:
save: ->
# code
return "ok"
would have called save()
automatically and thus have rendered ok
.
This is now prevented. If you want to allow calling of functions
you have to use a Drop
now.
class Droplet extends Liquid.Drop
save: ->
"ok"
- API: Some standard filters might now return
Promise
s. - ADDED: Ranges
(0..5)
/(0..foo)
are now supported. - FIX:
{% if foo is blank/empty %}
didn't work. - FIX:
context.hasKey
didn't work. - FIX: Tokenizer now removes all empty tokens.
- CHANGE:
comment
now inherits fromraw
so that inner tags are ignored. - FIX:
isnt
wasn't the opposite ofis
. - FIX:
FilterNotFound
was never raised. - FIX: Unterminated variables
{{ foo
would raise a useless error. - FIX:
truncate
filter had an off-by-1 error. - FIX:
raw
tag didn't work.
- COMPAT: Update
bluebird
dependency.
- COMPAT: Require Node.js
>=0.10
. - COMPAT: Stricter dependencies (i.e. bluebird, strftime) with
~
instead of^
.
- ADDED: Added a
date
filter.
- ADDED: Added various standard filters (by @dotnil).
- FIXED:
toString
helper used by filters didn't return a String in all cases. - FIXED:
undefined | my_filter:123
would output the stringmy_filter:123
. - IMPROVEMENT: append and prepend filters don't use Array.join anymore.
- FIX:
capture
tag captured output as an arrays and not as a string.
- ADDED: New
engine.parseAndRender(input, args...)
that simplifiesengine.parse(input).then (t) -> t.render(args...)
. - REFACTORING: Extracted
engine.parseToken
fromengine.parse
. (API does not break)
- API: Tag constructor doesn't get
tokens
anymore. It will be passed toparse
instead. - API: Added
beforeParse
andafterParse
hooks to allow better sharing of code. - API: Tags can now return arrays in
render()
that will be concatenated to a string. - API:
template.parse()
andengine.parse()
will return a Promise now. - API:
template.parse()
is now async-aware. Any Tag can do async parsing now. - API:
template.render(assigns [, options])
won't accept filters as second argument anymore. - API: Switched to
bluebird
as implementation for promises - might cause API break. - API: Tokens passed to
parse()
are now objects instead of strings withcol
,line
andvalue
. - API:
parse()
doesn't accept objects with asource
property anymore. - API:
engine.registerFilter
is nowengine.registerFilters
. - API:
context.addFilters
is nowcontext.registerFilters
and now takes variadic arguments. - API: Removed
Strainer
class. - IMPROVEMENT:
Strainer
s aren't shared betweenEngine
s anymore. - IMPROVEMENT:
Liquid.SyntaxError
s now include a location of the error. - IMPROVEMENT:
assign
-Tag doesn't wait on fulfillment of promise. - IMPROVEMENT: Throws errors on missing filters.
- MISC: CoffeeScript is now compiled to JavaScript when a new version of LiquidNode is published.
- INTERNAL: Switched to
mocha
for testing. - INTERNAL: Rewrote testing suites.
- INTERNAL: Dropped dependency on
underscore
.
In Liquid (Ruby) you register tags and additional filters at the Template class. So your project only has a single possible configuration.
+ var engine = new Liquid.Engine;
- Liquid.Template.registerTag(...);
+ engine.registerTag(...);
- var output = Liquid.Template.parse(templateString).renderOrRaise({ foo: 42 });
+ var output = engine.parse(templateString).render({ foo: 42 });
Also note that renderOrRaise
has been removed, since render
has been returning a promise for some time.
The signature of Tag-constructors changed to match render()
signature where the
"context" is passed first.
- function(tagName, markup, tokens, template) { ... }
+ function(template, tagName, markup, tokens) { ... }
Restores compatibility with 0.1.2 after 0.1.4 introduced the engine which was supposted to be release in a major (or at least minor) release.
- FIXED:
blank
andempty
had odd behaviour on non-arrays - FIXED:
[false, true] includes false
returned false - FIXED: LiquidErrors had odd behaviour when used in
instanceof
(thanks @dotnil) - IMPROVEMENT: Replaced
q.catch
andq.fail
calls (they are deprecated). - IMPROVEMENT: context.variable() is now wrapped in
Q.fcall
- IMPROVEMENT: throw exception when somebody tries to use ranges (not implemented yet)
- IMPROVEMENT: Conditions
a < b
where a and b are async are now parallelized - ADDITION: New operators
is
andisnt
(deprecated)
(deprecated)
Pseudo Public Release
(internal development)