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 2.0KB

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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {
  2. "name": "mustache",
  3. "version": "4.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. "bin/",
  23. "mustache.mjs",
  24. "mustache.min.js",
  25. "wrappers/"
  26. ],
  27. "exports": {
  28. ".": {
  29. "import": "./mustache.mjs",
  30. "require": "./mustache.js"
  31. },
  32. "./*": "./*"
  33. },
  34. "volo": {
  35. "url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js"
  36. },
  37. "scripts": {
  38. "build": "cp mustache.js mustache.mjs && rollup mustache.mjs --file mustache.js --format umd --name Mustache && uglifyjs mustache.js > mustache.min.js",
  39. "test": "npm run test-lint && npm run test-unit",
  40. "test-lint": "eslint mustache.js bin/mustache test/**/*.js",
  41. "test-unit": "mocha --reporter spec test/*-test.js",
  42. "test-render": "mocha --reporter spec test/render-test",
  43. "pre-test-browser": "node test/create-browser-suite.js",
  44. "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",
  45. "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",
  46. "postversion": "scripts/bump-version-in-source",
  47. "prepublishOnly": "npm run build"
  48. },
  49. "devDependencies": {
  50. "chai": "^3.4.0",
  51. "eslint": "^6.5.1",
  52. "esm": "^3.2.25",
  53. "jshint": "^2.9.5",
  54. "mocha": "^3.0.2",
  55. "puppeteer": "^2.0.0",
  56. "rollup": "^1.26.3",
  57. "uglify-js": "^3.4.6",
  58. "zuul": "^3.11.0",
  59. "zuul-ngrok": "nolanlawson/zuul-ngrok#patch-1"
  60. },
  61. "greenkeeper": {
  62. "ignore": [
  63. "eslint"
  64. ]
  65. },
  66. "license": "MIT"
  67. }