palkan/view_component-contrib

Fresh install throws a deprecation warning due to manually loading the engine

Closed this issue · 1 comments

What did you do?

  • Installed a fresh version of view_component-contrib
  • Generated a new component
  • Ran tests

What did you expect to happen?

Nothing specific?

What actually happened?

Got

DEPRECATION WARNING: Manually loading the engine is deprecated and will be removed from ViewComponent 3.0.0 (remove `require "view_component/engine"`) (called from require at /Users/moroz/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32)

Additional context

Seems like the solution would be to avoid adding require "view_component/engine" to config/application.rb. Removed the line: tests pass, warning went away

https://github.com/budu/view_component-contrib/blob/9459f01014e8e9f4d3d977340c7a967eec526300/app/templates/install/template.rb#L6

Environment

Ruby Version:
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22]

Framework Version (Rails, whatever):
ruby Rails 7.1.0.alpha @ 717d53edcce8fc0d7a757ed92ec867afb71a9ec8

View Component Contrib Version: 0.1.2

palkan commented

Thanks for the report!

Fixed.