Skip to content

Releases: mozilla/nunjucks

v2.3.0

06 Jan 23:04
Compare
Choose a tag to compare
  • Return null from WebLoader on missing template instead of throwing an
    error, for consistency with other loaders. This allows WebLoader to support
    the new ignore missing flag on the include tag. If ignore missing is
    not set, a generic "template not found" error will still be thrown, just like
    for any other loader. Ajax errors other than 404 will still cause WebLoader
    to throw an error directly.
  • Add preserve-linebreaks option to striptags filter. Thanks Ivan
    Kleshnin. Merge of #619.

v2.2.0

23 Nov 20:27
Compare
Choose a tag to compare
  • Add striptags filter. Thanks Anthony Giniers. Merge of
    #589.
  • Allow compiled templates to be imported, included and extended. Thanks Luis
    Gutierrez-Sheris. Merge of
    #581.
  • Fix issue with different nunjucks environments sharing same globals. Each
    environment is now independent. Thanks Paul Pechin. Merge of
    #574.
  • Add negative steps support for range function. Thanks Nikita Mostovoy. Merge
    of #575.
  • Remove deprecation warning when using the default filter without specifying
    a third argument. Merge of
    #567.
  • Add support for chaining of addGlobal, addFilter, etc. Thanks Rob Graeber. Merge of
    #537
  • Fix error propagation. Thanks Tom Delmas. Merge of
    #534.
  • trimBlocks now also trims windows style line endings. Thanks Magnus Tovslid. Merge of
    #548
  • include now supports an option to suppress errors if the template does not
    exist. Thanks Mathias Nestler. Merge of
    #559

v2.1.0

21 Sep 20:39
Compare
Choose a tag to compare
  • Fix creating WebLoader without opts. Merge of
    #524.
  • Add hasExtension and removeExtension methods to Environment. Merge of
    #512.
  • Add support for kwargs in sort filter. Merge of
    #510.
  • Add none as a lexed constant evaluating to null. Merge of
    #480.
  • Fix rendering of multiple raw blocks. Thanks Aaron O'Mullan. Merge of
    #503.
  • Avoid crashing on async loader error. Thanks Samy Pessé. Merge of
    #504.
  • Add support for keyword arguments for sort filter. Thanks Andres Pardini. Merge of
    #510

v2.0.0 - lots of stuff

28 Aug 00:09
Compare
Choose a tag to compare

Most of the changes can be summed up in the issues tagged 2.0.

Or you can see all commits.

Most important changes:

  • autoescape is now on by default. You need to explicitly pass { autoescape: false } in the options to turn it off.
  • watch is off by default. You need to explicitly pass { watch: true } to start the watcher.
  • The default filter has changed. It will show the default value only if the argument is undefined. Any other value, even false-y values like false and null, will be returned. You can get back the old behavior by passing true as a 3rd argument to activate the loose-y behavior: foo | default("bar", true). In 2.0 if you don't pass the 3rd argument, a warning will be displayed about this change in behavior. In 2.1 this warning will be removed.
  • New filter tag
  • Lots of other bug fixes and small features, view the above issue list!

v1.3.4 - npm optimizations

27 Apr 20:37
Compare
Choose a tag to compare

This is an extremely minor release that only adds an .npmignore so that the bench, tests, and docs folders do not get published to npm. Nunjucks should download a lot faster now.

v1.3.3

03 Apr 21:44
Compare
Choose a tag to compare

This is exactly the same as v1.3.1, just fixing a typo in the git version tag.

v1.3.0

03 Apr 16:41
Compare
Choose a tag to compare
  • Relative templates: you can now load a template relatively by starting the path with ., like ./foo.html
  • FileSystemLoader now takes a noCache option, if true will disable caching entirely
  • Additional lstripBlocks and trimBlocks available to clean output automatically
  • New selectattr and rejectattr filters
  • Small fixes to the watcher
  • Several bug fixes

cc83724 prep for v1.3.0
eaa0f78 Merge pull request #370 from MaxKramnik/master
c00a33b Removing ignoreInitial option for chokidar to refresh view after first template save, removing event == "add"
3664163 Merge pull request #391 from SamyPesse/fix/windows
0f8b21b Simplify EOL norm regex in tests
41dd01c Disable windows tests for node 0.8
ce18959 Add very simple test for precompile
ff075af Fix #392: fix precompile.js for strict mode
7ff10e3 Use explicit path to mocha bin in test script
3b2f4ea Remove make as testing dependency
f58fd64 Add appveyor.yml for windows testing
5b48f29 Improve EOL normalization for tests
f08182c Add method to normalize EOL in tests
8974aa3 Merge pull request #390 from mozilla/fix-watching
cde3dc5 fix watching in node-loader
dda4e84 Fix escape for windows path
8ef8c47 Merge pull request #389 from SamyPesse/patch-1
1388170 Fix error when template is not found
2a2a31f Merge pull request #387 from mozilla/eqeqeq
2af7844 use === and !== instead == and !=
4245822 Merge pull request #386 from mozilla/use-strict
459e400 Add 'use strict'; #1
3f83a11 Merge pull request #385 from mozilla/single-quote
d930a2d Change always using single quote
901d808 Merge pull request #379 from SamyPesse/fix/378
4568ace Add method isRelative to loader
fcd71c6 Merge pull request #380 from stevemao/patch-1
4a5e862 add keywords in package.json
e0b1431 Don't force template name to be a string in compiler
c8b3b16 Remove useless that
17bc3f0 Fix #378: move cache to loader
252b76a Fix #375: Always resolve path when parentName is present
0f4a85c Improve cache performance for relative path
af62c97 Add test for cache path of relative paths
42d2b9f minor cleanup, regenerate browserfiles
1077f97 Merge pull request #349 from SamyPesse/feature/relative
9c6b2bb Pass name to compiler creation
52412a1 Accept path options in env.renderString
103dd2c Add test for relative path and renderString
1b7dcc6 Resolve of relative paths is done by loader
40d4ce7 Add tests for relative paths
9946ee8 Fix test of position of template file
d292cce Accept absolute path in FileSystemLoader
7bc9cd3 use parentName in getTemplate to resolve name
8285207 Pass name to getTemplate
4ce458e emit update when the template is changed the first time when the event == "add"
3dd3158 Add selectattr and rejectattr in built-in filters list.
aae3ec9 merge docs into main repo
8c6e2bc Merge pull request #354 from SamyPesse/feature/nocacheoption
dafc9e3 Merge pull request #355 from radev/master
ab9a7c7 Merge pull request #365 from carljm/selectattr
904316a Merge pull request #364 from carljm/list-on-array
dcfa36a Allow list filter to pass arrays through as-is.
bab41dc Add support for selectattr and rejectattr filters.
9a77099 Moved environment options to opts
fecfa42 Implement lstripBlocks and trimBlocks from Jinja2
e7572fd Add option to "noCache" to FileSystemLoader

v1.3.1

03 Apr 20:50
Compare
Choose a tag to compare

We added strict mode to all the files, but that broke running nunjucks in the browser. Should work now with this small fix.

v1.2.0

04 Feb 22:02
Compare
Choose a tag to compare
  • The special non-line-breaking space is considered whitespace now
  • The in operator has a lower precedence now. This is potentially a breaking change, thus the minor version bump. See #336
  • import with context now implemented: #319
  • async rendering doesn't throw compile errors

24024b5 (HEAD, origin/master, master) Merge pull request #353 from SamyPesse/patch-1
324a875 Fix tests for non-breaking whitespaces
8b81acb Add test for non-breaking spaces
0815d4d use \u00A0 instead of String.charCode
2aaed2a Add nonbreaking space to whitespace chars list
52a50fc Fix spelling
c0baa5c Merge pull request #306 from eventEmitter/master
5f0c528 Merge pull request #336 from carljm/in-precedence
219d2eb Merge pull request #339 from oyyd/my_fork
140ccad Merge pull request #346 from fabien/master
1aaec23 fixed merge conflict
e1ab103 Update package.json
3a34fc9 Fix #317
f655747 Add test to verify that imports are without context by default.
f710479 Bind 'in' operator more tightly than boolean operators.
d5fd4c4 add test to ensure without context works
dbdc966 implement import with context
4f6b02e async rendering doesn't throw anymore when compiling errors (fixes #233)
f0b7384 Merge remote-tracking branch 'origin/master'
71d050f fix type in _matches in tokenizer (fixes #294)
99033de Merge pull request #300 from rhengles/bin-precompile-windows
b8fe5ca fix typo in error message in parsePrimary (fixed #297)
e67a405 precompile command for Windows
fbf5dd5 Revert "upgrade chokidar"

v1.1.0

30 Sep 17:36
Compare
Choose a tag to compare

User visible changes:

  • Fix a bug in urlize that would remove periods
  • custom tag syntax (like {% and %}) was made Environment-specific internally. Previously they were global even though you set them through the Environment.
  • Remove aggressive optimization that only emitted loop variables when uses. It introduced several bugs and didn't really improve perf.
  • Support the regular expression syntax like /foo/g.
  • The replace filter can take a regex as the first argument
  • The call tag was implemented
  • for tags can now take an else clause
  • The cycler object now exposes the current item as the current property
  • The chokidar library was updated and should fix various issues

Dev changes:

  • Test coverage now available via istanbul. Will automatically display after running tests.