palkan / view_component-contrib

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

View Component now #46

Closed sethherr closed 3 months ago

sethherr commented 4 months ago

Is your feature request related to a problem? Please describe.

ViewComponent now supports previews that don't have a leading _

By default, ViewComponent requires preview files to have _preview.rb suffix, and it's not configurable (yet).

Since https://github.com/ViewComponent/view_component/pull/2061, View Component searches for preview.rb (rather than _preview.rb)

Describe the solution you'd like

You no longer need the ViewComponentContrib::Preview::Sidecarable

Additional context

I don't use this gem (view_component-contrib), so I'm not going to submit a PR to solve this issue - but I was inspired to do the View Component PR #2061 to support previews in sidecar directories by the Evil Martian blogs on view components, so I figured I should let you know it's possible!

palkan commented 4 months ago

Thanks for letting us know.

I think, however, we still need the extension for this part: https://github.com/palkan/view_component-contrib/blob/bea3236bba4dabc3dd68cb406fc9a050689bbbe2/lib/view_component_contrib/preview/sidecarable.rb#L19-L20

sethherr commented 3 months ago

Oooh, good point. Sorry for not fixing that too!