@rhinostone/swig 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/HISTORY.md +14 -0
  2. package/ROADMAP.md +11 -0
  3. package/bin/swig.js +272 -87
  4. package/dist/swig.js +120 -41
  5. package/dist/swig.min.js +2 -2
  6. package/dist/swig.min.js.map +1 -1
  7. package/lib/filters.js +23 -20
  8. package/lib/swig.js +13 -2
  9. package/lib/tags/import.js +42 -21
  10. package/lib/tags/include.js +4 -0
  11. package/package.json +3 -4
  12. package/.changes/unreleased/.gitkeep +0 -0
  13. package/.changes/v0.1.2.md +0 -6
  14. package/.changes/v0.1.3.md +0 -6
  15. package/.changes/v0.1.5.md +0 -11
  16. package/.changes/v0.1.6.md +0 -6
  17. package/.changes/v0.1.7.md +0 -7
  18. package/.changes/v0.1.8.md +0 -7
  19. package/.changes/v0.1.9.md +0 -7
  20. package/.changes/v0.10.0.md +0 -11
  21. package/.changes/v0.11.0.md +0 -15
  22. package/.changes/v0.11.1.md +0 -6
  23. package/.changes/v0.11.2.md +0 -6
  24. package/.changes/v0.12.0.md +0 -7
  25. package/.changes/v0.12.1.md +0 -11
  26. package/.changes/v0.13.0.md +0 -8
  27. package/.changes/v0.13.1.md +0 -8
  28. package/.changes/v0.13.2.md +0 -9
  29. package/.changes/v0.13.3.md +0 -5
  30. package/.changes/v0.13.4.md +0 -5
  31. package/.changes/v0.13.5.md +0 -4
  32. package/.changes/v0.14.0.md +0 -6
  33. package/.changes/v0.2.0.md +0 -7
  34. package/.changes/v0.2.1.md +0 -6
  35. package/.changes/v0.2.2.md +0 -6
  36. package/.changes/v0.2.3.md +0 -10
  37. package/.changes/v0.3.0.md +0 -6
  38. package/.changes/v0.4.0.md +0 -11
  39. package/.changes/v0.5.0.md +0 -11
  40. package/.changes/v0.6.0.md +0 -12
  41. package/.changes/v0.6.1.md +0 -6
  42. package/.changes/v0.7.0.md +0 -7
  43. package/.changes/v0.8.0.md +0 -18
  44. package/.changes/v0.9.0.md +0 -13
  45. package/.changes/v0.9.1.md +0 -6
  46. package/.changes/v0.9.2.md +0 -6
  47. package/.changes/v0.9.3.md +0 -6
  48. package/.changes/v0.9.4.md +0 -10
  49. package/.changes/v1.0.0-pre1.md +0 -22
  50. package/.changes/v1.0.0-pre2.md +0 -18
  51. package/.changes/v1.0.0-pre3.md +0 -7
  52. package/.changes/v1.0.0-rc1.md +0 -12
  53. package/.changes/v1.0.0-rc2.md +0 -10
  54. package/.changes/v1.0.0-rc3.md +0 -7
  55. package/.changes/v1.0.0.md +0 -7
  56. package/.changes/v1.1.0.md +0 -6
  57. package/.changes/v1.2.0.md +0 -10
  58. package/.changes/v1.2.1.md +0 -4
  59. package/.changes/v1.2.2.md +0 -4
  60. package/.changes/v1.3.0.md +0 -14
  61. package/.changes/v1.3.2.md +0 -6
  62. package/.changes/v1.4.0.md +0 -13
  63. package/.changes/v1.4.1.md +0 -5
  64. package/.changes/v1.4.2.md +0 -10
  65. package/.changes/v1.4.3.md +0 -4
  66. package/.changes/v1.4.4.md +0 -6
  67. package/.changes/v1.4.5.md +0 -10
  68. package/.changes/v1.4.6.md +0 -6
  69. package/.changes/v1.4.7.md +0 -8
  70. package/.changes/v1.5.0.md +0 -4
  71. package/.changes/v1.6.0.md +0 -4
  72. package/.changes/v2.0.0-alpha.1.md +0 -4
  73. package/.changes/v2.0.0-alpha.2.md +0 -4
  74. package/.changes/v2.0.0-alpha.4.md +0 -10
  75. package/.changes/v2.0.0-alpha.5.md +0 -16
  76. package/.changes/v2.0.0-alpha.6.md +0 -4
  77. package/.changes/v2.0.0-alpha.7.md +0 -4
  78. package/.changes/v2.0.0-alpha.8.md +0 -4
  79. package/.changes/v2.0.0.md +0 -6
  80. package/.changes/v2.0.1.md +0 -8
  81. package/.changes/v2.1.0.md +0 -8
  82. package/.playwright-mcp/console-2026-04-22T15-34-20-480Z.log +0 -2
  83. package/.playwright-mcp/console-2026-04-22T15-35-04-265Z.log +0 -11
  84. package/.playwright-mcp/console-2026-04-22T15-37-26-953Z.log +0 -1
  85. package/.playwright-mcp/console-2026-04-22T15-51-15-160Z.log +0 -148
  86. package/.playwright-mcp/console-2026-04-22T15-51-33-405Z.log +0 -74
  87. package/.playwright-mcp/console-2026-04-22T15-51-53-922Z.log +0 -74
  88. package/.playwright-mcp/console-2026-04-22T15-53-10-736Z.log +0 -74
  89. package/.playwright-mcp/console-2026-04-22T15-53-40-091Z.log +0 -883
  90. package/.playwright-mcp/console-2026-04-22T16-12-02-541Z.log +0 -74
  91. package/.playwright-mcp/console-2026-04-22T16-33-44-982Z.log +0 -13973
  92. package/.playwright-mcp/page-2026-04-22T15-34-24-524Z.yml +0 -1
  93. package/.playwright-mcp/page-2026-04-22T15-35-04-346Z.yml +0 -0
  94. package/.playwright-mcp/page-2026-04-22T15-37-27-039Z.yml +0 -5
  95. package/.playwright-mcp/page-2026-04-22T15-51-15-600Z.yml +0 -76
  96. package/.playwright-mcp/page-2026-04-22T15-51-33-605Z.yml +0 -0
  97. package/.playwright-mcp/page-2026-04-22T15-51-54-206Z.yml +0 -676
  98. package/.playwright-mcp/page-2026-04-22T15-53-11-277Z.yml +0 -632
  99. package/.playwright-mcp/page-2026-04-22T15-53-40-297Z.yml +0 -0
  100. package/.playwright-mcp/page-2026-04-22T16-12-02-855Z.yml +0 -0
  101. package/.playwright-mcp/page-2026-04-22T16-33-45-281Z.yml +0 -0
package/lib/swig.js CHANGED
@@ -10,11 +10,11 @@ var utils = require('./utils'),
10
10
  /**
11
11
  * Swig version number as a string.
12
12
  * @example
13
- * if (swig.version === "2.1.0") { ... }
13
+ * if (swig.version === "2.3.0") { ... }
14
14
  *
15
15
  * @type {String}
16
16
  */
17
- exports.version = "2.1.0";
17
+ exports.version = "2.3.0";
18
18
 
19
19
  /**
20
20
  * Swig Options Object. This object can be passed to many of the API-level Swig methods to control various aspects of the engine. All keys are optional.
@@ -201,6 +201,11 @@ exports.Swig = function (opts) {
201
201
  * pre-resolved and will throw at render time as they would on the sync
202
202
  * path.
203
203
  *
204
+ * @deprecated since 2.3.0 — use {@link Swig#renderFile} with a loader that
205
+ * sets <code>loader.async === true</code>. The async-codegen dispatch
206
+ * handles dynamic include paths the pre-walker cannot. This method will
207
+ * be removed in 3.0.
208
+ *
204
209
  * @example
205
210
  * swig.setDefaults({ loader: myAsyncLoader });
206
211
  * swig.renderFileAsync('page.html', { name: 'world' }, function (err, output) {
@@ -260,6 +265,12 @@ exports.Swig = function (opts) {
260
265
  * temporarily swaps the loader on each call, so subsequent runtime
261
266
  * <var>include</var>s resolve correctly without re-running the pre-walk.
262
267
  *
268
+ * @deprecated since 2.3.0 — use {@link Swig#compileFile} with
269
+ * <code>options.codegenMode === 'async'</code> on a loader that sets
270
+ * <code>loader.async === true</code>. The returned compiled function
271
+ * yields a <code>Promise&lt;{output, exports}&gt;</code> instead of a
272
+ * string. This method will be removed in 3.0.
273
+ *
263
274
  * @example
264
275
  * swig.compileFileAsync('page.html', {}, function (err, fn) {
265
276
  * if (err) { return done(err); }
@@ -1,4 +1,5 @@
1
1
  var utils = require('../utils'),
2
+ ir = require('@rhinostone/swig-core/lib/ir'),
2
3
  backend = require('@rhinostone/swig-core/lib/backend');
3
4
 
4
5
  // CVE-2023-25345: prototype-chain properties that must not be used as import
@@ -26,7 +27,19 @@ var _dangerousProps = require('@rhinostone/swig-core/lib/security').dangerousPro
26
27
  * @param {literal} as Literally, "as".
27
28
  * @param {literal} varname Local-accessible object name to assign the macros to.
28
29
  */
29
- exports.compile = function (compiler, args) {
30
+ exports.compile = function (compiler, args, content, parents, options) {
31
+ // Phase 2 (#T22): async-codegen branch. Parse stashed `[{path}, alias]`
32
+ // (no macro pre-render in async mode); emit IRImportDeferred so the
33
+ // backend's `_swig.getTemplate` + `.exports` bind happens at runtime.
34
+ if (options && options.codegenMode === 'async') {
35
+ var asyncAlias = args[args.length - 1];
36
+ var asyncPath = args[0].path;
37
+ return ir.importDeferred(
38
+ ir.literal('string', asyncPath),
39
+ asyncAlias,
40
+ options.filename || ''
41
+ );
42
+ }
30
43
  var ctx = args.pop(),
31
44
  allMacros = utils.map(args, function (arg) {
32
45
  return arg.name;
@@ -56,37 +69,45 @@ exports.parse = function (str, line, parser, types, stack, opts, swig) {
56
69
  var compiler = require('../parser').compile,
57
70
  parseOpts = { resolveFrom: opts.filename },
58
71
  compileOpts = utils.extend({}, opts, parseOpts),
59
- tokens,
72
+ isAsync = !!(opts && opts.codegenMode === 'async'),
73
+ importPath,
60
74
  ctx;
61
75
 
62
76
  parser.on(types.STRING, function (token) {
63
77
  var self = this;
64
- if (!tokens) {
65
- tokens = swig.parseFile(token.match.replace(/^("|')|("|')$/g, ''), parseOpts).tokens;
66
- utils.each(tokens, function (token) {
67
- var out = '',
68
- macroName;
69
- if (!token || token.name !== 'macro' || !token.compile) {
70
- return;
71
- }
72
- macroName = token.args[0];
73
- // Phase 2 (#T15): macro.compile now returns an IRMacro node
74
- // rather than a JS source string. Render it through the shared
75
- // backend so import.js still gets the JS source it performs
76
- // regex-surgery on for namespace-prefixing. The +'\n' trailing
77
- // newline matches the pre-Phase-2 compile output exactly.
78
- out += backend.compile([token.compile(compiler, token.args, token.content, [], compileOpts)], [], compileOpts) + '\n';
79
- self.out.push({compiled: out, name: macroName});
80
- });
78
+ if (importPath !== undefined) {
79
+ throw new Error('Unexpected string ' + token.match + ' on line ' + line + '.');
80
+ }
81
+ importPath = token.match.replace(/^("|')|("|')$/g, '');
82
+
83
+ if (isAsync) {
84
+ // Async mode: skip the sync parseFile + macro pre-render. Stash
85
+ // just the path; compile() emits IRImportDeferred.
86
+ self.out.push({ path: importPath });
81
87
  return;
82
88
  }
83
89
 
84
- throw new Error('Unexpected string ' + token.match + ' on line ' + line + '.');
90
+ var tokens = swig.parseFile(importPath, parseOpts).tokens;
91
+ utils.each(tokens, function (token) {
92
+ var out = '',
93
+ macroName;
94
+ if (!token || token.name !== 'macro' || !token.compile) {
95
+ return;
96
+ }
97
+ macroName = token.args[0];
98
+ // Phase 2 (#T15): macro.compile now returns an IRMacro node
99
+ // rather than a JS source string. Render it through the shared
100
+ // backend so import.js still gets the JS source it performs
101
+ // regex-surgery on for namespace-prefixing. The +'\n' trailing
102
+ // newline matches the pre-Phase-2 compile output exactly.
103
+ out += backend.compile([token.compile(compiler, token.args, token.content, [], compileOpts)], [], compileOpts) + '\n';
104
+ self.out.push({compiled: out, name: macroName});
105
+ });
85
106
  });
86
107
 
87
108
  parser.on(types.VAR, function (token) {
88
109
  var self = this;
89
- if (!tokens || ctx) {
110
+ if (importPath === undefined || ctx) {
90
111
  throw new Error('Unexpected variable "' + token.match + '" on line ' + line + '.');
91
112
  }
92
113
 
@@ -48,6 +48,10 @@ exports.compile = function (compiler, args, content, parents, options, blockName
48
48
  }
49
49
  }
50
50
 
51
+ if (options && options.codegenMode === 'async') {
52
+ return ir.includeDeferred(file, w || undefined, !!onlyCtx, !!ignoreMissing, parentFile);
53
+ }
54
+
51
55
  return ir.include(file, w || undefined, !!onlyCtx, !!ignoreMissing, parentFile);
52
56
  };
53
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinostone/swig",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "A simple, powerful, and extendable templating engine for node.js and browsers, similar to Django, Jinja2, and Twig.",
5
5
  "keywords": [
6
6
  "template",
@@ -21,9 +21,7 @@
21
21
  "Rhinostone <contact@gina.io>"
22
22
  ],
23
23
  "dependencies": {
24
- "@rhinostone/swig-core": "2.1.0",
25
- "terser": "^5.46.1",
26
- "yargs": "^17.7.2"
24
+ "@rhinostone/swig-core": "2.3.0"
27
25
  },
28
26
  "devDependencies": {
29
27
  "blanket": "~1.1",
@@ -36,6 +34,7 @@
36
34
  "mocha-phantomjs": "~3.1",
37
35
  "path-browserify": "^1.0.1",
38
36
  "phantomjs": "~1.9.1",
37
+ "terser": "^5.46.1",
39
38
  "travis-cov": "~0.2"
40
39
  },
41
40
  "license": "MIT",
File without changes
@@ -1,6 +0,0 @@
1
- [0.1.2](https://github.com/paularmstrong/swig/tree/v0.1.2) / 2011-09-01
2
- -----------------------------------------------------------------------
3
-
4
- * Initial **swig** publish after forking from [node-t](https://github.com/skid/node-t)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.2/docs)
@@ -1,6 +0,0 @@
1
- [0.1.3](https://github.com/paularmstrong/swig/tree/v0.1.3) / 2011-09-01
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** filter parser to work correctly with single-quoted params in filters.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.3/docs)
@@ -1,11 +0,0 @@
1
- [0.1.5](https://github.com/paularmstrong/swig/tree/v0.1.5) / 2011-09-04
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** `first`, `last`, and `uniq` filters
5
- * **Added** ability to specify custom filters
6
- * **Added** ability to specify custom tags
7
- * **Changed** slots removed -- implement using custom tags if desired
8
- * **Fixed** ability to do either dot- or bracket-notation or mixed in variables
9
- * **Fixed** internal parsing helpers
10
-
11
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.5/docs)
@@ -1,6 +0,0 @@
1
- [0.1.6](https://github.com/paularmstrong/swig/tree/v0.1.6) / 2011-09-04
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** Template inheritance blocks messing up.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.6/docs)
@@ -1,7 +0,0 @@
1
- [0.1.7](https://github.com/paularmstrong/swig/tree/v0.1.7) / 2011-09-05
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** this History document
5
- * **Fixed** date filter to zero-pad correctly during september when using 'm' format
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.7/docs)
@@ -1,7 +0,0 @@
1
- [0.1.8](https://github.com/paularmstrong/swig/tree/v0.1.8) / 2011-09-10
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** `add`, `addslashes`, and `replace` filters.
5
- * **Changed** All tags that 'end' must use named ends like `endblock`, `endif`, `endfor`, etc...
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.8/docs)
@@ -1,7 +0,0 @@
1
- [0.1.9](https://github.com/paularmstrong/swig/tree/v0.1.9) / 2011-09-11
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** `allowErrors` flag will allow errors to be thrown and bubbled up. Default to catch errors.
5
- * **Changed** Internal speed improvements.
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.1.9/docs)
@@ -1,11 +0,0 @@
1
- [0.10.0](https://github.com/paularmstrong/swig/tree/v0.10.0) / 2012-02-13
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** loop.index0, loop.revindex, loop.revindex0, and loop.cycle [gh-48](https://github.com/paularmstrong/swig/issues/48)
5
- * **Added** init config `extensions` for 3rd party extension access in custom tags [gh-44](https://github.com/paularmstrong/swig/issues/44)
6
- * **Added** Whitespace Control [gh-46](https://github.com/paularmstrong/swig/issues/46)
7
- * **Changed** The `empty` tag in `for` loops is now `else` [gh-49](https://github.com/paularmstrong/swig/issues/49)
8
- * **Changed** `forloop` vars to `loop` closes [gh-47](https://github.com/paularmstrong/swig/issues/47)
9
- * **Fixed** `include` tag's `with` and `only` args documentation [gh-50](https://github.com/paularmstrong/swig/issues/50)
10
-
11
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.10.0/docs)
@@ -1,15 +0,0 @@
1
- [0.11.0](https://github.com/paularmstrong/swig/tree/v0.11.0) / 2012-02-27
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** Support for Windows style paths [gh-57](https://github.com/paularmstrong/swig/issues/57)
5
- * **Added** `ignore missing` tokens to include tag
6
- * **Changed** include tag `with context` to only work if `context` is an object
7
- * **Changed** `autoescape` tag controls no longer 'yes' or 'no'. Use `true` and `false`
8
- * **Changed** parser is now passed into tags as an argument
9
- * **Changed** don't require passing context object when rendering template
10
- * **Fixed** dateformats `N` and `w` [gh-59](https://github.com/paularmstrong/swig/issues/59)
11
- * **Fixed** number changing to string after add filter or set from variable [gh-53](https://github.com/paularmstrong/swig/issues/53) [gh-58](https://github.com/paularmstrong/swig/issues/58)
12
- * **Fixed** speed decrease caused by loop.cycle fixed
13
- * **Fixed** Ensure set tag bubbles through extends and blocks
14
-
15
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.11.0/docs)
@@ -1,6 +0,0 @@
1
- [0.11.1](https://github.com/paularmstrong/swig/tree/v0.11.1) / 2012-04-01
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** Duplicate (string) tokens were being removed when extending a base template. [gh-67](https://github.com/paularmstrong/swig/issues/67)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.11.1/docs)
@@ -1,6 +0,0 @@
1
- [0.11.2](https://github.com/paularmstrong/swig/tree/v0.11.2) / 2012-04-10
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** Update support for underscore@1.3.3 [gh-70](https://github.com/paularmstrong/swig/issues/70) [gh-71](https://github.com/paularmstrong/swig/issues/71)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.11.2/docs)
@@ -1,7 +0,0 @@
1
- [0.12.0](https://github.com/paularmstrong/swig/tree/v0.12.0) / 2012-07-26
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** Misc documenation
5
- * **Changed** Support Node.js >=v0.6
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.12.0/docs)
@@ -1,11 +0,0 @@
1
- [0.12.1](https://github.com/paularmstrong/swig/tree/v0.12.1) / 2012-10-05
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** More information on some parser errors
5
- * **Added** indent parameter to json_encode filter to support pretty-printing.
6
- * **Added** support for variables as `extends` tag parameters
7
- * **Fixed** Compile errors in Android and other random browsers
8
- * **Fixed** Misc documentation
9
- * **Fixed** Leaking __keys variable into global scope
10
- *
11
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.12.1/docs)
@@ -1,8 +0,0 @@
1
- [0.13.0](https://github.com/paularmstrong/swig/tree/v0.13.0) / 2012-10-20
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** Support for nested blocks! [gh-64](https://github.com/paularmstrong/swig/issues/64) [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
5
- * **Changed** Removed the `parentBlock` argument from tags.
6
- * **Fixed** Object keys may now contain dots
7
-
8
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.13.0/docs)
@@ -1,8 +0,0 @@
1
- [0.13.1](https://github.com/paularmstrong/swig/tree/v0.13.1) / 2012-10-28
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** Macros should be preserved when using inheritence [gh-132](https://github.com/paularmstrong/swig/issues/132) ([nsaun](https://github.com/nsaun))
5
- * **Fixed** bug in parent tag logic [gh-130](https://github.com/paularmstrong/swig/issues/130)
6
- * **Fixed** Error messaging when parent block failed compilation [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
7
-
8
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.13.1/docs)
@@ -1,9 +0,0 @@
1
- [0.13.2](https://github.com/paularmstrong/swig/tree/v0.13.2) / 2012-10-28
2
- -------------------------------------------------------------------------
3
-
4
- * **Changed** Allow variables, filters, arguments to span lines [gh-122](https://github.com/paularmstrong/swig/issues/122)
5
- * **Changed** Throw Errors when using undefined filters [gh-115](https://github.com/paularmstrong/swig/issues/115)
6
- * **Fixed** compiling files from absolute paths [gh-103](https://github.com/paularmstrong/swig/issues/103)
7
- * **Fixed** Prevent global variables from being used before context variables [gh-117](https://github.com/paularmstrong/swig/issues/117)
8
-
9
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.13.2/docs)
@@ -1,5 +0,0 @@
1
- [0.13.3](https://github.com/paularmstrong/swig/tree/v0.13.3) / 2012-12-07
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** Support % (modulus) in if tags [gh-155](https://github.com/paularmstrong/swig/pull/155)
5
- * **Added** Support multi-root via array [gh-143](https://github.com/paularmstrong/swig/pull/143)
@@ -1,5 +0,0 @@
1
- [0.13.4](https://github.com/paularmstrong/swig/tree/v0.13.4) / 2012-12-19
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** Runaway loop on missing template [gh-162](https://github.com/paularmstrong/swig/pull/162) [gh-165](https://github.com/paularmstrong/swig/pull/165)
5
- * **Fixed** Allow variables in if tag conditionals to have filters with arguments [gh-167](https://github.com/paularmstrong/swig/pull/167)
@@ -1,4 +0,0 @@
1
- [0.13.5](https://github.com/paularmstrong/swig/tree/v0.13.5) / 2013-01-29
2
- -------------------------------------------------------------------------
3
-
4
- * **Fixed** date filter output for 'O' when time-zone offset is negative [gh-185](https://github.com/paularmstrong/swig/pull/185)
@@ -1,6 +0,0 @@
1
- [0.14.0](https://github.com/paularmstrong/swig/tree/v0.14.0) / 2013-06-08
2
- -------------------------------------------------------------------------
3
-
4
- * **Added** Allow executing functions from within templates [gh-182](https://github.com/paularmstrong/swig/pull/182)
5
- * **Added** New `spaceless` tag [gh-193](https://github.com/paularmstrong/swig/pull/193)
6
- * **Fixed** bug when attempting to loop over nested vars with `for`. [gh-232](https://github.com/paularmstrong/swig/pull/232)
@@ -1,7 +0,0 @@
1
- [0.2.0](https://github.com/paularmstrong/swig/tree/v0.2.0) / 2011-09-11
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** `if` statements allow filters applied to operands.
5
- * **Fixed** `for` loops allow filters applied to the object that will be iterated over.
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.2.0/docs)
@@ -1,6 +0,0 @@
1
- [0.2.1](https://github.com/paularmstrong/swig/tree/v0.2.1) / 2011-09-13
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** Support for `else` within `if` blocks.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.2.1/docs)
@@ -1,6 +0,0 @@
1
- [0.2.2](https://github.com/paularmstrong/swig/tree/v0.2.2) / 2011-09-16
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** Support for `else if ...` within `if` blocks.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.2.2/docs)
@@ -1,10 +0,0 @@
1
- [0.2.3](https://github.com/paularmstrong/swig/tree/v0.2.3) / 2011-09-16
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** Critical fix for negations in `if` blocks.
5
- * **Added** Support for `forloop.first` in `for` blocks.
6
- * **Added** Support for `forloop.last` in `for` blocks.
7
- * **Added** Support for `forloop.key` in `for` blocks.
8
- * **Added** Support for `{% empty %}` in `for` blocks.
9
-
10
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.2.3/docs)
@@ -1,6 +0,0 @@
1
- [0.3.0](https://github.com/paularmstrong/swig/tree/v0.3.0) / 2011-09-17
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** Support for `{% set ... %}` tag.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.3.0/docs)
@@ -1,11 +0,0 @@
1
- [0.4.0](https://github.com/paularmstrong/swig/tree/v0.4.0) / 2011-09-24
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** Macro support [docs](docs/tags.md)
5
- * **Changed** Removed requirement to manually specify `locals` for express support.
6
- * **Changed** Increased cache lookup speed by removing crypto dependency.
7
- * **Fixed** `length` filter returns length of objects (number of keys).
8
- * **Fixed** Filters return empty string unless they can apply to the given object.
9
- * **Fixed** Filters will attempt to apply to all values in an object or array.
10
-
11
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.4.0/docs)
@@ -1,11 +0,0 @@
1
- [0.5.0](https://github.com/paularmstrong/swig/tree/v0.5.0) / 2011-09-27
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** More error messaging in some edge cases.
5
- * **Added** Better error messaging including context and line numbers.
6
- * **Changed** Improved compile and render speeds.
7
- * **Changed** `include` tags accept context variables instead of just strings.
8
- * **Changed** Templates can be compiled and rendered from an absolute path outside of the template root.
9
- * **Fixed** Will not double escape output.
10
-
11
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.5.0/docs)
@@ -1,12 +0,0 @@
1
- [0.6.0](https://github.com/paularmstrong/swig/tree/v0.6.0) / 2011-10-02
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** `{% import foo as bar %}` tag for importing macros.
5
- * **Added** Allow escaping for js in escape filter and autoescape tag.
6
- * **Added** `raw` filter to force variable to not be escaped.
7
- * **Added** `escape` and `e` filters to force variable to be escaped.
8
- * **Added** Allow filters to accept any JS objects, arrays, strings, and context variables.
9
- * **Changed** `if`, `else`, and `else if` tags support all JS-valid if-syntaxes + extra operators.
10
- * **Fixed** `default` filter for undefined variables. closes gh-18
11
-
12
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.6.0/docs)
@@ -1,6 +0,0 @@
1
- [0.6.1](https://github.com/paularmstrong/swig/tree/v0.6.1) / 2011-10-02
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** chaining filters when the first takes a variable as an argument will not crash parsing.
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.6.1/docs)
@@ -1,7 +0,0 @@
1
- [0.7.0](https://github.com/paularmstrong/swig/tree/v0.7.0) / 2011-10-05
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** `make browser` will build Swig for use in major browsers. [gh-3](https://github.com/paularmstrong/swig/issues/3)
5
- * **Changed** Allow overriding `escape` filters. [gh-19](https://github.com/paularmstrong/swig/issues/19)
6
-
7
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.7.0/docs)
@@ -1,18 +0,0 @@
1
- [0.8.0](https://github.com/paularmstrong/swig/tree/v0.8.0) / 2011-11-04
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** date filter formats `z`, `W`, `t`, `L`, `o`, `B`, and `c`.
5
- * **Added** New `filter` tag.
6
- * **Added** Node.js compatible 0.4.1 - 0.6.X
7
- * **Added** Allow setting cache globally or per-template.
8
- * **Changed** Removed `swig.render` and `swig.fromString`.
9
- * **Changed** `swig.fromFile` is now `swig.compileFile`.
10
- * **Changed** `swig.init()` will clear template cache.
11
- * **Changed** `swig.init()` is now optional for browser mode with no custom settings.
12
- * **Changed** Development dependencies are be more lenient.
13
- * **Fixed** Parser will properly preserver '\' escaping. [gh-24](https://github.com/paularmstrong/swig/issues/24)
14
- * **Fixed** Rewrote tag argument parsing for proper space handling.
15
- * **Fixed** Rewrote filter argument parsing. [gh-23](https://github.com/paularmstrong/swig/issues/23)
16
- * **Fixed** Allow pipe `|` characters in filter arguments. [gh-22](https://github.com/paularmstrong/swig/issues/22)
17
-
18
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.8.0/docs)
@@ -1,13 +0,0 @@
1
- [0.9.0](https://github.com/paularmstrong/swig/tree/v0.9.0) / 2011-12-30
2
- -----------------------------------------------------------------------
3
-
4
- * **Added** DateZ license to browser header, use link to underscore license.
5
- * **Added** Timezone support in `date` filter [gh-27](https://github.com/paularmstrong/swig/issues/27).
6
- * **Added** New `raw` tag.
7
- * **Changed** Swig is no longer node 0.4 compatible.
8
- * **Fixed** Filter `date('f')` for 10am times.
9
- * **Fixed** Filter `date('r')` returns in UTC date format. This is more correct tospec RFC2822, per [php.net/date](http://php.net/date).
10
- * **Fixed** Filter `add` when adding numbers/numbers+strings together.
11
- * **Fixed** Tests for error messages that changed in node >0.6.0.
12
-
13
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.9.0/docs)
@@ -1,6 +0,0 @@
1
- [0.9.1](https://github.com/paularmstrong/swig/tree/v0.9.1) / 2012-01-18
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** Allow multi-line tags and comments. [gh-30](https://github.com/paularmstrong/swig/issues/30)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.9.1/docs)
@@ -1,6 +0,0 @@
1
- [0.9.2](https://github.com/paularmstrong/swig/tree/v0.9.2) / 2012-01-23
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** Correctly reset autoescape after closing an autoescape tag. [gh-39](https://github.com/paularmstrong/swig/issues/39)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.9.2/docs)
@@ -1,6 +0,0 @@
1
- [0.9.3](https://github.com/paularmstrong/swig/tree/v0.9.3) / 2012-01-28
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** Allow object and array values to be accessed via context variables [gh-40](https://github.com/paularmstrong/swig/issues/40)
5
-
6
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.9.3/docs)
@@ -1,10 +0,0 @@
1
- [0.9.4](https://github.com/paularmstrong/swig/tree/v0.9.4) / 2012-02-07
2
- -----------------------------------------------------------------------
3
-
4
- * **Fixed** `parent` tag would not render when called within tags [gh-41](https://github.com/paularmstrong/swig/issues/41)
5
- * **Fixed** Documentation for forloop.index & forloop.key [gh-42](https://github.com/paularmstrong/swig/issues/42)
6
- * **Fixed** Errors when using `include` inside base template `block` tags [gh-43](https://github.com/paularmstrong/swig/issues/43)
7
- * **Fixed** Allow `set` tag to set values to numbers [gh-45](https://github.com/paularmstrong/swig/issues/45)
8
- * **Fixed** `set` tag for booleans using too many checks
9
-
10
- [Documentation](https://github.com/paularmstrong/swig/tree/v0.9.4/docs)
@@ -1,22 +0,0 @@
1
- [1.0.0-pre1](https://github.com/paularmstrong/swig/tree/v1.0.0-pre1) / 2013-08-14
2
- ---------------------------------------------------------------------------------
3
-
4
- * **Changed** Completely rewritting parsing engine supports many more syntaxes and is much easier to extend.
5
- * **Changed** There is no more `swig.init` method.
6
- * **Changed** Custom filters can be added using `swig.addFilter`
7
- * **Changed** Custom tags can be added using `swig.addTag`
8
- * **Changed** Writing custom tags uses an entirely new, simplified format
9
- * **Changed** Removed the underscore/lodash dependency
10
- * **Changed** Template parsing has been completely rewritten
11
- * **Changed** `swig.compileFile` returns a function that renders templates, not an object
12
- * **Changed** Express-compatible using `swig.renderFile`.
13
- * **Changed** `extends`, `import`, and `include` now reference files with relative paths from the current file.
14
- * **Changed** `extends` may no longer accept variables.
15
- * **Changed** `else if` tag is now `elseif` or `elif`.
16
- * **Changed** Removed `only` argument from `include`.
17
- * **Changed** allow `_`, `$` to start var names in templates.
18
- * **Changed** Documentation is auto-generated from jsdoc comments in-files.
19
- * **Added** Ability to set custom var/tag/comment controls (`{{`, `}}`, etc, can be customized).
20
- * **Added** Variable/string concatenation [gh-135](https://github.com/paularmstrong/swig/issues/135).
21
- * **Added** Binary application for `compile`, `run`, and `render` (Lets you pre-compile templates into JS functions for client-side delivery).
22
- * **Fixed** Lots.
@@ -1,18 +0,0 @@
1
- [1.0.0-pre2](https://github.com/paularmstrong/swig/tree/v1.0.0-pre2) / 2013-08-18
2
- ---------------------------------------------------------------------------------
3
-
4
- * **Changed** Binary: Allow --method-name to be a shortcut for --wrap-start var setting.
5
- * **Changed** Make reverse filter an alias for `sort(true)`.
6
- * **Added** Allow asyncronous `compileFile` and `renderFile` operations. [gh-283](https://github.com/paularmstrong/swig/issues/283)
7
- * **Added** Filter: `sort`.
8
- * **Added** Allow {% end[tag] tokens... %}. [gh-278](https://github.com/paularmstrong/swig/issues/278)
9
- * **Added** Built source map for minified browser source.
10
- * **Added** Contextual support for object method calls. [gh-275](https://github.com/paularmstrong/swig/issues/275)
11
- * **Added** `parser.on('start'|'end'...` options. [gh-274](https://github.com/paularmstrong/swig/issues/274)
12
- * **Added** Allow object prototypal inheritance. [gh-273](https://github.com/paularmstrong/swig/issues/273)
13
- * **Fixed** Prevent circular extends. [gh-282](https://github.com/paularmstrong/swig/issues/282)
14
- * **Fixed** Throw an error if reserved word is used as var. [gh-276](https://github.com/paularmstrong/swig/issues/276)
15
- * **Fixed** Add filename to errors if possible. [gh-280](https://github.com/paularmstrong/swig/issues/280)
16
- * **Fixed** Filters work over arrays/objects if possible. [gh-259](https://github.com/paularmstrong/swig/issues/259)
17
- * **Fixed** Allow {% parent %} to work in middle parent templates. [gh-277](https://github.com/paularmstrong/swig/issues/277)
18
- * **Fixed** Allow newlines in tags/vars/comments. [gh-272](https://github.com/paularmstrong/swig/issues/272)
@@ -1,7 +0,0 @@
1
- [1.0.0-pre3](https://github.com/paularmstrong/swig/tree/v1.0.0-pre3) / 2013-08-20
2
- ---------------------------------------------------------------------------------
3
-
4
- * **Changed** Allow tags at block-level if specified. [gh-289](https://github.com/paularmstrong/swig/issues/289)
5
- * **Fixed** `swig.compileFile` runs callback template is found in cache. [gh-291](https://github.com/paularmstrong/swig/issues/291)
6
- * **Fixed** Accidental modification of Swig Options Object. [gh-287](https://github.com/paularmstrong/swig/issues/287)
7
- * **Fixed** Preserve forward-slashes in text chunks. [gh-285](https://github.com/paularmstrong/swig/issues/285)
@@ -1,12 +0,0 @@
1
- [1.0.0-rc1](https://github.com/paularmstrong/swig/tree/v1.0.0-rc1) / 2013-08-28
2
- -------------------------------------------------------------------------------
3
-
4
- * **Added** `include` tag now accepts `only` (and is preferred, if possible). gh-240
5
- * **Added** `swig.version` and `-v` to cli
6
- * **Changed** Deprecated `raw` filter. Use `safe`.
7
- * **Changed** Allow `import` and `macro` tags to be outside of blocks. gh-299
8
- * **Changed** Don't escape `macro` output. gh-297
9
- * **Changed** (Custom) Filters can be marked as `safe` to disable auto-escaping. gh-294
10
- * **Fixed** `{% for k,v ... %}` tag syntax assigned variables backwards.
11
- * **Fixed** Filters being applied to empty functions throwing errors. gh-296
12
- * **Fixed** `include` paths on windows. gh-295
@@ -1,10 +0,0 @@
1
- [1.0.0-rc2](https://github.com/paularmstrong/swig/tree/v1.0.0-rc2) / 2013-09-06
2
- -------------------------------------------------------------------------------
3
-
4
- * **Changed** Function output from `variable` blocks are no longer auto-escaped. gh-309
5
- * **Fixed** Allow nested macros to work when importing. gh-310
6
- * **Fixed** swig.setDefaultTZOffset. gh-311
7
- * **Changed** `set` tag assigns to the local context, allowing setting within `for` loops, etc. gh-303
8
- * **Fixed** Standardize variable undefined checking. gh-301
9
- * **Fixed** Remove multiple redefinition of block-level tags in compiled templates.
10
- * **Fixed** Performance issue with compile if no default locals are defined.