Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement logic for stringify Hashes to keep compat with 3.4 #1892

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

ianks
Copy link
Contributor

@ianks ianks commented Jan 14, 2025

Ruby 3.4 changes to implementation of Hash#to_s to be a more readable format. However, some Liquid templates rely on the legacy behavior, so we need to support the old format indefinitely.

This PR makes it so Liquid is now responsible for stringify hashes instead of relying on Ruby.

@ianks ianks marked this pull request as ready for review January 14, 2025 19:45
@ianks ianks force-pushed the dpetrick/use_legacy_hash_format branch 3 times, most recently from 842f6ac to 8c89e6a Compare January 14, 2025 23:27
if seen[hash.object_id]
return "{...}"
end
seen[hash.object_id] = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seen could be a Set if the values are always true

@ianks ianks force-pushed the dpetrick/use_legacy_hash_format branch from 8c89e6a to ffca018 Compare January 15, 2025 21:34
@ianks ianks force-pushed the dpetrick/use_legacy_hash_format branch from 9dba903 to d02cf23 Compare January 15, 2025 21:35
@ianks ianks merged commit 4b65a28 into main Jan 15, 2025
13 checks passed
@ianks ianks deleted the dpetrick/use_legacy_hash_format branch January 15, 2025 21:36
@graygilmore graygilmore mentioned this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants