Skip to content

Only define String.json_create & al when json/add is required#833

Merged
byroot merged 1 commit into
ruby:masterfrom
byroot:string-json-create
Aug 3, 2025
Merged

Only define String.json_create & al when json/add is required#833
byroot merged 1 commit into
ruby:masterfrom
byroot:string-json-create

Conversation

@byroot
Copy link
Copy Markdown
Member

@byroot byroot commented Aug 3, 2025

All the json/add related methods for string were always defined unconditionally from the generators.

It's preferable to only define them if json/add is actually used.

All the `json/add` related methods for string were
always defined unconditionally from the generators.

It's preferable to only define them if `json/add` is actually used.
@byroot byroot merged commit 3090a63 into ruby:master Aug 3, 2025
35 checks passed
@byroot byroot deleted the string-json-create branch August 3, 2025 08:43
@jmthomas
Copy link
Copy Markdown

jmthomas commented Sep 18, 2025

@byroot this appears to have been released in v2.14.0 and it wasn't even mentioned in the release notes. This is a breaking change (at least it broke me) because I was calling to_json_raw_object and after this change I had to add require 'json/add/string' for that to work.

I'm not asking for a revert or anything but it's definitely worth mentioning in the release notes.

@byroot
Copy link
Copy Markdown
Member Author

byroot commented Sep 18, 2025

efd67e7

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.

2 participants