Skip to content

Commit aca97b8

Browse files
committed
🚢 bump to version 4.0.0
1 parent f3012a2 commit aca97b8

7 files changed

Lines changed: 54 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,50 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [4.0.0] / 16 January 2020
7+
8+
Majority of using projects don't have to worry by this being a new major version.
9+
10+
**TLDR;** if your project manipulates `Writer.prototype.parse | Writer.cache` directly or uses `.to_html()`, you probably have to change that code.
11+
12+
This release allows the internal template cache to be customised, either by disabling it completely
13+
or provide a custom strategy deciding how the cache should behave when mustache.js parses templates.
14+
15+
```js
16+
const mustache = require('mustache');
17+
18+
// disable caching
19+
Mustache.templateCache = undefined;
20+
21+
// or use a built-in Map in modern environments
22+
Mustache.templateCache = new Map();
23+
```
24+
25+
Projects that wanted to customise the caching behaviour in earlier versions of mustache.js were forced to
26+
override internal method responsible for parsing templates; `Writer.prototype.parse`. In short, that was unfortunate
27+
because there is more than caching happening in that method.
28+
29+
We've improved that now by introducing a first class API that only affects template caching.
30+
31+
The default template cache behaves as before and is still compatible with older JavaScript environments.
32+
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:
33+
34+
```ts
35+
{
36+
set(cacheKey: string, value: string): void
37+
get(cacheKey: string): string | undefined
38+
clear(): void
39+
}
40+
```
41+
42+
### Added
43+
44+
* [#731]: Allow template caching to be customised, by [@AndrewLeedham].
45+
46+
### Removed
47+
48+
* [#735]: Remove `.to_html()`, by [@phillipj].
49+
650
## [3.2.1] / 30 December 2019
751

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

464+
[4.0.0]: https://github.com/janl/mustache.js/compare/v3.2.1...v4.0.0
420465
[3.2.1]: https://github.com/janl/mustache.js/compare/v3.2.0...v3.2.1
421466
[3.2.0]: https://github.com/janl/mustache.js/compare/v3.1.0...v3.2.0
422467
[3.1.0]: https://github.com/janl/mustache.js/compare/v3.0.3...v3.1.0
@@ -488,10 +533,13 @@ This release is made to revert changes introduced in [2.3.1] that caused unexpec
488533
[#717]: https://github.com/janl/mustache.js/issues/717
489534
[#728]: https://github.com/janl/mustache.js/issues/728
490535
[#733]: https://github.com/janl/mustache.js/issues/733
536+
[#731]: https://github.com/janl/mustache.js/issues/731
537+
[#735]: https://github.com/janl/mustache.js/issues/735
491538

492539
[@afc163]: https://github.com/afc163
493540
[@andersk]: https://github.com/andersk
494541
[@Andersos]: https://github.com/Andersos
542+
[@AndrewLeedham]: https://github.com/AndrewLeedham
495543
[@bbrooks]: https://github.com/bbrooks
496544
[@calvinf]: https://github.com/calvinf
497545
[@cmbuckley]: https://github.com/cmbuckley

mustache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666

667667
var mustache = {
668668
name: 'mustache.js',
669-
version: '3.2.1',
669+
version: '4.0.0',
670670
tags: [ '{{', '}}' ],
671671
clearCache: undefined,
672672
escape: undefined,

mustache.js.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>mustache.js</id>
5-
<version>3.2.1</version>
5+
<version>4.0.0</version>
66
<authors>mustache.js Authors</authors>
77
<licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl>
88
<projectUrl>http://mustache.github.com/</projectUrl>

mustache.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mustache.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ Writer.prototype.rawValue = function rawValue (token) {
659659

660660
var mustache = {
661661
name: 'mustache.js',
662-
version: '3.2.1',
662+
version: '4.0.0',
663663
tags: [ '{{', '}}' ],
664664
clearCache: undefined,
665665
escape: undefined,

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mustache",
3-
"version": "3.2.1",
3+
"version": "4.0.0",
44
"description": "Logic-less {{mustache}} templates with JavaScript",
55
"author": "mustache.js Authors <http://github.com/janl/mustache.js>",
66
"homepage": "https://github.com/janl/mustache.js",

0 commit comments

Comments
 (0)