From 7124540563d7879bf2f8fe1502f8fa9a69032d3e Mon Sep 17 00:00:00 2001 From: Michael Go Date: Mon, 13 Jan 2025 18:27:56 -0400 Subject: [PATCH 1/2] remove lru-redux --- lib/liquid/context.rb | 2 -- lib/liquid/expression.rb | 2 -- lib/liquid/version.rb | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index 83aab805a..17e7bab2e 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "lru_redux" - module Liquid # Context keeps the variable stack and resolves variables, as well as keywords # diff --git a/lib/liquid/expression.rb b/lib/liquid/expression.rb index 979c34571..adf340f1f 100644 --- a/lib/liquid/expression.rb +++ b/lib/liquid/expression.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "lru_redux" - module Liquid class Expression LITERALS = { diff --git a/lib/liquid/version.rb b/lib/liquid/version.rb index ab7d74083..4cfca9b16 100644 --- a/lib/liquid/version.rb +++ b/lib/liquid/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module Liquid - VERSION = "5.6.2" + VERSION = "5.6.3" end From e200c4544b0456bb42a12f2d58fddc93290f690b Mon Sep 17 00:00:00 2001 From: Michael Go Date: Mon, 13 Jan 2025 18:36:30 -0400 Subject: [PATCH 2/2] remove expression caching while rendering --- lib/liquid/context.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index 17e7bab2e..1ef272d46 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -39,7 +39,6 @@ def initialize(environments = {}, outer_scope = {}, registers = {}, rethrow_erro @filters = [] @global_filter = nil @disabled_tags = {} - @expression_cache = LruRedux::ThreadSafeCache.new(1000) # Instead of constructing new StringScanner objects for each Expression parse, # we recycle the same one. @@ -181,7 +180,7 @@ def []=(key, value) # Example: # products == empty #=> products.empty? def [](expression) - evaluate(Expression.parse(expression, @string_scanner, @expression_cache)) + evaluate(Expression.parse(expression, @string_scanner)) end def key?(key)