Skip to content

[Misc #21768] Remove deprecated APIs#15447

Merged
matzbot merged 4 commits into
ruby:masterfrom
nobu:deprecated-funcs
May 28, 2026
Merged

[Misc #21768] Remove deprecated APIs#15447
matzbot merged 4 commits into
ruby:masterfrom
nobu:deprecated-funcs

Conversation

@nobu

@nobu nobu commented Dec 8, 2025

Copy link
Copy Markdown
Member

@matzbot
matzbot requested a review from a team December 8, 2025 12:41
@eregon

eregon commented Dec 8, 2025

Copy link
Copy Markdown
Member

Nice.
Re Remove struct RData deprecated by struct RTypedData I know one usage in concurrent-ruby.
I suppose the reason is TypedData was not available yet for the oldest supported version back then, but that seems fine now, so we'll fix it in concurrent-ruby.
Related discussion: https://bugs.ruby-lang.org/issues/19998
I think it's good to remove RData if we can.

@nobu
nobu force-pushed the deprecated-funcs branch 2 times, most recently from 2af2aa0 to 0386f2b Compare December 8, 2025 17:17
k0kubun added a commit to ruby/ruby-bench that referenced this pull request Dec 9, 2025
Fix the use of deprecated C API ruby/ruby#15447
@k0kubun

k0kubun commented Dec 9, 2025

Copy link
Copy Markdown
Member

If you decide to merge this PR, please consider merging ruby/ruby-bench#455 to fix the ruby-bench CI. You should have write permission on the repository.

@nobu nobu added the ruby 4.1 label Dec 22, 2025
@nobu
nobu force-pushed the deprecated-funcs branch 8 times, most recently from 6c10d2e to a4c9d23 Compare December 26, 2025 08:00
@nobu nobu changed the title [Misc #21768] Remove deprecated functions [Misc #21768] Remove deprecated APIs Dec 26, 2025
@nobu
nobu force-pushed the deprecated-funcs branch 2 times, most recently from cf93ac6 to 4cb105e Compare December 26, 2025 14:37
@nobu
nobu force-pushed the deprecated-funcs branch from 4cb105e to b62b8d0 Compare January 8, 2026 12:30
@cloudbees-smart-tests

This comment has been minimized.

@nobu
nobu force-pushed the deprecated-funcs branch 2 times, most recently from eecbe6c to 9379804 Compare January 9, 2026 08:20
@sandstrom

Copy link
Copy Markdown

Nice to see that Ruby is cleaning up deprecated and old methods.

I love Ruby, but there is a bit of cruft in the stdlib, so nice to see some of it go away (still more things that I think could be cut, so that effort can instead be spent on making the frequently used parts of the stdlib more ergonomic, better documented, etc).

@nobu
nobu force-pushed the deprecated-funcs branch from 464a638 to 7ce6eda Compare January 16, 2026 11:40
@larskanis

Copy link
Copy Markdown
Contributor

Can you please merge this PR early in the release cycle? There are quite some gems out there which still use the untyped data API. I have at least 2 actively maintained gems, which still makes use of it: "fxruby" and "pkcs11".

@nobu
nobu force-pushed the deprecated-funcs branch from 1a676ee to 2683a37 Compare May 28, 2026 10:31
@matzbot
matzbot merged commit f6886fc into ruby:master May 28, 2026
116 checks passed
@nobu
nobu deleted the deprecated-funcs branch May 28, 2026 16:28
byroot added a commit that referenced this pull request May 29, 2026
larskanis added a commit to larskanis/swig that referenced this pull request Jun 10, 2026
The old API was removed in ruby/ruby#15447 and the change will be released in ruby-4.1.
Ruby-4.0 still supports the old untyped API.
kou pushed a commit to groonga/fluent-plugin-groonga that referenced this pull request Jun 16, 2026
This commit replaces the `yajl-ruby` dependency with Ruby's standard
`json` gem for the following reasons:

1. Future Compatibility: `yajl-ruby` is no longer actively maintained
and relies on internal C APIs that are removed in Ruby 4.1. Migrating to
the standard `json` gem ensures the plugin can continue to be built and
used in future Ruby environments. Ref.
ruby/ruby#15447,
brianmario/yajl-ruby#233
2. Performance: The standard `json` gem has seen significant
improvements in recent updates and now outperforms `yajl-ruby`.

```ruby
require 'bundler/inline'
gemfile do
  source 'https://rubygems.org'
  gem 'benchmark-ips'
  gem 'yajl-ruby', require: 'yajl'
  gem 'json'
end

Benchmark.ips do |x|
  json = '{"a":"Alpha","b":true,"c":12345,"d":[true,[false,[-123456789,null],3.9676,["Something else.",false],null]],"e":{"zero":null,"one":1,"two":2,"three":[3],"four":[0,1,2,3,4]},"f":null,"h":{"a":{"b":{"c":{"d":{"e":{"f":{"g":null}}}}}}},"i":[[[[[[[null]]]]]]]}'

  x.report('Yajl.load') {
    Yajl.load(json)
  }
  x.report('JSON.parse') {
    JSON.parse(json)
  }

  x.compare!
end
```

```
ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux]
Warming up --------------------------------------
           Yajl.load    20.019k i/100ms
          JSON.parse    80.144k i/100ms
Calculating -------------------------------------
           Yajl.load    202.875k (± 0.2%) i/s    (4.93 μs/i) -      1.021M in   5.032515s
          JSON.parse    808.103k (± 0.2%) i/s    (1.24 μs/i) -      4.087M in   5.057949s

Comparison:
JSON.parse:   808103.0 i/s
 Yajl.load:   202874.5 i/s - 3.98x  slower
```
wsfulton pushed a commit to swig/swig that referenced this pull request Jun 16, 2026
The old API was removed in ruby/ruby#15447 and the change will be released in ruby-4.1.
Ruby-4.0 still supports the old untyped API.
Watson1978 added a commit to Watson1978/fluent-plugin-elasticsearch that referenced this pull request Jun 17, 2026
This commit replaces the `yajl-ruby` dependency with Ruby's standard `json` gem for the following reasons:

1. Future Compatibility: `yajl-ruby` is no longer actively maintained and relies on internal C APIs that are removed in Ruby 4.1.
   Migrating to the standard `json` gem ensures the plugin can continue to be built and used in future Ruby environments.
   Ref. ruby/ruby#15447, brianmario/yajl-ruby#233
2. Performance: The standard `json` gem has seen significant improvements in recent updates and now outperforms `yajl-ruby`.

```ruby
require 'bundler/inline'
gemfile do
  source 'https://rubygems.org'
  gem 'benchmark-ips'
  gem 'yajl-ruby', require: 'yajl'
  gem 'json'
end

Benchmark.ips do |x|
  json = '{"a":"Alpha","b":true,"c":12345,"d":[true,[false,[-123456789,null],3.9676,["Something else.",false],null]],"e":{"zero":null,"one":1,"two":2,"three":[3],"four":[0,1,2,3,4]},"f":null,"h":{"a":{"b":{"c":{"d":{"e":{"f":{"g":null}}}}}}},"i":[[[[[[[null]]]]]]]}'

  x.report('Yajl.load') {
    Yajl.load(json)
  }
  x.report('JSON.parse') {
    JSON.parse(json)
  }

  x.compare!
end
```

```
ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux]
Warming up --------------------------------------
           Yajl.load    20.019k i/100ms
          JSON.parse    80.144k i/100ms
Calculating -------------------------------------
           Yajl.load    202.875k (± 0.2%) i/s    (4.93 μs/i) -      1.021M in   5.032515s
          JSON.parse    808.103k (± 0.2%) i/s    (1.24 μs/i) -      4.087M in   5.057949s

Comparison:
JSON.parse:   808103.0 i/s
 Yajl.load:   202874.5 i/s - 3.98x  slower
```
kenhys pushed a commit to uken/fluent-plugin-elasticsearch that referenced this pull request Jun 18, 2026
This commit replaces the `yajl-ruby` dependency with Ruby's standard `json` gem for the following reasons:

1. Future Compatibility: `yajl-ruby` is no longer actively maintained and relies on internal C APIs that are removed in Ruby 4.1.
   Migrating to the standard `json` gem ensures the plugin can continue to be built and used in future Ruby environments.
   Ref. ruby/ruby#15447, brianmario/yajl-ruby#233
2. Performance: The standard `json` gem has seen significant improvements in recent updates and now outperforms `yajl-ruby`.

```ruby
require 'bundler/inline'
gemfile do
  source 'https://rubygems.org'
  gem 'benchmark-ips'
  gem 'yajl-ruby', require: 'yajl'
  gem 'json'
end

Benchmark.ips do |x|
  json = '{"a":"Alpha","b":true,"c":12345,"d":[true,[false,[-123456789,null],3.9676,["Something else.",false],null]],"e":{"zero":null,"one":1,"two":2,"three":[3],"four":[0,1,2,3,4]},"f":null,"h":{"a":{"b":{"c":{"d":{"e":{"f":{"g":null}}}}}}},"i":[[[[[[[null]]]]]]]}'

  x.report('Yajl.load') {
    Yajl.load(json)
  }
  x.report('JSON.parse') {
    JSON.parse(json)
  }

  x.compare!
end
```

```
ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux]
Warming up --------------------------------------
           Yajl.load    20.019k i/100ms
          JSON.parse    80.144k i/100ms
Calculating -------------------------------------
           Yajl.load    202.875k (± 0.2%) i/s    (4.93 μs/i) -      1.021M in   5.032515s
          JSON.parse    808.103k (± 0.2%) i/s    (1.24 μs/i) -      4.087M in   5.057949s

Comparison:
JSON.parse:   808103.0 i/s
 Yajl.load:   202874.5 i/s - 3.98x  slower
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants