github ViewComponent/view_component v1.14.0

latest releases: v3.20.0, v3.19.0, v3.18.0...
4 years ago
  • 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

  1. ActionView::Component::Base is now ViewComponent::Base.
  2. Components can only be rendered with render(MyComponent.new) syntax.
  3. Validations are no longer supported by default.

How to migrate to ViewComponent

  1. In application.rb, require view_component/engine
  2. Update components to inherit from ViewComponent::Base.
  3. Update component tests to inherit from ViewComponent::TestCase.
  4. Update component previews to inherit from ViewComponent::Preview.
  5. Include ViewComponent::TestHelpers in your test suite.

Don't miss a new view_component release

NewReleases is sending notifications on new releases.