-
Rename ActionView::Component::Base to ViewComponent::Base
Joel Hawksley
This release renames the bulk of the library to the ViewComponent
namespace, preserving backward compatibility with
ActionView::Component::Base
and the associated base classes for now.
This change will allow users of the library to migrate to the next
major version ahead of the major v2 release.
What's changing in the migration
ActionView::Component::Base
is nowViewComponent::Base
.- Components can only be rendered with
render(MyComponent.new)
syntax. - Validations are no longer supported by default.
How to migrate to ViewComponent
- In
application.rb
, requireview_component/engine
- Update components to inherit from
ViewComponent::Base
. - Update component tests to inherit from
ViewComponent::TestCase
. - Update component previews to inherit from
ViewComponent::Preview
. - Include
ViewComponent::TestHelpers
in your test suite.