palkan / view_component-contrib

A collection of extension and developer tools for ViewComponent
MIT License
369 stars 22 forks source link

Upgrading to ViewComponents 3.0.0 and Lookbook 2.0 fails #33

Closed raivil closed 1 year ago

raivil commented 1 year ago

What did you do?

Upgraded lookbook gem (https://lookbook.build/guide/upgrading) from v1.x to v2.x. Also using ViewComponents 3.0 (which is the real cause of the issue) The app is running fine, only lookbook was affected (afaik).

What did you expect to happen?

Lookbook not to fail :)

What actually happened?

uninitialized constant ViewComponent::PreviewTemplateError

        rescue ViewComponent::PreviewTemplateError
                            ^^^^^^^^^^^^^^^^^^^^^^
Did you mean?  PreviewHelper
/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/view_component-contrib-0.1.3/lib/view_component_contrib/preview/default_template.rb [line 28]

image

Additional context

The error is caused by ViewComponent upgrade to 3.0 (https://github.com/ViewComponent/view_component/compare/v2.82.0...v3.0.0) where lib/view_component/preview_template_error.rb was removed.

Environment

Ruby Version: ruby 3.1.2p20

Framework Version (Rails, whatever): rails (7.0.4.3)

View Component Contrib Version: view_component (~> 3.0.0) view_component-contrib (~> 0.1.3) lookbook (2.0.0)

palkan commented 1 year ago

Hey! This error has been fixed in master, can you please try it? I will release a new version as soon as I check if there are other incompatibilities with VC 3.0 and Lookbook 2.0

palkan commented 1 year ago

Ok, I found one more problem with this change and fixed it. Releasing 0.1.4