Skip to content

Commit

Permalink
🚢 bump to version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipj committed Jan 16, 2020
1 parent f3012a2 commit aca97b8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 6 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,50 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.0] / 16 January 2020

Majority of using projects don't have to worry by this being a new major version.

**TLDR;** if your project manipulates `Writer.prototype.parse | Writer.cache` directly or uses `.to_html()`, you probably have to change that code.

This release allows the internal template cache to be customised, either by disabling it completely
or provide a custom strategy deciding how the cache should behave when mustache.js parses templates.

```js
const mustache = require('mustache');

// disable caching
Mustache.templateCache = undefined;

// or use a built-in Map in modern environments
Mustache.templateCache = new Map();
```

Projects that wanted to customise the caching behaviour in earlier versions of mustache.js were forced to
override internal method responsible for parsing templates; `Writer.prototype.parse`. In short, that was unfortunate
because there is more than caching happening in that method.

We've improved that now by introducing a first class API that only affects template caching.

The default template cache behaves as before and is still compatible with older JavaScript environments.
For those who wants to provide a custom more sopisiticated caching strategy, one can do that with an object that adheres to the following requirements:

```ts
{
set(cacheKey: string, value: string): void
get(cacheKey: string): string | undefined
clear(): void
}
```

### Added

* [#731]: Allow template caching to be customised, by [@AndrewLeedham].

### Removed

* [#735]: Remove `.to_html()`, by [@phillipj].

## [3.2.1] / 30 December 2019

### Fixed
Expand Down Expand Up @@ -417,6 +461,7 @@ This release is made to revert changes introduced in [2.3.1] that caused unexpec
* Fixed a bug that clashed with QUnit (thanks [@kannix]).
* Added volo support (thanks [@guybedford]).

[4.0.0]: https://github.com/janl/mustache.js/compare/v3.2.1...v4.0.0
[3.2.1]: https://github.com/janl/mustache.js/compare/v3.2.0...v3.2.1
[3.2.0]: https://github.com/janl/mustache.js/compare/v3.1.0...v3.2.0
[3.1.0]: https://github.com/janl/mustache.js/compare/v3.0.3...v3.1.0
Expand Down Expand Up @@ -488,10 +533,13 @@ This release is made to revert changes introduced in [2.3.1] that caused unexpec
[#717]: https://github.com/janl/mustache.js/issues/717
[#728]: https://github.com/janl/mustache.js/issues/728
[#733]: https://github.com/janl/mustache.js/issues/733
[#731]: https://github.com/janl/mustache.js/issues/731
[#735]: https://github.com/janl/mustache.js/issues/735

[@afc163]: https://github.com/afc163
[@andersk]: https://github.com/andersk
[@Andersos]: https://github.com/Andersos
[@AndrewLeedham]: https://github.com/AndrewLeedham
[@bbrooks]: https://github.com/bbrooks
[@calvinf]: https://github.com/calvinf
[@cmbuckley]: https://github.com/cmbuckley
Expand Down
2 changes: 1 addition & 1 deletion mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@

var mustache = {
name: 'mustache.js',
version: '3.2.1',
version: '4.0.0',
tags: [ '{{', '}}' ],
clearCache: undefined,
escape: undefined,
Expand Down
2 changes: 1 addition & 1 deletion mustache.js.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>mustache.js</id>
<version>3.2.1</version>
<version>4.0.0</version>
<authors>mustache.js Authors</authors>
<licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl>
<projectUrl>http://mustache.github.com/</projectUrl>
Expand Down
2 changes: 1 addition & 1 deletion mustache.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mustache.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ Writer.prototype.rawValue = function rawValue (token) {

var mustache = {
name: 'mustache.js',
version: '3.2.1',
version: '4.0.0',
tags: [ '{{', '}}' ],
clearCache: undefined,
escape: undefined,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mustache",
"version": "3.2.1",
"version": "4.0.0",
"description": "Logic-less {{mustache}} templates with JavaScript",
"author": "mustache.js Authors <http://github.com/janl/mustache.js>",
"homepage": "https://github.com/janl/mustache.js",
Expand Down

0 comments on commit aca97b8

Please sign in to comment.