Update dependency constraint to allow for liquid v5.0.0
jekyllbot opened this issue ยท 16 comments
Hey there! ๐
I noticed that the constraint you have for liquid doesn't allow for the latest version to be used.
The constraint I found was ~> 4.0
, and the latest version available is 5.0.0
.
Can you look into updating that constraint so our users can use the latest and greatest version? Thanks! ๐
FWIW, we had to make a breaking change to support Liquid 5. bridgetownrb/bridgetown#224
Seems that for conditionals (aka in the where
filter), ''
, blank
, and empty
are now all equivalent, since there's no clear way to detect ''
vs. blank
/empty
.
I was also wondering why Jekyll isnt using Liquid 5 yet. What do Shopify/liquid maintainers say about the breaking change?
@jaredcwhite Thanks for the tip, our test suite is still failing when I apply your fix ๐คท also Liquid-c 5.0 hasn't been released yet.
Is there a way to force my Jekyll installation to use Liquid 5 or 5.1? Liquid performance is pretty poor in the current Jekyll release, and I'd like to see if the later versions have improved performance.
Is there a way to force my Jekyll installation to use Liquid 5 or 5.1?
@SimonEast No, Officially, you can't force Jekyll to use Liquid 5+.
However, there is a workaround (via a nasty hack).
- Clone the Liquid repository.
- Checkout one of the release-tags (
v5.1.0
/v5.0.1
/v5.0.0
) (if you don't want to use unreleased changes). - Change the vesion-string in
lib/liquid/version.rb
to be something in the4.x
series. - Update your
Gemfile
to use the local clone:# Gemfile gem "liquid", path: "path/to/local_repo"
- Then invoke Jekyll via Bundler. e.g.
bundle exec jekyll build
@ashmaroli Thank you for this! I've added your solution to my Makefile + Gemfile files
Makefile
.EXPORT_ALL_VARIABLES:
ROOT_DIR=${PWD}
LIQUID_VERSION=v5.3.0
LIQUID_PATH=${ROOT_DIR}/.liquid-${LIQUID_VERSION}
LIQUID_LIB_PATH=${ROOT_DIR}/${LIQUID_PATH}/lib
LIQUID_VERSION_PATH=${LIQUID_LIB_PATH}/liquid/version.rb
ifneq ("$(wildcard /${LIQUID_VERSION_PATH})","")
LIQUID_VERSION_PATH_EXISTS=true
else
LIQUID_VERSION_PATH_EXISTS=false
endif
fix-liquid:
@if [ ${LIQUID_VERSION_PATH_EXISTS} = true ] ; then \
git clone --branch ${LIQUID_VERSION} https://github.com/Shopify/liquid.git ${LIQUID_PATH} && \
cd ${LIQUID_PATH} && \
git switch -c ${LIQUID_VERSION} && \
sed -i.bak 's~${LIQUID_VERSION}~4.0.3~' ${LIQUID_VERSION_PATH} ; \
fi
bundle-jekyll: fix-liquid
pwd
ls -lh
bundle exec jekyll build
ls -lh
Gemfile
gem "jekyll", "~> 4.2.2"
gem "liquid", "4.0.3", path: ".liquid-v5.3.0"