Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12 anos atrás
12 anos atrás
13 anos atrás
13 anos atrás
13 anos atrás
13 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. # Change Log
  2. All notable changes to this project will be documented in this file.
  3. This project adheres to [Semantic Versioning](http://semver.org/).
  4. ## [3.0.3] / 27 August 2019
  5. ### Added
  6. * [#713]: Add test cases for custom functions in partials, by [@wol-soft].
  7. ### Fixed
  8. * [#714]: Bugfix for wrong function output in partials with indentation, by [@phillipj].
  9. ## [3.0.2] / 21 August 2019
  10. ### Fixed
  11. * [#705]: Fix indentation of partials, by [@kevindew] and [@yotammadem].
  12. ### Dev
  13. * [#701]: Fix test failure for Node 10 and above, by [@andersk].
  14. * [#704]: Lint all test files just like the source files, by [@phillipj].
  15. * Start experimenting & comparing GitHub Actions vs Travis CI, by [@phillipj].
  16. ## [3.0.1] / 11 November 2018
  17. * [#679]: Fix partials not rendering tokens when using custom tags, by [@stackchain].
  18. ## [3.0.0] / 16 September 2018
  19. We are very happy to announce a new major version of mustache.js. We want to be very careful not to break projects
  20. out in the wild, and adhering to [Semantic Versioning](http://semver.org/) we have therefore cut this new major version.
  21. The changes introduced will likely not require any actions for most using projects. The things to look out for that
  22. might cause unexpected rendering results are described in the migration guide below.
  23. A big shout out and thanks to [@raymond-lam] for this release! Without his contributions with code and issue triaging,
  24. this release would never have happened.
  25. ### Major
  26. * [#618]: Allow rendering properties of primitive types that are not objects, by [@raymond-lam].
  27. * [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam].
  28. * [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki].
  29. ### Minor
  30. * [#673]: Add `tags` parameter to `Mustache.render()`, by [@raymond-lam].
  31. ### Migrating from mustache.js v2.x to v3.x
  32. #### Rendering properties of primitive types
  33. We have ensured properties of primitive types can be rendered at all times. That means `Array.length`, `String.length`
  34. and similar. A corner case where this could cause unexpected output follows:
  35. View:
  36. ```
  37. {
  38. stooges: [
  39. { name: "Moe" },
  40. { name: "Larry" },
  41. { name: "Curly" }
  42. ]
  43. }
  44. ```
  45. Template:
  46. ```
  47. {{#stooges}}
  48. {{name}}: {{name.length}} characters
  49. {{/stooges}}
  50. ```
  51. Output with v3.0:
  52. ```
  53. Moe: 3 characters
  54. Larry: 5 characters
  55. Curly: 5 characters
  56. ```
  57. Output with v2.x:
  58. ```
  59. Moe: characters
  60. Larry: characters
  61. Curly: characters
  62. ```
  63. #### Caching for templates with custom delimiters
  64. We have improved the templates cache to ensure custom delimiters are taken into consideration for the cache.
  65. This improvement might cause unexpected rendering behaviour for using projects actively using the custom delimiters functionality.
  66. Previously it was possible to use `Mustache.parse()` as a means to set global custom delimiters. If custom
  67. delimiters were provided as an argument, it would affect all following calls to `Mustache.render()`.
  68. Consider the following:
  69. ```js
  70. const template = "[[item.title]] [[item.value]]";
  71. mustache.parse(template, ["[[", "]]"]);
  72. console.log(
  73. mustache.render(template, {
  74. item: {
  75. title: "TEST",
  76. value: 1
  77. }
  78. })
  79. );
  80. >> TEST 1
  81. ```
  82. The above illustrates the fact that `Mustache.parse()` made mustache.js cache the template without considering
  83. the custom delimiters provided. This is no longer true.
  84. We no longer encourage using `Mustache.parse()` for this purpose, but have rather added a fourth argument to
  85. `Mustache.render()` letting you provide custom delimiters when rendering.
  86. If you still need the pre-parse the template and use custom delimiters at the same time, ensure to provide
  87. the custom delimiters as argument to `Mustache.render()` as well.
  88. ## [2.3.2] / 17 August 2018
  89. This release is made to revert changes introduced in [2.3.1] that caused unexpected behaviour for several users.
  90. ### Minor
  91. * [#670]: Rollback template cache causing unexpected behaviour, by [@raymond-lam].
  92. ## [2.3.1] / 7 August 2018
  93. ### Minor
  94. * [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam].
  95. * [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki].
  96. ### Dev
  97. * [#666]: Install release tools with npm rather than pre-commit hook & `Rakefile`, by [@phillipj].
  98. * [#667], [#668]: Stabilize browser test suite, by [@phillipj].
  99. ### Docs
  100. * [#644]: Document global Mustache.escape overriding capacity, by [@paultopia].
  101. * [#657]: Correct `Mustache.parse()` return type documentation, by [@bbrooks].
  102. ## [2.3.0] / 8 November 2016
  103. ### Minor
  104. * [#540]: Add optional `output` argument to mustache CLI, by [@wizawu].
  105. * [#597]: Add compatibility with amdclean, by [@mightyplow].
  106. ### Dev
  107. * [#553]: Assert `null` lookup when rendering an unescaped value, by [@dasilvacontin].
  108. * [#580], [#610]: Ignore eslint for greenkeeper updates, by [@phillipj].
  109. * [#560]: Fix CLI tests for Windows, by [@kookookchoozeus].
  110. * Run browser tests w/node v4, by [@phillipj].
  111. ### Docs
  112. * [#542]: Add API documentation to README, by [@tomekwi].
  113. * [#546]: Add missing syntax highlighting to README code blocks, by [@pra85].
  114. * [#569]: Update Ctemplate links in README, by [@mortonfox].
  115. * [#592]: Change "loadUser" to "loadUser()" in README, by [@Flaque].
  116. * [#593]: Adding doctype to HTML code example in README, by [@calvinf].
  117. ### Dependencies
  118. * eslint -> 2.2.0. Breaking changes fix by [@phillipj]. [#548]
  119. * eslint -> 2.5.1.
  120. * mocha -> 3.0.2.
  121. * zuul -> 3.11.0.
  122. ## [2.2.1] / 13 December 2015
  123. ### Fixes
  124. * Improve HTML escaping, by [@phillipj].
  125. * Fix inconsistency in defining global mustache object, by [@simast].
  126. * Fix switch-case indent error, by [@norfish].
  127. * Unpin chai and eslint versions, by [@dasilvacontin].
  128. * Update README.md with proper grammar, by [@EvanLovely].
  129. * Update mjackson username in README, by [@mjackson].
  130. * Remove syntax highlighting in README code sample, by [@imagentleman].
  131. * Fix typo in README, by [@Xcrucifier].
  132. * Fix link typo in README, by [@keirog].
  133. ## [2.2.0] / 15 October 2015
  134. ### Added
  135. * Add Partials support to CLI, by [@palkan].
  136. ### Changed
  137. * Move install instructions to README's top, by [@mateusortiz]
  138. * Improved devhook install output, by [@ShashankaNataraj].
  139. * Clarifies and improves language in documentation, by [@jfmercer].
  140. * Linting CLI tool, by [@phillipj].
  141. * npm 2.x and node v4 on Travis, by [@phillipj].
  142. ### Fixes
  143. * Fix README spelling error to "aforementioned", by [@djchie].
  144. * Equal error message test in .render() for server and browser, by [@phillipj].
  145. ### Dependencies
  146. * chai -> 3.3.0
  147. * eslint -> 1.6.0
  148. ## [2.1.3] / 23 July 2015
  149. ### Added
  150. * Throw error when providing .render() with invalid template type, by [@phillipj].
  151. * Documents use of string literals containing double quotes, by [@jfmercer].
  152. ### Changed
  153. * Move mustache gif to githubusercontent, by [@Andersos].
  154. ### Fixed
  155. * Update UMD Shim to be resilient to HTMLElement global pollution, by [@mikesherov].
  156. ## [2.1.2] / 17 June 2015
  157. ### Added
  158. * Mustache global definition ([#466]) by [@yousefcisco].
  159. ## [2.1.1] / 11 June 2015
  160. ### Added
  161. * State that we use semver on the change log, by [@dasilvacontin].
  162. * Added version links to change log, by [@dasilvacontin].
  163. ### Fixed
  164. * Bugfix for using values from view's context prototype, by [@phillipj].
  165. * Improve test with undefined/null lookup hit using dot notation, by [@dasilvacontin].
  166. * Bugfix for null/undefined lookup hit when using dot notation, by [@phillipj].
  167. * Remove moot `version` property from bower.json, by [@kkirsche].
  168. * bower.json doesn't require a version bump via hook, by [@dasilvacontin].
  169. ## [2.1.0] / 5 June 2015
  170. * Added license attribute to package.json, by [@pgilad].
  171. * Minor changes to make mustache.js compatible with both WSH and ASP, by [@nagaozen].
  172. * Improve CLI view parsing error, by [@phillipj].
  173. * Bugfix for view context cache, by [@phillipj].
  174. ## [2.0.0] / 27 Mar 2015
  175. * Fixed lookup not stopping upon finding `undefined` or `null` values, by [@dasilvacontin].
  176. * Refactored pre-commit hook, by [@dasilvacontin].
  177. ## [1.2.0] / 24 Mar 2015
  178. * Added -v option to CLI, by [@phillipj].
  179. * Bugfix for rendering Number when it serves as the Context, by [@phillipj].
  180. * Specified files in package.json for a cleaner install, by [@phillipj].
  181. ## [1.1.0] / 18 Feb 2015
  182. * Refactor Writer.renderTokens() for better readability, by [@phillipj].
  183. * Cleanup tests section in readme, by [@phillipj].
  184. * Added JSHint to tests/CI, by [@phillipj].
  185. * Added node v0.12 on travis, by [@phillipj].
  186. * Created command line tool, by [@phillipj].
  187. * Added *falsy* to Inverted Sections description in README, by [@kristijanmatic].
  188. ## [1.0.0] / 20 Dec 2014
  189. * Inline tag compilation, by [@mjackson].
  190. * Fixed AMD registration, volo package.json entry, by [@jrburke].
  191. * Added spm support, by [@afc163].
  192. * Only access properties of objects on Context.lookup, by [@cmbuckley].
  193. ## [0.8.2] / 17 Mar 2014
  194. * Supporting Bower through a bower.json file.
  195. ## [0.8.1] / 3 Jan 2014
  196. * Fix usage of partial templates.
  197. ## [0.8.0] / 2 Dec 2013
  198. * Remove compile* writer functions, use mustache.parse instead. Smaller API.
  199. * Throw an error when rendering a template that contains higher-order sections and
  200. the original template is not provided.
  201. * Remove low-level Context.make function.
  202. * Better code readability and inline documentation.
  203. * Stop caching templates by name.
  204. ## [0.7.3] / 5 Nov 2013
  205. * Don't require the original template to be passed to the rendering function
  206. when using compiled templates. This is still required when using higher-order
  207. functions in order to be able to extract the portion of the template
  208. that was contained by that section. Fixes [#262].
  209. * Performance improvements.
  210. ## [0.7.2] / 27 Dec 2012
  211. * Fixed a rendering bug ([#274]) when using nested higher-order sections.
  212. * Better error reporting on failed parse.
  213. * Converted tests to use mocha instead of vows.
  214. ## [0.7.1] / 6 Dec 2012
  215. * Handle empty templates gracefully. Fixes [#265], [#267], and [#270].
  216. * Cache partials by template, not by name. Fixes [#257].
  217. * Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes
  218. [#258].
  219. ## [0.7.0] / 10 Sep 2012
  220. * Rename Renderer => Writer.
  221. * Allow partials to be loaded dynamically using a callback (thanks
  222. [@TiddoLangerak] for the suggestion).
  223. * Fixed a bug with higher-order sections that prevented them from being
  224. passed the raw text of the section from the original template.
  225. * More concise token format. Tokens also include start/end indices in the
  226. original template.
  227. * High-level API is consistent with the Writer API.
  228. * Allow partials to be passed to the pre-compiled function (thanks
  229. [@fallenice]).
  230. * Don't use eval (thanks [@cweider]).
  231. ## [0.6.0] / 31 Aug 2012
  232. * Use JavaScript's definition of falsy when determining whether to render an
  233. inverted section or not. Issue [#186].
  234. * Use Mustache.escape to escape values inside {{}}. This function may be
  235. reassigned to alter the default escaping behavior. Issue [#244].
  236. * Fixed a bug that clashed with QUnit (thanks [@kannix]).
  237. * Added volo support (thanks [@guybedford]).
  238. [3.0.3]: https://github.com/janl/mustache.js/compare/v3.0.2...v3.0.3
  239. [3.0.2]: https://github.com/janl/mustache.js/compare/v3.0.1...v3.0.2
  240. [3.0.1]: https://github.com/janl/mustache.js/compare/v3.0.0...v3.0.1
  241. [3.0.0]: https://github.com/janl/mustache.js/compare/v2.3.2...v3.0.0
  242. [2.3.2]: https://github.com/janl/mustache.js/compare/v2.3.1...v2.3.2
  243. [2.3.1]: https://github.com/janl/mustache.js/compare/v2.3.0...v2.3.1
  244. [2.3.0]: https://github.com/janl/mustache.js/compare/v2.2.1...v2.3.0
  245. [2.2.1]: https://github.com/janl/mustache.js/compare/v2.2.0...v2.2.1
  246. [2.2.0]: https://github.com/janl/mustache.js/compare/v2.1.3...v2.2.0
  247. [2.1.3]: https://github.com/janl/mustache.js/compare/v2.1.2...v2.1.3
  248. [2.1.2]: https://github.com/janl/mustache.js/compare/v2.1.1...v2.1.2
  249. [2.1.1]: https://github.com/janl/mustache.js/compare/v2.1.0...v2.1.1
  250. [2.1.0]: https://github.com/janl/mustache.js/compare/v2.0.0...v2.1.0
  251. [2.0.0]: https://github.com/janl/mustache.js/compare/v1.2.0...v2.0.0
  252. [1.2.0]: https://github.com/janl/mustache.js/compare/v1.1.0...v1.2.0
  253. [1.1.0]: https://github.com/janl/mustache.js/compare/v1.0.0...v1.1.0
  254. [1.0.0]: https://github.com/janl/mustache.js/compare/0.8.2...v1.0.0
  255. [0.8.2]: https://github.com/janl/mustache.js/compare/0.8.1...0.8.2
  256. [0.8.1]: https://github.com/janl/mustache.js/compare/0.8.0...0.8.1
  257. [0.8.0]: https://github.com/janl/mustache.js/compare/0.7.3...0.8.0
  258. [0.7.3]: https://github.com/janl/mustache.js/compare/0.7.2...0.7.3
  259. [0.7.2]: https://github.com/janl/mustache.js/compare/0.7.1...0.7.2
  260. [0.7.1]: https://github.com/janl/mustache.js/compare/0.7.0...0.7.1
  261. [0.7.0]: https://github.com/janl/mustache.js/compare/0.6.0...0.7.0
  262. [0.6.0]: https://github.com/janl/mustache.js/compare/0.5.2...0.6.0
  263. [#186]: https://github.com/janl/mustache.js/issues/186
  264. [#244]: https://github.com/janl/mustache.js/issues/244
  265. [#257]: https://github.com/janl/mustache.js/issues/257
  266. [#258]: https://github.com/janl/mustache.js/issues/258
  267. [#262]: https://github.com/janl/mustache.js/issues/262
  268. [#265]: https://github.com/janl/mustache.js/issues/265
  269. [#267]: https://github.com/janl/mustache.js/issues/267
  270. [#270]: https://github.com/janl/mustache.js/issues/270
  271. [#274]: https://github.com/janl/mustache.js/issues/274
  272. [#466]: https://github.com/janl/mustache.js/issues/466
  273. [#540]: https://github.com/janl/mustache.js/issues/540
  274. [#542]: https://github.com/janl/mustache.js/issues/542
  275. [#546]: https://github.com/janl/mustache.js/issues/546
  276. [#548]: https://github.com/janl/mustache.js/issues/548
  277. [#553]: https://github.com/janl/mustache.js/issues/553
  278. [#560]: https://github.com/janl/mustache.js/issues/560
  279. [#569]: https://github.com/janl/mustache.js/issues/569
  280. [#580]: https://github.com/janl/mustache.js/issues/580
  281. [#592]: https://github.com/janl/mustache.js/issues/592
  282. [#593]: https://github.com/janl/mustache.js/issues/593
  283. [#597]: https://github.com/janl/mustache.js/issues/597
  284. [#610]: https://github.com/janl/mustache.js/issues/610
  285. [#643]: https://github.com/janl/mustache.js/issues/643
  286. [#644]: https://github.com/janl/mustache.js/issues/644
  287. [#657]: https://github.com/janl/mustache.js/issues/657
  288. [#664]: https://github.com/janl/mustache.js/issues/664
  289. [#666]: https://github.com/janl/mustache.js/issues/666
  290. [#667]: https://github.com/janl/mustache.js/issues/667
  291. [#668]: https://github.com/janl/mustache.js/issues/668
  292. [#670]: https://github.com/janl/mustache.js/issues/670
  293. [#618]: https://github.com/janl/mustache.js/issues/618
  294. [#673]: https://github.com/janl/mustache.js/issues/673
  295. [#679]: https://github.com/janl/mustache.js/issues/679
  296. [#701]: https://github.com/janl/mustache.js/issues/701
  297. [#704]: https://github.com/janl/mustache.js/issues/704
  298. [#705]: https://github.com/janl/mustache.js/issues/705
  299. [#713]: https://github.com/janl/mustache.js/issues/713
  300. [#714]: https://github.com/janl/mustache.js/issues/714
  301. [@afc163]: https://github.com/afc163
  302. [@andersk]: https://github.com/andersk
  303. [@Andersos]: https://github.com/Andersos
  304. [@bbrooks]: https://github.com/bbrooks
  305. [@calvinf]: https://github.com/calvinf
  306. [@cmbuckley]: https://github.com/cmbuckley
  307. [@cweider]: https://github.com/cweider
  308. [@dasilvacontin]: https://github.com/dasilvacontin
  309. [@djchie]: https://github.com/djchie
  310. [@EvanLovely]: https://github.com/EvanLovely
  311. [@fallenice]: https://github.com/fallenice
  312. [@Flaque]: https://github.com/Flaque
  313. [@guybedford]: https://github.com/guybedford
  314. [@imagentleman]: https://github.com/imagentleman
  315. [@jfmercer]: https://github.com/jfmercer
  316. [@jrburke]: https://github.com/jrburke
  317. [@kannix]: https://github.com/kannix
  318. [@keirog]: https://github.com/keirog
  319. [@kkirsche]: https://github.com/kkirsche
  320. [@kookookchoozeus]: https://github.com/kookookchoozeus
  321. [@kristijanmatic]: https://github.com/kristijanmatic
  322. [@kevindew]: https://github.com/kevindew
  323. [@mateusortiz]: https://github.com/mateusortiz
  324. [@mightyplow]: https://github.com/mightyplow
  325. [@mikesherov]: https://github.com/mikesherov
  326. [@mjackson]: https://github.com/mjackson
  327. [@mortonfox]: https://github.com/mortonfox
  328. [@nagaozen]: https://github.com/nagaozen
  329. [@norfish]: https://github.com/norfish
  330. [@palkan]: https://github.com/palkan
  331. [@paultopia]: https://github.com/paultopia
  332. [@pgilad]: https://github.com/pgilad
  333. [@phillipj]: https://github.com/phillipj
  334. [@pra85]: https://github.com/pra85
  335. [@raymond-lam]: https://github.com/raymond-lam
  336. [@seminaoki]: https://github.com/seminaoki
  337. [@ShashankaNataraj]: https://github.com/ShashankaNataraj
  338. [@simast]: https://github.com/simast
  339. [@stackchain]: https://github.com/stackchain
  340. [@TiddoLangerak]: https://github.com/TiddoLangerak
  341. [@tomekwi]: https://github.com/tomekwi
  342. [@wizawu]: https://github.com/wizawu
  343. [@Xcrucifier]: https://github.com/Xcrucifier
  344. [@yotammadem]: https://github.com/yotammadem
  345. [@yousefcisco]: https://github.com/yousefcisco
  346. [@wol-soft]: https://github.com/wol-soft