Skip to content

Remove unparse and restore aliases.#775

Merged
byroot merged 1 commit intoruby:masterfrom
casperisfine:remove-deprecated-aliases
Mar 26, 2025
Merged

Remove unparse and restore aliases.#775
byroot merged 1 commit intoruby:masterfrom
casperisfine:remove-deprecated-aliases

Conversation

@casperisfine
Copy link

These were deprecated 16 years ago.

These were deprecated 16 years ago.
@byroot byroot merged commit 44886b0 into ruby:master Mar 26, 2025
33 checks passed
@Earlopain
Copy link
Contributor

Hm, should this have been done in a patch version? From the comment the intention was to deprecate, but it hasn't actually happened (only nodoc). It breaks sidekiq-batch because it uses JSON.unparse here.

A fix is simple enough but there was no deprecation warning for this alias that would have helped me out here.

@casperisfine
Copy link
Author

but it hasn't actually happened (only nodoc).

nodoc means it isn't public API hence can be removed, so it was effectively deprecated. I get that an actual deprecation warning would have been better.

That being said, since I never saw unparse used in the past I assumed it was just some left over, a quick code search shows there is indeed some use in the wild: https://github.com/search?q=JSON.unparse+language%3ARuby&type=code&l=Ruby.

So perhaps it should go through explicit deprecation.

@Earlopain
Copy link
Contributor

I would say nodoc implies that is was documented at some point (although I haven't been around Ruby 16 years ago, so I wouldn't know personally). Looks like for sidekiq-batch, it was only added 8 years ago with breamware/sidekiq-batch@7792062. Can't really tell why that was done though 🤷

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