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-bluebirdso that native Promises are used (thanks @dotnil).
- Added
includewith a file-system layer (very big thanks to @imjoshholloway).
- For-Loops now can iterate over objects (like Ruby's Hashes).
- Added
defaultfilter (thanks to @sebastianseilund).
- Make
assignsupport filters.
- Performance optimizations.
- Make
bluebirdapeerDependency.
- Fixed undefined properties causing exceptions (thanks to @vmira).
- Fixed
undefined variable Liquidin join-helper.
- Removed a stray
console.login the library.
- Added support for
casetag.
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
Promises. - ADDED: Ranges
(0..5)/(0..foo)are now supported. - FIX:
{% if foo is blank/empty %}didn't work. - FIX:
context.hasKeydidn't work. - FIX: Tokenizer now removes all empty tokens.
- CHANGE:
commentnow inherits fromrawso that inner tags are ignored. - FIX:
isntwasn't the opposite ofis. - FIX:
FilterNotFoundwas never raised. - FIX: Unterminated variables
{{ foowould raise a useless error. - FIX:
truncatefilter had an off-by-1 error. - FIX:
rawtag didn't work.
- COMPAT: Update
bluebirddependency.
- COMPAT: Require Node.js
>=0.10. - COMPAT: Stricter dependencies (i.e. bluebird, strftime) with
~instead of^.
- ADDED: Added a
datefilter.
- ADDED: Added various standard filters (by @dotnil).
- FIXED:
toStringhelper used by filters didn't return a String in all cases. - FIXED:
undefined | my_filter:123would output the stringmy_filter:123. - IMPROVEMENT: append and prepend filters don't use Array.join anymore.
- FIX:
capturetag 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.parseTokenfromengine.parse. (API does not break)
- API: Tag constructor doesn't get
tokensanymore. It will be passed toparseinstead. - API: Added
beforeParseandafterParsehooks 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
bluebirdas implementation for promises - might cause API break. - API: Tokens passed to
parse()are now objects instead of strings withcol,lineandvalue. - API:
parse()doesn't accept objects with asourceproperty anymore. - API:
engine.registerFilteris nowengine.registerFilters. - API:
context.addFiltersis nowcontext.registerFiltersand now takes variadic arguments. - API: Removed
Strainerclass. - IMPROVEMENT:
Strainers aren't shared betweenEngines anymore. - IMPROVEMENT:
Liquid.SyntaxErrors 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
mochafor 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:
blankandemptyhad odd behaviour on non-arrays - FIXED:
[false, true] includes falsereturned false - FIXED: LiquidErrors had odd behaviour when used in
instanceof(thanks @dotnil) - IMPROVEMENT: Replaced
q.catchandq.failcalls (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 < bwhere a and b are async are now parallelized - ADDITION: New operators
isandisnt
(deprecated)
(deprecated)
Pseudo Public Release
(internal development)