No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

CHANGELOG.md 15KB

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