Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working to improve params generation per #48
Essentially, we are generating all the params (including recursive children) upfront before compiling templates.
Until now, params generation and children traversal has been coupled to compilation making it hard to test and certain statements impossible. "will any of this node's children render in this template?" is a better and different question than, "does this node have children with a snippet template?" which is different than the more primitive and currently supported, "does this node have children?"
This is no longer a limitation, allowing statements like
{{?figma.children}}
(if any children will render for this template) and{{!figma.children}}
(if no children render for this template).See test.ts for a sense of what's possible. Params objects can contain children and child templates. They hydrate templates and can be compared to expected strings. This means we can test and preview full recursive template compilation outside the Figma environment.
Still have some cleanup to do, but this is a big first step towards optimal params generation.