-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Nunjucks AST instead of passing to HTMLAsset #1
Comments
When will you start implementing this issue? |
@Seminioni I'm not too sure. I have a bit of work to do before this and I'm not too sure if Nunjucks builds a proper AST at all, so I don't know how long this will take. |
Dependencies can't be determined statically from the AST. Dependencies are expressions (i.e. nonterminals) in nunjucks e.g. the following is valid:
Dependencies can also be loaded conditionally e.g.:
Even dependencies that are represented as string literals can't be resolved statically, in general, since the interpretation of the string depends on the loader (i.e. they're identifiers rather than locators) e.g. |
Thanks for the insight, @chocolateboy. Turns out Nunjucks is a much more complicated engine that I expected. I'm having trouble finding time to maintain this project, but anyone is welcome to submit PRs if they are able to fix any of these issues. |
The current functionality is to simple compile the Nunjucks template and then pass it to the HTMLAsset where it is turned into an AST using JSDOM. It may be beneficial performance-wise to use Nunjucks to generate an AST and resolve dependencies from there.
Ideally, the Nunjucks compiler should be used so there are no compatibility issues.
The text was updated successfully, but these errors were encountered: