Skip to content

Conversation

@sambostock
Copy link
Contributor

This adds a Deprecation object using ActiveSupport::Deprecation, allowing us to log fancy deprecation warnings.

It has been extracted from #81, as it will also be relevant in other PRs.

I believe the missing piece #81 needed to properly work with DeprecationToolkit was that we not only needed to configure it to attach_to our deprecations, but we also needed to add our Deprecation to the host application's deprecators, so DeprecationToolkit will add the :notify behavior to it, so it has notifications to subscribe to.1 The simplest way to do this is for us to use a Railtie to register an initializer which does it.

Footnotes

  1. I feel like there's some documentation that could be improved, either in Rails or in DeprecationToolkit to capture this.

@sambostock sambostock requested a review from Mangara November 21, 2023 08:46
@sambostock sambostock mentioned this pull request Nov 21, 2023
2 tasks
@sambostock sambostock marked this pull request as ready for review November 23, 2023 05:43
Copy link
Contributor Author

@sambostock sambostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have tests for this that spin up a full Rails application (see #459), but in the interest of unblocking some other work, we're going to merge this as is and rely on manually testing the deprecation code paths in host apps for now.

@sambostock sambostock merged commit 1a93b9b into main Feb 9, 2024
@sambostock sambostock deleted the deprecation branch February 9, 2024 17:19
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