@rhinostone/swig-core 2.5.2 → 2.6.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 (2) hide show
  1. package/lib/engine.js +8 -0
  2. package/package.json +1 -1
package/lib/engine.js CHANGED
@@ -399,6 +399,14 @@ exports.install = function (self, frontend) {
399
399
  parents = [];
400
400
  tokens.tokens = [buildExtendsDeferred(tokens, options)];
401
401
  } else {
402
+ if (tokens.parentExpr) {
403
+ // A dynamic {% extends %} path lowered to tokens.parentExpr can
404
+ // only resolve at render time. The sync precompile path walks the
405
+ // parent chain at compile time, before any runtime value exists,
406
+ // so a dynamic parent is unresolvable here — fail with a pointer
407
+ // to the async render path rather than a cryptic not-found.
408
+ throw new Error('Dynamic {% extends %} requires the async render path — use renderFile(path, locals, cb) with a loader that sets loader.async === true.');
409
+ }
402
410
  parents = getParentsInternal(tokens, options);
403
411
  if (parents.length) {
404
412
  tokens.tokens = exports.remapBlocks(tokens.blocks, parents[0].tokens);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinostone/swig-core",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "Shared IR, backend, and runtime for the @rhinostone/swig family of template engines.",
5
5
  "keywords": [
6
6
  "template",