{% liquid %} tag template literals
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
We have been transitioning over to using the new liquid tags both in our premium themes and with our Shopify Plus clients and have seen an improvement in performance and code maintainability.
When using capture inside the liquid tags it currently requires a mess of multiple lines of echo commands to combine strings and standard Liquid objects. Introducing the concept of template literals would be incredibly beneficial and make things more straight forward.
A current basic example of ugly "string interpolation"
{%- liquid
capture media_id
echo 'FeaturedMedia-'
echo section.id
echo '-'
echo media.id
endcapture
-%}
{{ media_id }}
Using the concept of ES6 template literals with String ${var} would clean things up. Even using the Ruby style version of interpolation would be amazing.
{%- liquid
capture media_id
echo "FeaturedMedia-#{section.id}-#{media.id}"
endcapture
-%}
{{ media_id }}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two example snippets in issue #1373 and resolve whether ES6-style or Ruby-style interpolation is intended. Done means an agreed template-literal syntax supports the capture and echo usage described, with tests covering the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ruby
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100