#10013·jekyll

Support `json` v3

Author: dduuggCreated Sep 9, 2026Updated Sep 17, 2026
Labelshas-pull-request

Summary

jekyll.gemspec pins json to ~> 2.6, so json 3.x can't be installed alongside Jekyll. I'd like to relax that to < 4.0.

Motivation

The pin propagates to every bundle containing Jekyll, so any project sharing a Gemfile with Jekyll is held back on json 2.x. Same shape as #10003 for Rouge.

Jekyll's json surface is small (pretty_generate and generate(obj, state) in the drops, to_json for jsonify, and dump/parse in the LiveReload reactor) and none of it touches what json 3 removed. Jekyll passes no parse options, so the new allow_comments and allow_duplicate_key defaults don't reach it either, and JSON::State is still accepted by generate, so Drop#to_json(state) is unaffected.

With the constraint relaxed, rake test and cucumber both pass on json 3.0.1 exactly as they do on 2.21.2, with no test changes.

Drawbacks

json 3.0.0 and 3.0.1 raise SyntaxError on require "json" on Ruby 2.7.0 through 2.7.2, because JSON.load_file forwards with ... after a leading parameter. json's gemspec still allows Ruby 2.7 as a whole, so Bundler will pick it there. ruby/json#1072 fixes this but hasn't shipped, so this is probably best landed after the next json release, or with those two versions excluded.

Separately, the :test group pins rubocop ~> 1.57.2, which needs json (~> 2.3), so CI will resolve json 2.x whatever the gemspec says until that pin moves.