@rhinostone/swig 2.4.3 → 2.5.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.
@@ -28,7 +28,7 @@ var _dangerousProps = require('@rhinostone/swig-core/lib/security').dangerousPro
28
28
  * @param {literal} varname Local-accessible object name to assign the macros to.
29
29
  */
30
30
  exports.compile = function (compiler, args, content, parents, options) {
31
- // Phase 2 (#T22): async-codegen branch. Parse stashed `[{path}, alias]`
31
+ // Async-codegen branch. Parse stashed `[{path}, alias]`
32
32
  // (no macro pre-render in async mode); emit IRImportDeferred so the
33
33
  // backend's `_swig.getTemplate` + `.exports` bind happens at runtime.
34
34
  if (options && options.codegenMode === 'async') {
@@ -154,11 +154,11 @@ exports.parse = function (str, line, parser, types, stack, opts, swig) {
154
154
  return;
155
155
  }
156
156
  macroName = token.args[0];
157
- // Phase 2 (#T15): macro.compile now returns an IRMacro node
158
- // rather than a JS source string. Render it through the shared
159
- // backend so import.js still gets the JS source it performs
160
- // regex-surgery on for namespace-prefixing. The +'\n' trailing
161
- // newline matches the pre-Phase-2 compile output exactly.
157
+ // macro.compile returns an IRMacro node rather than a JS source
158
+ // string. Render it through the shared backend so import.js still
159
+ // gets the JS source it performs regex-surgery on for
160
+ // namespace-prefixing. The +'\n' trailing newline matches the
161
+ // legacy compile output exactly.
162
162
  out += backend.compile([token.compile(compiler, token.args, token.content, [], compileOpts)], [], compileOpts) + '\n';
163
163
  self.out.push({compiled: out, name: macroName});
164
164
  });
@@ -35,10 +35,10 @@ exports.compile = function (compiler, args, content, parents, options, blockName
35
35
  // Silly JSLint "Strange Loop" requires return to be in a conditional
36
36
  if (breaker && parentFile !== parent.name) {
37
37
  block = parent.blocks[blockName];
38
- // Phase 2: the block tag now returns `IRBlock { body: [...] }`.
39
- // Splice the matched parent block's body into an IRParent node;
40
- // the backend emits body verbatim plus a trailing newline for
41
- // byte-identity with the pre-Phase-2 JS-string emission shape.
38
+ // The block tag returns `IRBlock { body: [...] }`. Splice the
39
+ // matched parent block's body into an IRParent node; the backend
40
+ // emits body verbatim plus a trailing newline for byte-identity
41
+ // with the legacy JS-string emission shape.
42
42
  var blockNode = block.compile(compiler, [blockName], block.content, parents.slice(i + 1), options);
43
43
  return ir.parent((blockNode && blockNode.body) ? blockNode.body.concat([ir.legacyJS('\n')]) : [ir.legacyJS('\n')]);
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinostone/swig",
3
- "version": "2.4.3",
3
+ "version": "2.5.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,7 +21,7 @@
21
21
  "Rhinostone <contact@gina.io>"
22
22
  ],
23
23
  "dependencies": {
24
- "@rhinostone/swig-core": "2.4.3"
24
+ "@rhinostone/swig-core": "2.5.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "blanket": "~1.1",