Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails-jquery-autocomplete causes deprecation warning in rails 6 initialization #104

Open
benningm opened this issue Aug 2, 2019 · 1 comment

Comments

@benningm
Copy link

benningm commented Aug 2, 2019

Initialization of this gem triggers a deprecation warning in rails 6:

DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ActionText::ContentHelper, for example,
the expected changes won't be reflected in that stale Module object.

These autoloaded constants have been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions.
 (called from <main> at /myapp/config/environment.rb:5)

Steps to reproduce

# gem install rails --version 6.0.0.rc2
# rails new myapp --skip-javascript
# cd myapp
# rails db:setup
# rails db:migrate
# rails server
verify it works CTRL-C
# tail log/development.log
no warnings
# echo "gem 'rails-jquery-autocomplete'" >> Gemfile
# bundle install
# rails server
verify it works CTRL-C
# tail -n 13 log/development.log
DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ActionText::ContentHelper, for example,
the expected changes won't be reflected in that stale Module object.

These autoloaded constants have been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions.
 (called from <main> at /myapp/config/environment.rb:5)

Analysis

The initialization of this gem seems to trigger an autoload of ActionController::Base which triggers the loading of the ActionText helpers.

Autoloading in intializers is going to be deprecated.

see also rails/rails#36546

@benningm
Copy link
Author

benningm commented Aug 5, 2019

see PR #105

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

No branches or pull requests

1 participant