linkedin/dustjs (dustjs-linkedin)
### [`v3.0.0`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v300-20211020-2256-0000)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.5...v3.0.0)
- [#805](https://togithub.com/linkedin/dustjs/pull/805) fix: Security bug about prototype pollution ([@sumeetkakkar](https://togithub.com/sumeetkakkar))
### [`v2.7.5`](https://togithub.com/linkedin/dustjs/compare/v2.7.4...v2.7.5)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.4...v2.7.5)
### [`v2.7.4`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v274-20160913-0252-0000)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.3...v2.7.4)
- [#744](https://togithub.com/linkedin/dustjs/pull/744) Don't use instanceof to determine if a Context is a Context. Instead use a flag on the instance itself so it can survive object merges. ([@sethkinast](https://togithub.com/sethkinast))
### [`v2.7.3`](https://togithub.com/linkedin/dustjs/compare/v2.7.2...v2.7.3)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.2...v2.7.3)
### [`v2.7.2`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v272-20150608-2041-0000)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.1...v2.7.2)
- [#673](https://togithub.com/linkedin/dustjs/pull/673) Pass the current context to filters ([@sethkinast](https://togithub.com/sethkinast))
- [#676](https://togithub.com/linkedin/dustjs/pull/676) If a Promise is resolved with an array, iterate over it instead of rendering the whole array at once.
Closes [#674](https://togithub.com/linkedin/dustjs/issues/674) ([@sethkinast](https://togithub.com/sethkinast))
- [#647](https://togithub.com/linkedin/dustjs/pull/647) Allow helpers to return primitives
Previously returning a primitive would crash rendering with no way to recover. You can still return a Chunk and do more complex work if you need to.
Helpers act like references or sections depending on if they have a body. When they have no body, they act like a reference and look in `params.filters` for filters to use. When they have a body, they act like a section. You can return thenables and streams normally.
{[@return](https://togithub.com/return) value="" filters="|s" /}
{[@return](https://togithub.com/return) value=""}{.} World{/return}
Closes [#645](https://togithub.com/linkedin/dustjs/issues/645) ([@sethkinast](https://togithub.com/sethkinast))
- [#664](https://togithub.com/linkedin/dustjs/pull/664) Be slightly pickier about what Dust thinks a Stream is.
Closes [#663](https://togithub.com/linkedin/dustjs/issues/663) ([@sethkinast](https://togithub.com/sethkinast))
- [#661](https://togithub.com/linkedin/dustjs/pull/661) Add saucelabs integration ([@sethkinast](https://togithub.com/sethkinast))
- [#658](https://togithub.com/linkedin/dustjs/pull/658) Refactor testing frameworks
Closes [#649](https://togithub.com/linkedin/dustjs/issues/649)
Closes [#602](https://togithub.com/linkedin/dustjs/issues/602)
Closes [#642](https://togithub.com/linkedin/dustjs/issues/642) ([@sethkinast](https://togithub.com/sethkinast))
- [#660](https://togithub.com/linkedin/dustjs/pull/660) Grammar: s/char/character/ to avoid using a reserved name
Closes [#659](https://togithub.com/linkedin/dustjs/issues/659) ([@sethkinast](https://togithub.com/sethkinast))
##### v2.7.1 (2015/04/30 20:32 +00:00)
- [#655](https://togithub.com/linkedin/dustjs/pull/655) Update CommonJS example to make use of new onLoad behavior ([@sethkinast](https://togithub.com/sethkinast))
- [#653](https://togithub.com/linkedin/dustjs/pull/653) Fix array iteration when context is undefined ([@sethkinast](https://togithub.com/sethkinast))
- [#641](https://togithub.com/linkedin/dustjs/pull/641) Add a `cb(null, compiledTemplate)` signature to `dust.onLoad`
Calling the `onLoad` callback with a compiled template function will use this template to satisfy the load request. The template is not automatically registered under any name when passed to the callback, so the `onLoad` function should handle registration as it needs.
`dust.cache` behavior has been changed slightly. Before, setting it to false would blow away the entire cache on every render. Now, setting it to false just prevents new templates from being added and cached templates from being used, but if it's set to true again previously-cached templates will be ready to use. ([@sethkinast](https://togithub.com/sethkinast))
- [#650](https://togithub.com/linkedin/dustjs/pull/650) Pin jasmine@2.2.x for grunt-jasmine-nodejs ([@sethkinast](https://togithub.com/sethkinast))
- [#646](https://togithub.com/linkedin/dustjs/pull/646) Update AMD and CommonJS examples ([@sethkinast](https://togithub.com/sethkinast))
- [#637](https://togithub.com/linkedin/dustjs/pull/637) CommonJS example ([@sethkinast](https://togithub.com/sethkinast))
- [#638](https://togithub.com/linkedin/dustjs/pull/638) Preserve compiler backwards compatibility with pre-2.7 versions ([@sethkinast](https://togithub.com/sethkinast))
- [#639](https://togithub.com/linkedin/dustjs/pull/639) Fix failing test on Windows ([@sethkinast](https://togithub.com/sethkinast))
##### v2.7.0 (2015/04/17 23:23 +00:00)
- [#636](https://togithub.com/linkedin/dustjs/pull/636) Fix failing tests in IE8 ([@sethkinast](https://togithub.com/sethkinast))
- [#633](https://togithub.com/linkedin/dustjs/pull/633) Drop Node 0.8 ([@sethkinast](https://togithub.com/sethkinast))
- [#635](https://togithub.com/linkedin/dustjs/pull/635) Resolve dynamic partial names via original context ([@sethkinast](https://togithub.com/sethkinast))
- [#631](https://togithub.com/linkedin/dustjs/pull/631) Try to avoid creating Stacks with no content when possible ([@sethkinast](https://togithub.com/sethkinast))
- [#613](https://togithub.com/linkedin/dustjs/pull/613) Refactor template compilation
- `dust.render` and `dust.stream` now accept a compiled template function in addition to a template name.
- `dust.compile` no longer requires a template name, and will compile an anonymous template without one (so `--name` is no longer required for dustc either)
- `dust.load` is removed from the public API
- `dust.renderSource` is moved to the compiler, so it's only included in dust-full now (Fixes [#412](https://togithub.com/linkedin/dustjs/issues/412))
- `dust.compileFn` is moved to the compiler, so it's only included in dust-full now
- add `dust.isTemplateFn`
- add `dust.config.cache = true`, set to `false` to disable caching and load templates again every time (Fixes [#451](https://togithub.com/linkedin/dustjs/issues/451))
- add `dust.config.cjs = false`, set to `true` to compile templates as CommonJS modules
- add `--cjs` flag to `dustc`
- Move a bunch of exposed compiler stuff under `dust.compiler` (but leave it exposed until 2.8) ([@sethkinast](https://togithub.com/sethkinast))
- [#624](https://togithub.com/linkedin/dustjs/pull/624) dustc always creates templates with forward slashes ([@sethkinast](https://togithub.com/sethkinast))
- [#617](https://togithub.com/linkedin/dustjs/pull/617) Add `chunk.stream` to allow streamables in context ([@sethkinast](https://togithub.com/sethkinast))
- [#610](https://togithub.com/linkedin/dustjs/pull/610) clean up PEG grammar a little bit ([@sethkinast](https://togithub.com/sethkinast))
### [`v2.7.1`](https://togithub.com/linkedin/dustjs/releases/tag/v2.7.1)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.0...v2.7.1)
#### Notable Changes
##### `dust.config.cache`
In previous versions, setting `dust.config.cache` to `false` would blow away the entire cache on every render. Now, setting it to `false` just prevents new templates from being added and cached templates from being used. Setting it back to `true` means that previously-cached templates will be ready to use.
##### `dust.onLoad`
We have added a `callback(null, compiledTemplate)` signature to `dust.onLoad`.
Calling the `onLoad` callback with a compiled template function will use this template to satisfy the load request. The template is not automatically registered under any name when passed to the callback, so the `onLoad` function should handle registration as it needs.
You can still call the callback with uncompiled template source and Dust will compile and store it, while respecting your `dust.config.cache` setting.
##### `dust.makeBase`
`dust.makeBase` is now aliased to `dust.context`.
#### Errata
Dust 2.7.0 broke backwards compatibility with older Dust compilers. This regression has been fixed so templates compiled with older versions of Dust will continue to work with Dust 2.7.1; you can use an older compiler if needed.
### [`v2.7.0`](https://togithub.com/linkedin/dustjs/releases/tag/v2.7.0)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.6.3...v2.7.0)
#### Supported Runtimes
With this release we are dropping official support for:
- Internet Explorer 7
- Node.js 0.8
No explicit changes have been made to break Dust in these environments, but we will no longer run tests and may break them going forward.
#### Notable Changes
##### More flexible rendering
You can pass Dust body functions directly to `dust.render` and `dust.stream`, instead of the template name.
require(['lib/dust-core', 'views/index'], function(dust, index) {
dust.render(index, context, function(err, out) { ... });
});
This means that you can also compile templates without having to name them-- just pass the compiled function directly to `dust.render`. You can decide if a function is eligible to be passed as a renderable by calling `dust.isTemplateFn()`.
##### CommonJS templates
Dust can now compile templates into CommonJS modules. Set `dust.config.cjs` to `true`, or use the `--cjs` flag with dustc.
var dust = require('dustjs-linkedin'),
index = require('views/index.js')(dust);
index.template; // contains the compiled template
index({ name: "Dust" }, function(err, out) { ... }); // use index to render or stream
##### Streams in context
You can include a ReadableStream directly in your Dust context and Dust will iterate over it like an array.
var resultStream = db.query("SELECT * FROM people").stream();
dust.renderSource("{#people}{firstName} {lastName}{/people}", { people: resultStream })
.pipe(res);
As long as you stream the results instead of rendering, Dust will flush data from the Stream as it is output.
##### Caching
You can disable caching of templates (useful for development) by setting `dust.config.cache = false`. If caching is disabled, you must write a `dust.onLoad` function to tell Dust how to load partials, since it wouldn't be possible to load them in advance and cache them.
#### Errata
The exposed compiler options such as `dust.optimizers` are **deprecated**. They are now exposed under, e.g. `dust.compiler.optimizers`. In Dust 2.8.0 the old options will be **removed**.
`dust.load`, an undocumented but public function, has been made private. Consider using `dust.onLoad` to define special behavior to load a template.
Templates compiled with earlier Dust versions should be recompiled before using 2.7.0.
### [`v2.6.3`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v263-20160726-1803-0000)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.6.2...v2.6.3)
- [#736](https://togithub.com/linkedin/dustjs/pull/736) Prioritize resolution of .then ([@brianmhunt](https://togithub.com/brianmhunt))
- [#735](https://togithub.com/linkedin/dustjs/pull/735) Prioritize .then on thenable functios ([#735](https://togithub.com/linkedin/dustjs/issues/735)) ([@brianmhunt](https://togithub.com/brianmhunt))
- [#734](https://togithub.com/linkedin/dustjs/pull/734) Bump deps ([@sethkinast](https://togithub.com/sethkinast))
- [#703](https://togithub.com/linkedin/dustjs/pull/703) Upgrade to peg.js 0.9 ([@sethkinast](https://togithub.com/sethkinast))
- [#705](https://togithub.com/linkedin/dustjs/pull/705) When rendering with a Context object, use the templateName provided by the template ([@sethkinast](https://togithub.com/sethkinast))
- [#701](https://togithub.com/linkedin/dustjs/pull/701) Fix stacktrace logging for IE8 ([@sethkinast](https://togithub.com/sethkinast))
- [#700](https://togithub.com/linkedin/dustjs/pull/700) At `DEBUG` loglevel, log the full stack trace on errors ([@r1b](https://togithub.com/r1b))
- [#690](https://togithub.com/linkedin/dustjs/pull/690) Update deps ([@sethkinast](https://togithub.com/sethkinast))
- [#689](https://togithub.com/linkedin/dustjs/pull/689) Make the AMD loader pass the template directly rather than communicating via the cache ([@aredridel](https://togithub.com/aredridel))
### [`v2.6.2`](https://togithub.com/linkedin/dustjs/releases/tag/v2.6.2)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.6.1...v2.6.2)
#### Notable Changes
- Dust contexts can now contain Promises. The Promise will be evaluated once it resolves or rejects.
- More info: http://www.dustjs.com/guides/contexts/#promises
- `dustc --watch` now reruns the compilation when a watched template changes
- Added new methods to the Context public API: `Context#clone`, `Context#pop`, and `Context#resolve`.
- More info: http://www.dustjs.com/docs/helper-api/
### [`v2.6.1`](https://togithub.com/linkedin/dustjs/releases/tag/v2.6.1)
[Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.6.0...v2.6.1)
This release fixes two small issues:
- Compiling templates with empty blocks such as `{
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
2.5.0
->3.0.0
By merging this PR, the issue #5 will be automatically resolved and closed:
Release Notes
linkedin/dustjs (dustjs-linkedin)
### [`v3.0.0`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v300-20211020-2256-0000) [Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.5...v3.0.0) - [#805](https://togithub.com/linkedin/dustjs/pull/805) fix: Security bug about prototype pollution ([@sumeetkakkar](https://togithub.com/sumeetkakkar)) ### [`v2.7.5`](https://togithub.com/linkedin/dustjs/compare/v2.7.4...v2.7.5) [Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.4...v2.7.5) ### [`v2.7.4`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v274-20160913-0252-0000) [Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.3...v2.7.4) - [#744](https://togithub.com/linkedin/dustjs/pull/744) Don't use instanceof to determine if a Context is a Context. Instead use a flag on the instance itself so it can survive object merges. ([@sethkinast](https://togithub.com/sethkinast)) ### [`v2.7.3`](https://togithub.com/linkedin/dustjs/compare/v2.7.2...v2.7.3) [Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.2...v2.7.3) ### [`v2.7.2`](https://togithub.com/linkedin/dustjs/blob/HEAD/CHANGELOG.md#v272-20150608-2041-0000) [Compare Source](https://togithub.com/linkedin/dustjs/compare/v2.7.1...v2.7.2) - [#673](https://togithub.com/linkedin/dustjs/pull/673) Pass the current context to filters ([@sethkinast](https://togithub.com/sethkinast)) - [#676](https://togithub.com/linkedin/dustjs/pull/676) If a Promise is resolved with an array, iterate over it instead of rendering the whole array at once. Closes [#674](https://togithub.com/linkedin/dustjs/issues/674) ([@sethkinast](https://togithub.com/sethkinast)) - [#647](https://togithub.com/linkedin/dustjs/pull/647) Allow helpers to return primitives Previously returning a primitive would crash rendering with no way to recover. You can still return a Chunk and do more complex work if you need to. Helpers act like references or sections depending on if they have a body. When they have no body, they act like a reference and look in `params.filters` for filters to use. When they have a body, they act like a section. You can return thenables and streams normally. {[@return](https://togithub.com/return) value="