Skip to content

Deprecate all *_default_options#773

Merged
byroot merged 1 commit intoruby:masterfrom
casperisfine:deprecate-global-configs
Mar 26, 2025
Merged

Deprecate all *_default_options#773
byroot merged 1 commit intoruby:masterfrom
casperisfine:deprecate-global-configs

Conversation

@casperisfine
Copy link
Copy Markdown

Globally changing the behavior of the library is a bad idea, as many different libraries may rely on json and may not expect it and likely never tested that a different default config works for them.

If you need to change the behavior of JSON, it's best to do it only locally, and not globally.

In addition the new JSON::Coder interface is much more suited for that.

Another reason for the deprecation is that it's impossible to make JSON.load and JSON.dump Ractor-safe with such API.

Globally changing the behavior of the library is a bad idea, as
many different libraries may rely on `json` and may not expect it
and likely never tested that a different default config works for them.

If you need to change the behavior of JSON, it's best to do it only
locally, and not globally.

In addition the new `JSON::Coder` interface is much more suited for
that.

Another reason for the deprecation is that it's impossible to
make `JSON.load` and `JSON.dump` Ractor-safe with such API.
@byroot byroot merged commit ffa9019 into ruby:master Mar 26, 2025
33 checks passed
@casperisfine casperisfine deleted the deprecate-global-configs branch March 26, 2025 11:01
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