Pārlūkot izejas kodu

:ship: bump to version 4.0.0

tags/v4.0.0
Phillip Johnsen pirms 6 gadiem
vecāks
revīzija
aca97b82c8
7 mainītis faili ar 54 papildinājumiem un 6 dzēšanām
  1. +48
    -0
      CHANGELOG.md
  2. +1
    -1
      mustache.js
  3. +1
    -1
      mustache.js.nuspec
  4. +1
    -1
      mustache.min.js
  5. +1
    -1
      mustache.mjs
  6. +1
    -1
      package-lock.json
  7. +1
    -1
      package.json

+ 48
- 0
CHANGELOG.md Parādīt failu

@@ -3,6 +3,50 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). 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 ## [3.2.1] / 30 December 2019


### Fixed ### Fixed
@@ -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]). * Fixed a bug that clashed with QUnit (thanks [@kannix]).
* Added volo support (thanks [@guybedford]). * 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.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.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 [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
[#717]: https://github.com/janl/mustache.js/issues/717 [#717]: https://github.com/janl/mustache.js/issues/717
[#728]: https://github.com/janl/mustache.js/issues/728 [#728]: https://github.com/janl/mustache.js/issues/728
[#733]: https://github.com/janl/mustache.js/issues/733 [#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 [@afc163]: https://github.com/afc163
[@andersk]: https://github.com/andersk [@andersk]: https://github.com/andersk
[@Andersos]: https://github.com/Andersos [@Andersos]: https://github.com/Andersos
[@AndrewLeedham]: https://github.com/AndrewLeedham
[@bbrooks]: https://github.com/bbrooks [@bbrooks]: https://github.com/bbrooks
[@calvinf]: https://github.com/calvinf [@calvinf]: https://github.com/calvinf
[@cmbuckley]: https://github.com/cmbuckley [@cmbuckley]: https://github.com/cmbuckley


+ 1
- 1
mustache.js Parādīt failu

@@ -666,7 +666,7 @@


var mustache = { var mustache = {
name: 'mustache.js', name: 'mustache.js',
version: '3.2.1',
version: '4.0.0',
tags: [ '{{', '}}' ], tags: [ '{{', '}}' ],
clearCache: undefined, clearCache: undefined,
escape: undefined, escape: undefined,


+ 1
- 1
mustache.js.nuspec Parādīt failu

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>mustache.js</id> <id>mustache.js</id>
<version>3.2.1</version>
<version>4.0.0</version>
<authors>mustache.js Authors</authors> <authors>mustache.js Authors</authors>
<licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/janl/mustache.js/blob/master/LICENSE</licenseUrl>
<projectUrl>http://mustache.github.com/</projectUrl> <projectUrl>http://mustache.github.com/</projectUrl>


+ 1
- 1
mustache.min.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 1
- 1
mustache.mjs Parādīt failu

@@ -659,7 +659,7 @@ Writer.prototype.rawValue = function rawValue (token) {


var mustache = { var mustache = {
name: 'mustache.js', name: 'mustache.js',
version: '3.2.1',
version: '4.0.0',
tags: [ '{{', '}}' ], tags: [ '{{', '}}' ],
clearCache: undefined, clearCache: undefined,
escape: undefined, escape: undefined,


+ 1
- 1
package-lock.json Parādīt failu

@@ -1,6 +1,6 @@
{ {
"name": "mustache", "name": "mustache",
"version": "3.2.1",
"version": "4.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {


+ 1
- 1
package.json Parādīt failu

@@ -1,6 +1,6 @@
{ {
"name": "mustache", "name": "mustache",
"version": "3.2.1",
"version": "4.0.0",
"description": "Logic-less {{mustache}} templates with JavaScript", "description": "Logic-less {{mustache}} templates with JavaScript",
"author": "mustache.js Authors <http://github.com/janl/mustache.js>", "author": "mustache.js Authors <http://github.com/janl/mustache.js>",
"homepage": "https://github.com/janl/mustache.js", "homepage": "https://github.com/janl/mustache.js",


Notiek ielāde…
Atcelt
Saglabāt