You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @dmolsen, firstly thanks for your plugin.
I am using this plugin in project and facing an issue with data-inheritance. This does not work for multilevel file includes, when the sub-included files are lexicographically greater.
This could be solved using numeric prefix in filenames, but I would really like to avoid that.
For eg. let say we have three patterns in atoms directory:
a.twig
This is a.twig {{ data1 }} {% include 'atoms-b' %}
a.json
{ "data1": "hello from A" }
b.twig
This is b.twig {{ data2 }} {% include 'atoms-c' %}
b.json
{ "data2": "hello from B" }
c.twig
This is c.twig {{ data3 }}
c.json
{ "data3": "hello from C" }
In this case, pattern a will inherit data for only first level include i.e for b, and not for the c. As b is processed later by the plugin.
This can be easily solved by recursively processing the patterns with lineage first, keeping track of the processed patterns at the same time.
Let me know what you think about this, I'll be happy to submit a PR for this.
The text was updated successfully, but these errors were encountered:
hey @vikalp-sajwan, thanks for this. Just a heads up @dmolsen isn't an active maintainer on this project anymore. Another heads up is that there's a chance this plugin isn't relevant anymore (@EvanLovely can you confirm?).
Hi @bradfrost, thanks for your response. This plugin is very much relevant for a project I am working on.
I made the PR of the code that we are using, #10. Please, review and merge if seems relevant.
Hi @dmolsen, firstly thanks for your plugin.
I am using this plugin in project and facing an issue with data-inheritance. This does not work for multilevel file includes, when the sub-included files are lexicographically greater.
This could be solved using numeric prefix in filenames, but I would really like to avoid that.
For eg. let say we have three patterns in
atoms
directory:a.twig
This is a.twig {{ data1 }} {% include 'atoms-b' %}
a.json
{ "data1": "hello from A" }
b.twig
This is b.twig {{ data2 }} {% include 'atoms-c' %}
b.json
{ "data2": "hello from B" }
c.twig
This is c.twig {{ data3 }}
c.json
{ "data3": "hello from C" }
In this case, pattern
a
will inherit data for only first level include i.e forb
, and not for thec
. Asb
is processed later by the plugin.This can be easily solved by recursively processing the patterns with lineage first, keeping track of the processed patterns at the same time.
Let me know what you think about this, I'll be happy to submit a PR for this.
The text was updated successfully, but these errors were encountered: