Project

General

Profile

Actions

Feature #19998

open

Emit deprecation warnings when the old (non-Typed) Data_XXX API is used

Added by byroot (Jean Boussier) 6 months ago. Updated 5 months ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:115334]

Description

The replacement API was introduced in Ruby 1.9.2 (2010) [Feature #3064], and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015): https://github.com/ruby/ruby/commit/98544c372d948717de22afc86d162e411f1fb5f1

However, as of today, no deprecation warning of any sort is emitted when the API is used.

Ultimately removing the old untyped API would allow to easily reclaim 8B on every T_DATA which could be used by the newly introduced embedded TypedData objects https://github.com/ruby/ruby/pull/7440

Was there any discussions about removing the old API at some point?

Could we emit a warning when the API is used? Either verbose or non-verbose, to at least surface the issue to gem owners? This would help drive the effort to fix outdated gems, allowing to eventually remove this old API in the future.

Looking at our big applications dependencies, there seem to be a small minority of gems still using the old API:

Migrating them over doesn't seem too hard.

Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0