-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Extract Liquid.js valid and invalid variables #777
Comments
I've been working on PR #770 that might do what you need. Please could you elaborate on what you mean by "valid" and "invalid" variables? #770 uses the term "globals" (subject to change) to mean variables that are not in scope from tags like |
Hey @jg-rp, this is exactly what I am looking for. Let me know if you need help so we can merge it faster. We use Liquid.Js extensively at Novu. Currently, we have wrapped Liquid with our own logic to achieve something similar. Currently, Liquid throws errors if an invalid syntax is used, for example, Let me know if this helps. |
Thanks @SokratisVidros, that helps. Understanding different use cases for retrieving variables is half the battle. In theory, I can imagine a fault tolerant tokenizer/parser that can resume scanning a template on some syntax errors, giving us the opportunity to report multiple invalid expressions. It would be a fairly massive change though and @harttle has already raised concerns about bundle size for browsers. |
I see. The concern about the bundle size is valid, although it can only be validated during implementation by comparing before/after bundle sizes. For the record, we ended up with a similar in-house parser. It would be awesome if all the Liquid internals were not exposed. |
Is there a built-in way to extract Liquid.js valid and invalid variables using LiquidJS.parse?
Effectively, we are looking for a function that looks like this:
Thank you.
The text was updated successfully, but these errors were encountered: