Add deep search for filter taking in properties#1749
Add deep search for filter taking in properties#1749andershagbard wants to merge 10 commits intoShopify:mainfrom
Conversation
|
@dylanahsmith I am not sure if you still work on Liquid, but I would love for someone in the Liquid team to take a look at this PR. |
|
@karreiro @benjaminsehl ping |
karreiro
left a comment
There was a problem hiding this comment.
👋 Hey @andershagbard,
Thank you for this PR. Could you please share your reasoning behind the deep parameter?
I feel like it was introduced with backward compatibility concerns; however, I believe it may bring a bit of complexity to the language and to language server implementations. I don't think it's required for backward compatibility, but I'm not sure if I'm missing something in that aspect.
Thanks again for this PR!
|
It's to safeguard against the JSON field type, which can contain dots in it's properties. It's an edge case I guess. {
"foo.bar": true
}Ref: #1436 (comment) |
* Add reject filter #1573 * Add deep search for filter taking in properties #1749 * Update branch with main * Add `find`, `find_index`, `has`, and `reject` filters to arrays * Refactor: avoid usage of public_send --------- Co-authored-by: Anders Søgaard <andershagbard@gmail.com> Co-authored-by: Anders Søgaard <9662430+andershagbard@users.noreply.github.com>
…ify#1869) * Add reject filter Shopify#1573 * Add deep search for filter taking in properties Shopify#1749 * Update branch with main * Add `find`, `find_index`, `has`, and `reject` filters to arrays * Refactor: avoid usage of public_send --------- Co-authored-by: Anders Søgaard <andershagbard@gmail.com> Co-authored-by: Anders Søgaard <9662430+andershagbard@users.noreply.github.com>
|
Closed by #1869 |
This PR allows for backward compatibility deep search :woah:
Like so:
{{ input | where: 'some.nested.property', 'foo', deep: true }} {{ input | where: 'some_nested_property', 'foo', deep: '_' }} # Custom separatorAdded deep search for the following filters. This should be all Liquid filters which takes in a property argument: