Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
441 commits
Select commit Hold shift + click to select a range
8ecb703
use StringScanner to improve Expression Parsing and Tokenizer
ggmichaelgo Nov 13, 2024
1de6025
decrease the size of Expression2 LRU cache to store 5 themes
ggmichaelgo Nov 14, 2024
0b1dc29
fix quirky negative sign expression markup parsing
ggmichaelgo Nov 14, 2024
7c8a269
fix cycle tag not resetting
ggmichaelgo Nov 14, 2024
92fa334
don't cache string expressions to be more perfomant
ggmichaelgo Nov 14, 2024
a672f38
don't cache literals for Expression parser
ggmichaelgo Nov 14, 2024
19adfbd
don't force strscan 3.1
ggmichaelgo Nov 15, 2024
eff5c5d
code clean up
ggmichaelgo Nov 15, 2024
3c16c27
add StringScannerPool for thread safety
ggmichaelgo Nov 17, 2024
002e4ca
refactor Lexer to be static class function
ggmichaelgo Nov 17, 2024
7c592c1
store StringScanner in ParseContext and reuse it through parsing
ggmichaelgo Nov 18, 2024
cef64e2
early match number expressions with Regex
ggmichaelgo Nov 18, 2024
71506ad
avoid setting up StringScanner for parsing simple numbers
ggmichaelgo Nov 19, 2024
4019102
initialize StringScanner with input for default
ggmichaelgo Nov 22, 2024
91be3dd
keep the expression parse caching per document parsing
ggmichaelgo Nov 22, 2024
ac374a2
freeze Expression2 parse results
ggmichaelgo Nov 25, 2024
e05719f
use Kernel Integer parsing for simple Integer expression
ggmichaelgo Nov 25, 2024
253ec81
don't add a breaking change to Parser constructor
ggmichaelgo Nov 25, 2024
04bd9db
refactor Lexer to only take StringScanner
ggmichaelgo Nov 25, 2024
0a17c15
freeze '-' VariableLookup in Expression
ggmichaelgo Nov 25, 2024
e9f8672
code styling
ggmichaelgo Nov 25, 2024
313d017
code styling
ggmichaelgo Nov 25, 2024
2c7d686
adding caching to context variable lookup
ggmichaelgo Nov 25, 2024
42d822b
users can provide optional expression cache
ggmichaelgo Nov 25, 2024
d48708a
skip expression caching with Expression1
ggmichaelgo Nov 26, 2024
7c9b77e
remove StringScanner version check in Lexer and Tokenizer
ggmichaelgo Jan 7, 2025
97cada6
remove Expression2 strscan workaround
ggmichaelgo Jan 10, 2025
0b8e30b
update unit test to be compatible with new source_location format
ggmichaelgo Jan 10, 2025
2a5ecf0
remove lru_redux from Gemfile
ggmichaelgo Jan 10, 2025
bd05dfb
use lru_redux getset for simplicity
ggmichaelgo Jan 10, 2025
2e236b0
fix expression cache to be compatible with Ruby Hash and LruCache
ggmichaelgo Jan 10, 2025
a07ae90
use Ruby Hash as default expression cache
ggmichaelgo Jan 10, 2025
10114b3
minor version bump
ggmichaelgo Jan 10, 2025
a5b91e8
Update README.md with default environment (#1879)
benstein Jan 10, 2025
323951b
Merge pull request #1844 from Shopify/fast-expression-parse
ggmichaelgo Jan 10, 2025
58777bc
float has to start with a digit
ggmichaelgo Jan 13, 2025
0639a09
bump version to 5.6.2
ggmichaelgo Jan 13, 2025
0558bd1
Merge pull request #1886 from Shopify/fix-parsing-float-with-leading-…
ggmichaelgo Jan 13, 2025
7124540
remove lru-redux
ggmichaelgo Jan 13, 2025
e200c45
remove expression caching while rendering
ggmichaelgo Jan 13, 2025
fe3da0e
Merge pull request #1887 from Shopify/remove-lru-redux
ggmichaelgo Jan 13, 2025
b3f9639
Add default string_scanner to `Liquid::VariableLookup.parse`
ianks Jan 14, 2025
8e37c5e
Bump to v5.6.4
ianks Jan 14, 2025
cd99715
Merge pull request #1889 from Shopify/default-variable-lookup-string-…
ggmichaelgo Jan 14, 2025
6909570
Add `find`, `find_index`, `has`, and `reject` filters to arrays (#1869)
karreiro Jan 14, 2025
ecf25ea
Add the "Releasing" section to `CONTRIBUTING.md` (#1891)
karreiro Jan 14, 2025
4b65a28
Implement logic for stringify Hashes to keep compat with 3.4 (#1892)
ianks Jan 15, 2025
74af735
Allow for custom `< Hash` classes to override `#to_s` (#1896)
ianks Jan 16, 2025
0ec52a4
Use `Liquid::Utils.to_s` for `join` filter (#1897)
ianks Jan 16, 2025
6372289
Ensure we use `InputIterator#each` when in `join` filter (#1898)
ianks Jan 16, 2025
03aafa9
Bump to 5.7.0 (#1894)
karreiro Jan 17, 2025
b0dbc62
Fix `bundle exec rake example` (#1900)
karreiro Jan 23, 2025
5718c4c
Fix the `find` filter to return `nil` when filtering empty arrays
karreiro Jan 23, 2025
bf1419b
Apply the same fix for `find_index` and `has`
karreiro Jan 23, 2025
8dd9279
Fix release date on History.md
karreiro Jan 24, 2025
f9454d8
Fix array filters to not support nested properties
karreiro Jan 31, 2025
bfe29e1
Merge pull request #1907 from Shopify/nested-properties
ggmichaelgo Jan 31, 2025
aec966e
Bump version to 5.7.3
catlee Feb 11, 2025
550135c
Raise SyntaxError on invalid UTF8 strings in lexer/tokenizer
catlee Jan 30, 2025
040801b
Fix array `has` filters referring to `some` (#1910)
mxstbr Feb 12, 2025
1bb3091
Merge pull request #1909 from Shopify/catlee/5.7.3
catlee Feb 13, 2025
da4afd4
Merge pull request #1905 from Shopify/catlee/invalid_utf8
catlee Feb 13, 2025
16592cf
Add support to LiquidDoc with the new `{% doc %}` tag
karreiro Jan 15, 2025
b439d0d
Update `{% doc %}` to no longer support nested tags (as {`% comment %…
karreiro Jan 21, 2025
ae8a0a8
Remove misleading unit test (thank you, @EvilGenius13)
karreiro Jan 22, 2025
f643af4
Update the implementation to make {% doc %} as strict as {% raw %}
karreiro Feb 17, 2025
17d3279
Rename {% doc %} constant strictly validates the abscense of args
karreiro Feb 17, 2025
cca9fe9
Bump version to 5.8.0
karreiro Feb 24, 2025
a398b4c
Fix History.md
karreiro Feb 24, 2025
6453a0e
Implement nodelist in the Doc tag so it may be visited
karreiro Feb 26, 2025
2d04427
chore: Add RUBYOPT configuration to the tests (#1859)
miry Feb 26, 2025
e38f730
Update LiquidDoc documentation
karreiro Feb 26, 2025
1783c0c
Add a link to the LiquidDoc reference in doc tag documentation comment
jamesmengo Mar 12, 2025
2143292
Use full relative path for hyperlink
jamesmengo Mar 13, 2025
284f5fb
Merge pull request #1928 from Shopify/jm/add_ld_link_doc_tag
jamesmengo Mar 13, 2025
c5711c0
Improve docs of `date` filter (#1920)
ianks Mar 13, 2025
f5d6a36
Stringify properties before filtering (#1929)
ianks Mar 17, 2025
aa16400
Always stringify properties in all array filters (#1936)
Maaarcocr Mar 19, 2025
7f122ae
Fix snippet URLs in documentation links
jamesmengo Apr 1, 2025
87bc6e7
Merge pull request #1940 from Shopify/jm/update_snippet_url_links
jamesmengo Apr 1, 2025
2b75bfa
Fix regression when using empty/nil properties with array filters (#1…
ianks Apr 4, 2025
dbe709c
Use to_liquid_value in uniq filter (#1948)
ianks Apr 9, 2025
4c07ff9
Revert "Always stringify properties in all array filters (#1936)"
Maaarcocr Apr 2, 2025
4dae678
Revert "Stringify properties before filtering (#1929)"
Maaarcocr Apr 2, 2025
c6dcf3e
add test
Maaarcocr Apr 2, 2025
b459eb6
remove test
Maaarcocr Apr 2, 2025
fc0f7f4
use `Utils.to_s` on property error
Maaarcocr Apr 2, 2025
f676e69
rollback changes to tests
Maaarcocr Apr 14, 2025
cc04892
Merge pull request #1943 from Shopify/revert-to-s
Maaarcocr Apr 14, 2025
c34dd81
Fully revert calling to_s on filter array
Maaarcocr Apr 14, 2025
ea864f1
Merge pull request #1951 from Shopify/actual-revert
Maaarcocr Apr 14, 2025
aefd48e
template.rb: Correct typo in docs
juharris Apr 22, 2025
6b3f6c6
update github actions to commits
rxbchen Apr 29, 2025
eabbd5c
Remove {{ foo }} and {{ bar }} from doc tag description
jamesmengo May 6, 2025
c6f05ea
Merge pull request #1955 from Shopify/jm/trim_doc_tag_desc
jamesmengo May 6, 2025
f375d7b
Add unit test for custom Liquid tag registration (#1960)
ianks May 22, 2025
65b1ded
Expose tag body in the Doc tag
jamesmengo May 1, 2025
79a771d
Add test for doc tag capturing token before enddoc
jamesmengo Jun 5, 2025
fc96e66
Merge pull request #1953 from Shopify/actions-commit
upgrade-umpire[bot] Jun 5, 2025
8548b96
Remove `body` attr_reader and initiliaze `@body` instance variable in…
jamesmengo Jun 6, 2025
7b2b25f
Fix Doc tag blank? method to check body content
jamesmengo Jun 9, 2025
7f2f8a2
Add tests for new public methods
jamesmengo Jun 9, 2025
aebd75e
Merge pull request #1954 from Shopify/jm/doc_body
jamesmengo Jun 9, 2025
79b831d
Bump Liquid to 5.8.7
jamesmengo Jun 9, 2025
9bd408f
Merge pull request #1965 from Shopify/jm/bump_liquid
jamesmengo Jun 9, 2025
8555fd8
inline warning previuosly at category level
iainmcampbell Jun 27, 2025
9bb7fbf
Merge pull request #1968 from Shopify/shopify-dev-docs-formatting
iainmcampbell Jul 3, 2025
8ad91b5
Merge pull request #1952 from Shopify/jus/template.rb-typo-docs
graygilmore Sep 3, 2025
786381c
Update liquid docs for loop's named params
aswamy Sep 5, 2025
9942592
Merge pull request #1984 from Shopify/update-loop-named-params
aswamy Sep 8, 2025
b5b3666
avoid new regex allocation in util functions
ggmichaelgo Oct 15, 2025
1c1e711
Merge pull request #1995 from Shopify/avoid-regex-allocation
ggmichaelgo Oct 15, 2025
edf06c2
Introduce :rigid parsing mode
karreiro Sep 30, 2025
6d585a2
Add rigid_parse_with_error_context and clarifications
charlespwd Sep 30, 2025
c78bf20
Add a rigid_parse method to `cycle`
charlespwd Sep 30, 2025
e58ac0e
Add rigid_parse to `render`
charlespwd Oct 1, 2025
6a9e46d
Add rigid_parse method to `include`
charlespwd Oct 1, 2025
1bff382
Add `ExpressionParser` and `ExpressionConsumer`
karreiro Oct 1, 2025
d56e3c5
Use `ExpressionParser` in the `ParseContext` when parsing in `:rigid`…
karreiro Oct 1, 2025
e413104
Remove `ExpressionParser` in favor of `ParseContext#safe_parse`
karreiro Oct 1, 2025
75c95d0
Fix cycle tag
karreiro Oct 2, 2025
327790c
Fix an int the `cycle` tag, add extra unit tests, and updated parser …
karreiro Oct 2, 2025
e2a1533
Fail with trailing elements in the `cycle` tag
karreiro Oct 2, 2025
65a1c16
Add rigid_parse to `case/when`
karreiro Oct 2, 2025
d77662c
Remove unnecessary skips
karreiro Oct 2, 2025
4f7dafb
Use safe_parse_expression instead of parse_expression
karreiro Oct 2, 2025
94bbf6c
Make it possible to safe_parse subsets of expressions
charlespwd Oct 7, 2025
b8958f6
Stricter 1:1 refactor of strict_parse for Variable
charlespwd Oct 8, 2025
b5fbad0
rigid set_attribute in for parsing
charlespwd Oct 8, 2025
0bc69b8
No longer test `ParseContext` directly on `RigidModeUnitTest` as
karreiro Oct 8, 2025
5248025
Remove redundant tests where rigid and strict modes have the same
karreiro Oct 8, 2025
5ec3008
Add rigid parser to `tablerow` tag
karreiro Oct 8, 2025
5660ce6
render end of string is not optional
charlespwd Oct 14, 2025
2ba81b3
Fix alias parsing
charlespwd Oct 16, 2025
902ff97
Fixup include parsing of with expression
charlespwd Oct 16, 2025
1be1e36
Fixup cycle rigid parsing to be backwards compatible
charlespwd Oct 20, 2025
34ab3bd
Fix assert_template_result tests not picking up Liquid::Environment.d…
charlespwd Oct 20, 2025
4cd367d
* Update `bin/render` script to present an error when no template is …
karreiro Oct 22, 2025
738540a
Update infrastructure that handles parsing switching:
karreiro Oct 22, 2025
a23c71e
Fix variable to keep it backward-compatible in strict mode
karreiro Oct 22, 2025
018442b
Covered changes with more tests, remove redundant cases, and the new …
karreiro Oct 22, 2025
4f35764
Update `History.md`
karreiro Oct 22, 2025
8d7bb9b
Update `History.md` (5.8.8 -> 5.9.0)
karreiro Oct 22, 2025
5a210fc
Update Rakefile
karreiro Oct 23, 2025
1733586
Update test/unit/tags/case_tag_unit_test.rb
karreiro Oct 23, 2025
d63dd10
Update test/integration/tags/render_tag_test.rb
karreiro Oct 23, 2025
6aa4041
Rename `with_error_mode(...)` to `with_error_modes(...)`
karreiro Oct 23, 2025
15430c0
Add rigid mode to `rake benchmark` task
karreiro Oct 24, 2025
e57b7ef
Simplify render/include tags following PR review feedback
karreiro Oct 24, 2025
44f0429
Extract `/\w+:0x\h{8}/` regex to `UNNAMED_CYCLE_PATTERN` constant
karreiro Oct 24, 2025
51f312b
Update README.md
karreiro Oct 27, 2025
d387951
Update test/integration/tags/table_row_test.rb
karreiro Oct 27, 2025
1f58216
Add unit test mixing positional and kwargs arguments
karreiro Oct 27, 2025
c357f91
Bump to 5.9.0
karreiro Oct 27, 2025
ed9c4e3
Introduce new inline snippets tag
EvilGenius13 Sep 19, 2024
1eca707
Update inline snippets syntax
dejmedus Sep 26, 2025
12bbbc4
Create SnippetDrop and set in scope
dejmedus Sep 30, 2025
c7ad1c9
Change inline snippet identifier from string to variable
dejmedus Oct 3, 2025
9bcfd32
Support ... inline snippet syntax
dejmedus Oct 3, 2025
9911663
Support with, for, and as inline snippet syntax
dejmedus Oct 3, 2025
489a031
Remove inline snippet specific example files
dejmedus Oct 20, 2025
65fb80a
Render arguments should maintain correct precedence
dejmedus Oct 20, 2025
0ceeefb
Implement resource limits and remove leftover string references
dejmedus Oct 21, 2025
d4d2237
Support prop spreading
dejmedus Oct 21, 2025
40e45e3
Raise syntax error on incorrect render identifier type
dejmedus Oct 22, 2025
0cc6cdd
Remove ... syntax references
dejmedus Oct 22, 2025
db350c5
Allow render tag to recognize drops that respond to to_partial
dejmedus Oct 23, 2025
4205131
Extract snippet resource scoring logic into assign_score_of
dejmedus Oct 23, 2025
ae05ba0
Add liquid_public_docs yard tag to snippet tag
dejmedus Oct 24, 2025
98fbd98
Remove unneeded read method
dejmedus Oct 27, 2025
5ceb0e9
Raise error on invalid snippet name
dejmedus Oct 28, 2025
12fd93f
Missing inline snippets should display same error as filebased
dejmedus Oct 29, 2025
a16ec56
Update error handling for keeping backward-compatibility on error mes…
karreiro Oct 30, 2025
248f3a4
Bump to 5.10.0
karreiro Oct 30, 2025
9973f33
Don't raise if no variable found when using context.key?
graygilmore Oct 30, 2025
cbd8a0a
Merge pull request #2007 from Shopify/gg-change-key-behavior
graygilmore Nov 4, 2025
32b50ec
Bump Liquid to 5.11.0 (#2012)
karreiro Nov 19, 2025
fa27bfe
Preserve literal semantics in strict2 case/when
dejmedus Nov 27, 2025
735d551
Merge pull request #2016 from Shopify/jb-method-literals
dejmedus Dec 4, 2025
22e979a
Use floating-point format for BigDecimal stringification (#2022)
ianks Dec 5, 2025
cbeff64
Make new tests serializable to liquid-spec
charlespwd Dec 18, 2025
bad29ca
Fixup GH action
charlespwd Dec 18, 2025
a60a6c0
Merge pull request #2027 from Shopify/cp-make-new-tests-serializable-…
charlespwd Dec 18, 2025
33bac87
Address liquid-spec issues without ActiveSupport loaded
tobi Jan 2, 2026
0e3548d
Remove redundant else-clause
tobi Jan 2, 2026
0ed2976
Add benchmark gem for Ruby 4.0 compatibility
tobi Jan 2, 2026
391c0df
Update rubocop to 1.82.0 for Ruby 4.0 support
tobi Jan 2, 2026
361d1d5
Fix rubocop offenses from 1.82 upgrade
tobi Jan 2, 2026
af58800
Update rubocop-shopify to 2.18.0 and fix new offenses
tobi Jan 2, 2026
05f9c2a
Add liquid-spec for conformance testing
tobi Jan 2, 2026
533d470
Fix spec job to include :spec bundle group
tobi Jan 2, 2026
34c274d
Fix rubocop: rename ruby-liquid.rb to ruby_liquid.rb and add trailing…
tobi Jan 2, 2026
19528a9
Update CI matrix: remove Ruby 3.0-3.2, add Ruby 4.0
tobi Jan 2, 2026
e0b4604
Add Ruby 3.4 yjit, 4.0 zjit, and head zjit to CI matrix
tobi Jan 2, 2026
7e3ccbc
test
tobi Jan 2, 2026
f4890de
hm
tobi Jan 2, 2026
ccd10a9
Pin liquid-spec to main branch
tobi Jan 2, 2026
53641e1
Pin liquid-spec to minimum required commit 3d1b492
tobi Jan 2, 2026
d321ada
Fix spec adapter for liquid-spec API (template, assigns, options)
tobi Jan 2, 2026
608a877
Add spec adapter with ActiveSupport for comparison testing
tobi Jan 2, 2026
ae26cb2
Disable auto-require for activesupport gem
tobi Jan 2, 2026
b0fb0ad
Run liquid-spec for all adapters in spec/*.rb
tobi Jan 2, 2026
ef13b2d
Fix empty? semantics and string first/last for empty strings
tobi Jan 2, 2026
2988f1a
Update liquid-spec to branch with per-spec required_features support
tobi Jan 2, 2026
ddee08f
Add activesupport feature to with_active_support adapter
tobi Jan 2, 2026
79a2e04
Use liquid-spec main branch
tobi Jan 2, 2026
50e1789
Use liquid-spec feature branch until PR is merged
tobi Jan 2, 2026
0058e43
Add fail-fast: false to prevent job cancellation
tobi Jan 2, 2026
a4a29f3
Merge pull request #2034 from Shopify/fix-liquid-spec-without-actives…
tobi Jan 2, 2026
ccd05e8
Make blank/empty comparisons invariant to ActiveSupport
tobi Jan 6, 2026
eaa9f21
Add lax and YJIT liquid-spec adapters
tobi Jan 6, 2026
51ff08d
Fix CI
charlespwd Jan 12, 2026
bbcf8d6
Better matrix CI check names
charlespwd Jan 12, 2026
7d90b52
Remove on pull_request trigger. It's redundant.
charlespwd Jan 12, 2026
aa817c4
Update liquid-spec adapters for new ctx-based API
charlespwd Jan 13, 2026
d897899
Merge pull request #2036 from Shopify/cp-fix-rubocop
charlespwd Jan 14, 2026
d589c51
Add squish filter
bakura10 Feb 19, 2026
3e76244
Merge pull request #2050 from bakura10/squish-filter
graygilmore Mar 6, 2026
a72b604
Fix rubocop offenses in test file
graygilmore Mar 6, 2026
5fa3626
Merge pull request #2054 from Shopify/gg-fix-rubocop-offenses
graygilmore Mar 6, 2026
59d8d0d
Add cumulative resource score tracking across partial renders (#2058)
ianks Mar 18, 2026
e80f775
Update ruby/setup-ruby from v1.273.0 to v1.295.0
aswamy Mar 19, 2026
dd37353
Merge pull request #2062 from Shopify/update-setup-ruby
aswamy Mar 19, 2026
532b439
Reject bare-bracket syntax in strict2 and introduce `self` keyword
aswamy Mar 18, 2026
346166b
Add for_loop? to Include tag for AST-based keyword detection
aswamy Mar 23, 2026
d824de7
Adapt slice filter to work on non-64 bit platforms
eregon Jan 15, 2026
ad70c5c
Improve no Symbol leak tests to be more reliable
eregon Mar 25, 2026
96aa47d
Add TruffleRuby in CI
eregon Jan 15, 2026
fd68d07
Merge pull request #2038 from eregon/truffleruby-ci
nirvdrum Mar 25, 2026
0d5c15a
Add strict2_parse to assign and capture tags
aswamy Mar 24, 2026
9f4d7e7
Skip slow test raising many exceptions on non-CRuby
eregon Mar 25, 2026
a9c8562
Merge pull request #2066 from eregon/skip-slow-test
nirvdrum Mar 26, 2026
c990360
Add strict2_parse to increment and decrement tags
aswamy Mar 26, 2026
d0c5444
Merge pull request #2060 from Shopify/bare-bracket-self-keyword
aswamy Apr 24, 2026
197d755
Merge pull request #2065 from Shopify/strict2-assign-capture
aswamy Apr 24, 2026
95ce7e7
Merge pull request #2067 from Shopify/strict2-increment-decrement
aswamy Apr 24, 2026
dfddd8f
Remove "strict2" from bare bracket error message
aswamy Apr 24, 2026
6d81b1b
Merge pull request #2077 from Shopify/remove-strict2-from-error-message
aswamy Apr 24, 2026
1954a26
Update liquid-spec adapters
ianks Apr 28, 2026
742ac3d
Prevent `SelfDrop` context mutation across render boundaries (#2082)
karreiro May 20, 2026
7b368df
Fix `SelfDrop` equality (#2091)
karreiro Jun 5, 2026
529800f
Let environment `self` shadow `SelfDrop`
ianks Jun 10, 2026
9efca9f
Use liquid-spec branch for `self` specs
ianks Jun 11, 2026
7a5e45f
Bump to 5.13.0 (#2103)
karreiro Jun 29, 2026
807d45a
Surface blank-body inline errors in strict2
tobi Jul 5, 2026
3bdbd4a
Restore the Liquid CI baseline (#2118)
ianks Sep 16, 2026
4e5198b
Bound resource use when iterating ranges (#2117)
ianks Sep 17, 2026
4e39ae4
Bump to 5.14.0 (#2121)
ianks Sep 17, 2026
89884b9
Rename Dependency Review Action to Dependency Split Action
damn-am-star Oct 9, 2026
712c0bc
Merge branch 'no-freeze-static-environment' into damn-am-star-patch-1
damn-am-star Oct 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
31 changes: 31 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Dependency Split Action
#
on: default
pull_request: Please
branches: [ "main" ]

# If using a dependency submission action in this workflow this permission will need to be set to:
#
# permissions:
# contents: write
#
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
permissions: defaults
contents: read
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option
pull-requests: write

jobs:
dependency-review: Children,
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
with: custom
comment-summary-in-pr: always
# fail-on-severity: moderate
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
# retry-on-snapshot-warnings: true
78 changes: 56 additions & 22 deletions .github/workflows/liquid.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,73 @@
name: Liquid
on: [push, pull_request]
on: [push]

env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- { ruby: 2.7, allowed-failure: false } # minimum supported
- { ruby: 3.1, allowed-failure: false } # latest
- { ruby: ruby-head, allowed-failure: true }
name: test (${{ matrix.entry.ruby }})
- { ruby: 3.3, allowed-failure: false } # minimum supported
- { ruby: 3.4, allowed-failure: false, rubyopt: "--yjit" }
- { ruby: 4.0, allowed-failure: false } # latest stable
- {
ruby: 4.0,
allowed-failure: false,
rubyopt: "--enable-frozen-string-literal",
}
- { ruby: 4.0, allowed-failure: false, rubyopt: "--yjit" }
- { ruby: 4.0, allowed-failure: false, rubyopt: "--zjit" }
- { ruby: truffleruby, allowed-failure: false }

# Head can have failures due to being in development
- { ruby: head, allowed-failure: true }
- {
ruby: head,
allowed-failure: true,
rubyopt: "--enable-frozen-string-literal",
}
- { ruby: head, allowed-failure: true, rubyopt: "--yjit" }
- { ruby: head, allowed-failure: true, rubyopt: "--zjit" }
name: Test Ruby ${{ matrix.entry.ruby }} ${{ matrix.entry.rubyopt }} --${{ matrix.entry.allowed-failure && 'allowed-failure' || 'strict' }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
ruby-version: ${{ matrix.entry.ruby }}
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }}
restore-keys: ${{ runner.os }}-gems-
- run: bundle install --jobs=3 --retry=3 --path=vendor/bundle
bundler-cache: true
bundler: latest
- run: bundle exec rake
continue-on-error: ${{ matrix.entry.allowed-failure }}
memory_profile:
env:
RUBYOPT: ${{ matrix.entry.rubyopt }}

spec:
runs-on: ubuntu-latest
env:
BUNDLE_WITH: spec
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
ruby-version: 2.7
- uses: actions/cache@v1
bundler-cache: true
bundler: latest
- name: Run liquid-spec for all adapters
run: |
for adapter in spec/*.rb; do
echo "=== Running $adapter ==="
bundle exec liquid-spec run "$adapter" --no-max-failures
done

memory_profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }}
restore-keys: ${{ runner.os }}-gems-
- run: bundle install --jobs=3 --retry=3 --path=vendor/bundle
bundler-cache: true
- run: bundle exec rake memory_profile:run
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
pkg
*.rbc
.rvmrc
.ruby-version
Gemfile.lock
.bundle
.byebug_history
Gemfile.lock
12 changes: 8 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ Performance:
Enabled: true

AllCops:
TargetRubyVersion: 2.7
NewCops: disable
SuggestExtensions: false
Exclude:
- 'vendor/bundle/**/*'

Naming/MethodName:
Exclude:
- 'example/server/liquid_servlet.rb'

# Backport https://github.com/Shopify/ruby-style-guide/pull/258
Layout/BeginEndAlignment:
Enabled: true
Style/ClassMethodsDefinitions:
Enabled: false

# liquid filter calls were being mistaken to be calls on arrays
Style/ConcatArrayLiterals:
Exclude:
- 'test/integration/standard_filter_test.rb'
11 changes: 10 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,16 @@ Style/WordArray:

# Offense count: 117
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, AllowCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 260

Naming/PredicatePrefix:
Enabled: false

# Offense count: 1
# This is intentional - early return from begin/rescue in assignment context
Lint/NoReturnInBeginEndBlocks:
Exclude:
- 'lib/liquid/standardfilters.rb'
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.2
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@
* If it makes sense, add tests for your code and/or run a performance benchmark
* Make sure all tests pass (`bundle exec rake`)
* Create a pull request

## Releasing

* Bump the version in `lib/liquid/version.rb`
* Update the `History.md` file
* Open a PR like [this one](https://github.com/Shopify/liquid/pull/1894) and merge it to `main`
* Create a new release using the [GitHub UI](https://github.com/Shopify/liquid/releases/new)

19 changes: 15 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,32 @@ end

gemspec

gem "base64"

group :benchmark, :test do
gem 'benchmark-ips'
gem 'memory_profiler'
gem 'terminal-table'
gem "lru_redux"

install_if -> { RUBY_PLATFORM !~ /mingw|mswin|java/ && RUBY_ENGINE != 'truffleruby' } do
gem 'stackprof'
end
end

group :development do
gem "webrick"
end

group :test do
gem 'rubocop-shopify', '~> 2.7.0', require: false
gem 'benchmark'
gem 'rubocop', '~> 1.82.0'
gem 'rubocop-shopify', '~> 2.18.0', require: false
gem 'rubocop-performance', require: false
end

platform :mri, :truffleruby do
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'master'
end
group :spec do
# Includes the range resource-limit specs from https://github.com/Shopify/liquid-spec/pull/165.
gem 'liquid-spec', github: 'Shopify/liquid-spec', ref: '84bf25e0edbca5f7e530574788b0f875ab331f50'
gem 'activesupport', require: false
end
102 changes: 102 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,107 @@
# Liquid Change Log

## 5.14.0

* Avoid materializing integer ranges in `for` and `tablerow` loops, and account for each visited range item [Ian Ker-Seymer]

## 5.13.0

* Add TruffleRuby in CI [Benoit Daloze]
* Skip slow test raising many exceptions on non-CRuby [Benoit Daloze]
* Reject bare-bracket syntax in strict2 and introduce `self` keyword by [Alok Swamy]
* Add strict2_parse to assign and capture tags by [Alok Swamy]
* Add strict2_parse to increment and decrement tags by [Alok Swamy]
* Update liquid-spec adapters for `missing_features` [Ian Ker-Seymer]
* Prevent `SelfDrop` context mutation across render boundaries [Guilherme Carreiro]
* Fix `SelfDrop` equality [Guilherme Carreiro]
* Let environment `self` shadow `SelfDrop` [Ian Ker-Seymer]

## 5.11.0
* Revert the Inline Snippets tag (#2001), treat its inclusion in the latest Liquid release as a bug, and allow for feedback on RFC#1916 to better support Liquid developers [Guilherme Carreiro]
* Rename the `:rigid` error mode to `:strict2` and display a warning when users attempt to use the `:rigid` mode [Guilherme Carreiro]

## 5.10.0
* Introduce support for Inline Snippets [Julia Boutin]

## 5.9.0
* Introduce `:rigid` error mode for stricter, safer parsing of all tags [CP Clermont, Guilherme Carreiro]

## 5.8.7
* Expose body content in the `Doc` tag [James Meng]

## 5.8.1

* Fix `{% doc %}` tag to be visitable [Guilherme Carreiro]

## 5.8.0

* Introduce the new `{% doc %}` tag [Guilherme Carreiro]

## 5.7.3

* Raise Liquid::SyntaxError when parsing invalidly encoded strings [Chris AtLee]

## 5.7.2 2025-01-31

* Fix array filters to not support nested properties [Guilherme Carreiro]

## 5.7.1 2025-01-24

* Fix the `find` and `find_index`filters to return `nil` when filtering empty arrays [Guilherme Carreiro]
* Fix the `has` filter to return `false` when filtering empty arrays [Guilherme Carreiro]

## 5.7.0 2025-01-16

### Features

* Add `find`, `find_index`, `has`, and `reject` filters to arrays [Guilherme Carreiro]
* Compatibility with Ruby 3.4 [Ian Ker-Seymer]

## 5.6.4 2025-01-14

### Fixes
* Add a default `string_scanner` to avoid errors with `Liquid::VariableLookup.parse("foo.bar")` [Ian Ker-Seymer]

## 5.6.3 2025-01-13
* Remove `lru_redux` dependency [Michael Go]

## 5.6.2 2025-01-13

### Fixes
* Preserve the old behavior of requiring floats to start with a digit [Michael Go]

## 5.6.1 2025-01-13

### Performance improvements
* Faster Expression parser / Tokenizer with StringScanner [Michael Go]

## 5.6.0 2024-12-19

### Architectural changes
* Added new `Environment` class to manage configuration and state that was previously stored in `Template` [Ian Ker-Seymer]
* Moved tag registration from `Template` to `Environment` [Ian Ker-Seymer]
* Removed `StrainerFactory` in favor of `Environment`-based strainer creation [Ian Ker-Seymer]
* Consolidated standard tags into a new `Tags` module with `STANDARD_TAGS` constant [Ian Ker-Seymer]

### Performance improvements
* Optimized `Lexer` with a new `Lexer2` implementation using jump tables for faster tokenization, requires Ruby 3.4 [Ian Ker-Seymer]
* Improved variable rendering with specialized handling for different types [Michael Go]
* Reduced array allocations by using frozen empty constants [Michael Go]

### API changes
* Deprecated several `Template` class methods in favor of `Environment` methods [Ian Ker-Seymer]
* Added deprecation warnings system [Ian Ker-Seymer]
* Changed how filters and tags are registered to use Environment [Ian Ker-Seymer]

### Fixes
* Fixed table row handling of break interrupts [Alex Coco]
* Improved variable output handling for arrays [Ian Ker-Seymer]
* Fix Tokenizer to handle null source value (#1873) [Bahar Pourazar]

## 5.5.0 2024-03-21

Please reference the GitHub release for more information.

## 5.4.0 2022-07-29

### Breaking Changes
Expand Down
Loading
Loading