Skip to content

Avoid loading unused ActiveSupport::Configurable during reflection - #2748

Open
thomasklemm wants to merge 1 commit into
Shopify:mainfrom
thomasklemm:fix/skip-unused-active-support-configurable
Open

thomasklemm wants to merge 1 commit into
Shopify:mainfrom
thomasklemm:fix/skip-unused-active-support-configurable

Conversation

@thomasklemm

@thomasklemm thomasklemm commented Oct 20, 2026 •

Copy link
Copy Markdown

Motivation

On Rails 8.1, generating gem RBIs can emit ActiveSupport::Configurable is deprecated without replacement, and will be removed in Rails 8.2 even when the application never uses that API. With deprecations configured to raise, generation fails instead.

Rails deliberately removed Configurable from its eager autoloads in rails/rails#55943: its plain autoload must remain available, but loading the file emits the deprecation. Tapioca's autoload tracker currently forces it anyway. This is a different mechanism from the deprecated constant proxies addressed in #2701.

Implementation

Runtime::Reflection.constantize leaves the Rails 8.1+ Configurable autoload pending when asked for it or a constant under it, unless the application already loaded it. The check sits in the shared lookup rather than in the autoload tracker, because the gem pipeline resolves symbols and subconstants through the same helper. Other autoloads load normally, explicit usage still emits the Rails deprecation and generates Configurable RBIs, and Rails 8.0 is unchanged.

Tests

Added a CLI test that generates Active Support RBIs with deprecations set to raise and leaves the Configurable autoload unchanged (it fails without the fix), and a control showing that explicit Configurable usage still warns and gets its RBI. A maintainer will need to add the bugfix release label.

@thomasklemm
thomasklemm requested a review from a team as a code owner October 20, 2026 11:42
@thomasklemm
thomasklemm force-pushed the fix/skip-unused-active-support-configurable branch from b308489 to 272facd Compare October 20, 2026 12:59
@thomasklemm

Copy link
Copy Markdown
Author

Friendly ping: is there anything I can change to help get this reviewed? Thanks!

Leave the deprecated Rails 8.1 API pending instead of triggering its
load-time deprecation while eager loading or compiling gem symbols.
Keep explicit usage warnings and already-loaded APIs intact.
@thomasklemm
thomasklemm force-pushed the fix/skip-unused-active-support-configurable branch from 7294b59 to dd72843 Compare November 18, 2026 11:59

This branch has not been deployed

No deployments
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.

1 participant