Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

package.json 1.6KB

Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
il y a 13 ans
Use ngrok rather than localtunnel when running browser tests (#668) These changes makes zuul use ngrok for exposing itself to the outside world, rather than the default localtunnel implementation. That's because we've had quite a lot of issues with flakyness which seems to be related to localtunnel, e.g.: ``` - starting: <internet explorer 9 on Windows 2008> events.js:160 throw er; // Unhandled 'error' event ^ Error: connection refused: localtunnel.me:44896 (check your firewall settings) at Socket.<anonymous> (/home/travis/build/janl/mustache.js/node_modules/localtunnel/client.js:84:32) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1290:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) ``` I thought this was fixed by [using Node.js 6 instead of Node.js 4](https://github.com/janl/mustache.js/pull/667), but sadly that was not the case as it re-appeared with Node.js 6 as well. Had to use a [custom version of zuul-ngrok](https://github.com/rase-/zuul-ngrok/pull/12) which contains a newer version of ngrok. The dependency used by the upstream module threw an error when running on my computer, the updated version worked as a charm though. We should change to using the upstream module as soon as the PR with that ngrok version bump lands. Set `concurrency: 1` otherwise ngrok would fail and make IE11 tests stall forever because of too many connections being made within a short time period. I've notice it can take quite some time (20+ minutes) to get all the tests through as it seems ngrok still seems to throttle the connections somehow, but the important thing is getting these tests to work.
il y a 7 ans
il y a 11 ans
Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {
  2. "name": "mustache",
  3. "version": "3.1.0",
  4. "description": "Logic-less {{mustache}} templates with JavaScript",
  5. "author": "mustache.js Authors <http://github.com/janl/mustache.js>",
  6. "homepage": "https://github.com/janl/mustache.js",
  7. "repository": {
  8. "type": "git",
  9. "url": "https://github.com/janl/mustache.js.git"
  10. },
  11. "keywords": [
  12. "mustache",
  13. "template",
  14. "templates",
  15. "ejs"
  16. ],
  17. "main": "./mustache.js",
  18. "bin": {
  19. "mustache": "./bin/mustache"
  20. },
  21. "files": [
  22. "mustache.js",
  23. "mustache.min.js",
  24. "bin",
  25. "wrappers",
  26. "LICENSE"
  27. ],
  28. "volo": {
  29. "url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js"
  30. },
  31. "engines": {
  32. "npm": ">=1.4.0"
  33. },
  34. "scripts": {
  35. "test": "npm run test-lint && npm run test-unit",
  36. "test-lint": "eslint mustache.js bin/mustache test/**/*.js",
  37. "test-unit": "mocha --reporter spec test/*-test.js",
  38. "test-render": "mocha --reporter spec test/render-test",
  39. "pre-test-browser": "node test/create-browser-suite.js",
  40. "test-browser": "npm run pre-test-browser && zuul -- test/context-test.js test/parse-test.js test/scanner-test.js test/render-test-browser.js",
  41. "test-browser-local": "npm run pre-test-browser && zuul --local 8080 -- test/context-test.js test/scanner-test.js test/parse-test.js test/render-test-browser.js"
  42. },
  43. "devDependencies": {
  44. "chai": "^3.4.0",
  45. "eslint": "^6.5.1",
  46. "jshint": "^2.9.5",
  47. "mocha": "^3.0.2",
  48. "uglify-js": "^3.4.6",
  49. "zuul": "^3.11.0",
  50. "zuul-ngrok": "nolanlawson/zuul-ngrok#patch-1"
  51. },
  52. "greenkeeper": {
  53. "ignore": [
  54. "eslint"
  55. ]
  56. },
  57. "license": "MIT"
  58. }