View Component Versions Save

A framework for building reusable, testable & encapsulated view components in Ruby on Rails.

v3.3.0

10 months ago
  • Include InlineTemplate by default in Base. Note: It's no longer necessary to include ViewComponent::InlineTemplate to use inline templates.

    Joel Hawksley

  • Allow Setting host when using the with_request_url test helper.

    Daniel Alfaro

  • Resolve ambiguous preview paths when using components without the Component suffix.

    Reed Law

v3.2.0

10 months ago
  • Fix viewcomponent.org Axe violations.

    Joel Hawksley

  • Fix example of RSpec configuration in docs

    Pasha Kalashnikov

  • Add URL helpers to previews

    Reegan Viljoen

v3.1.0

11 months ago
  • Check defined?(Rails) && Rails.application before using ViewComponent::Base.config.view_component_path.

    Donapieppo

  • Allow customization of polymorphic slot setters.

    Cameron Dutro

  • Fix duplication in configuration docs.

    Tom Chen

  • Fix helpers not reloading in development.

    Jonathan del Strother

  • Add SECURITY.md.

    Joel Hawksley

  • Add Ophelos to list of companies using ViewComponent.

    Graham Rogers

  • Add FlightLogger to list of companies using ViewComponent.

    Joseph Carpenter

  • Fix coverage reports overwriting each other when running locally.

    Jonathan del Strother

  • Add @reeganviljoen to triage team.

    Reegan Viljoen

v3.0.0

1 year ago

1,000+ days and 100+ releases later, the 200+ contributors to ViewComponent are proud to ship v3.0.0!

We're so grateful for all the work of community members to get us to this release. Whether it’s filing bug reports, designing APIs in long-winded discussion threads, or writing code itself, ViewComponent is built by the community, for the community. We couldn’t be more proud of what we’re building together :heart:

This release makes the following breaking changes, many of which have long been deprecated:

  • BREAKING: Remove deprecated slots setter methods. Use with_SLOT_NAME instead.

    Joel Hawksley

  • BREAKING: Remove deprecated SlotsV1 in favor of current SlotsV2.

    Joel Hawksley

  • BREAKING: Remove deprecated content_areas feature. Use Slots instead.

    Joel Hawksley

  • BREAKING: Remove deprecated support for loading ViewComponent engine manually. Make sure require "view_component/engine" is removed from Gemfile.

    Joel Hawksley

  • BREAKING: Remove deprecated generate_* methods. Use generate.* instead.

    Joel Hawksley

  • BREAKING: Remove deprecated with_variant method.

    Joel Hawksley

  • BREAKING: Remove deprecated rendered_component in favor of rendered_content.

    Joel Hawksley

  • BREAKING: Remove deprecated config.preview_path in favor of config.preview_paths.

    Joel Hawksley

  • BREAKING: Support Ruby 2.7+ instead of 2.4+

    Joel Hawksley

  • BREAKING: Remove deprecated before_render_check.

    Joel Hawksley

  • BREAKING: Change counter variable to start iterating from 0 instead of 1.

    Frank S

  • BREAKING: #SLOT_NAME getter no longer accepts arguments. This change was missed as part of the earlier deprecation in 3.0.0.rc1.

    Joel Hawksley

  • BREAKING: Raise TranslateCalledBeforeRenderError, ControllerCalledBeforeRenderError, or HelpersCalledBeforeRenderError instead of ViewContextCalledBeforeRenderError.

    Joel Hawksley

  • BREAKING: Raise SlotPredicateNameError, RedefinedSlotError, ReservedSingularSlotNameError, ContentSlotNameError, InvalidSlotDefinitionError, ReservedPluralSlotNameError, ContentAlreadySetForPolymorphicSlotErrror, SystemTestControllerOnlyAllowedInTestError, SystemTestControllerNefariousPathError, NoMatchingTemplatesForPreviewError, MultipleMatchingTemplatesForPreviewError, DuplicateContentError, EmptyOrInvalidInitializerError, MissingCollectionArgumentError, ReservedParameterError, InvalidCollectionArgumentError, MultipleInlineTemplatesError, MissingPreviewTemplateError, DuplicateSlotContentError or NilWithContentError instead of generic error classes.

    Joel Hawksley

  • BREAKING: Rename SlotV2 to Slot and SlotableV2 to Slotable.

    Joel Hawksley

  • BREAKING: Incorporate PolymorphicSlots into Slotable. To migrate, remove any references to PolymorphicSlots as they are no longer necessary.

    Joel Hawksley

  • BREAKING: Rename private TestHelpers#controller, #build_controller, #request, and #preview_class to avoid conflicts. Note: While these methods were undocumented and marked as private, they were accessible in tests. As such, we're considering this to be a breaking change.

    Joel Hawksley

v3.0.0.rc6

1 year ago

Run into an issue with this release candidate? Let us know. We hope to release v3.0.0 in the near future!

  • BREAKING: #SLOT_NAME getter no longer accepts arguments. This change was missed as part of the earlier deprecation in 3.0.0.rc1.

    Joel Hawksley

  • BREAKING: Raise TranslateCalledBeforeRenderError, ControllerCalledBeforeRenderError, or HelpersCalledBeforeRenderError instead of ViewContextCalledBeforeRenderError.

    Joel Hawksley

  • BREAKING: Raise SlotPredicateNameError, RedefinedSlotError, ReservedSingularSlotNameError, ContentSlotNameError, InvalidSlotDefinitionError, ReservedPluralSlotNameError, ContentAlreadySetForPolymorphicSlotErrror, SystemTestControllerOnlyAllowedInTestError, SystemTestControllerNefariousPathError, NoMatchingTemplatesForPreviewError, MultipleMatchingTemplatesForPreviewError, DuplicateContentError, EmptyOrInvalidInitializerError, MissingCollectionArgumentError, ReservedParameterError, InvalidCollectionArgumentError, MultipleInlineTemplatesError, MissingPreviewTemplateError, DuplicateSlotContentError or NilWithContentError instead of generic error classes.

    Joel Hawksley

  • Fix bug where content? and with_content didn't work reliably with slots.

    Derek Kniffin, Joel Hawksley

  • Add with_SLOT_NAME_content helper.

    Will Cosgrove

  • Allow ActiveRecord objects to be passed to renders_many.

    Leigh Halliday

  • Fix broken links in documentation.

    Ellen Keal

  • Run standardrb against markdown in docs.

    Joel Hawksley

  • Allow .with_content to be redefined by components.

    Joel Hawksley

  • Run standardrb against markdown in docs.

    Joel Hawksley

  • Raise error if translations are used in initializer.

    Joel Hawksley

v3.0.0.rc5

1 year ago
  • Fix bug where mkdir_p failed due to incorrect permissions.

    Joel Hawksley

  • Check for inline erb_template calls when deciding whether or not to compile a component's superclass.

    Justin Kenyon

  • Protect against SystemStackError if CaptureCompatibility module is included more than once.

    Cameron Dutro

v3.0.0.rc4

1 year ago

Run into an issue with this release candidate? Let us know.

  • Add TestHelpers#vc_test_request.

    Joel Hawksley

v3.0.0.rc3

1 year ago

Run into an issue with this release candidate? Let us know.

  • Fix typos in generator docs.

    Sascha Karnatz

  • Add TestHelpers#vc_test_controller.

    Joel Hawksley

  • Document config.view_component.capture_compatibility_patch_enabled as option for the known incompatibilities with Rails form helpers.

    Tobias L. Maier

  • Add support for experimental inline templates.

    Blake Williams

  • Expose translate and t I18n methods on component classes.

    Elia Schito

  • Protect against Arbitrary File Read edge case in ViewComponentsSystemTestController.

    Nick Malcolm

v3.0.0.rc2

1 year ago

Run into an issue with this release? Let us know.

  • BREAKING: Rename SlotV2 to Slot and SlotableV2 to Slotable.

    Joel Hawksley

  • BREAKING: Incorporate PolymorphicSlots into Slotable. To migrate, remove any references to PolymorphicSlots as they are no longer necessary.

    Joel Hawksley

  • BREAKING: Rename private TestHelpers#controller, #build_controller, #request, and #preview_class to avoid conflicts. Note: While these methods were undocumented and marked as private, they was easily accessible in tests. As such, we're cautiously considering this to be a breaking change.

    Joel Hawksley

  • Avoid loading ActionView::Base during Rails initialization. Originally submitted in #1528.

    Jonathan del Strother

  • Improve documentation of known incompatibilities with Rails form helpers.

    Tobias L. Maier

  • Remove dependency on environment task from view_component:statsetup.

    Svetlin Simonyan

  • Add experimental config.view_component.capture_compatibility_patch_enabled option resolving rendering issues related to forms, capture, turbo frames, etc.

    Blake Williams

  • Add #content? method that indicates if content has been passed to component.

    Joel Hawksley

  • Added example of a custom preview controller.

    Graham Rogers

  • Add Krystal to list of companies using ViewComponent.

    Matt Bearman

  • Add Mon Ami to list of companies using ViewComponent.

    Ethan Lee-Tyson

v3.0.0.rc1

1 year ago

1,000+ days and 100+ releases later, the 200+ contributors to ViewComponent are proud to ship v3.0.0!

We're so grateful for all of the work of community members to get us to this release. Whether it’s filing bug reports, designing APIs in long-winded discussion threads, or writing code itself, ViewComponent is built by the community, for the community. We couldn’t be more proud of what we’re building together :heart:

This release makes the following breaking changes, many of which have long been deprecated:

  • BREAKING: Remove deprecated slots setter methods. Use with_SLOT_NAME instead.

    Joel Hawksley

  • BREAKING: Remove deprecated SlotsV1 in favor of current SlotsV2.

    Joel Hawksley

  • BREAKING: Remove deprecated content_areas feature. Use Slots instead.

    Joel Hawksley

  • BREAKING: Remove deprecated support for loading ViewComponent engine manually. Make sure require "view_component/engine" is removed from Gemfile.

    Joel Hawksley

  • BREAKING: Remove deprecated generate_* methods. Use generate.* instead.

    Joel Hawksley

  • BREAKING: Remove deprecated with_variant method.

    Joel Hawksley

  • BREAKING: Remove deprecated rendered_component in favor of rendered_content.

    Joel Hawksley

  • BREAKING: Remove deprecated config.preview_path in favor of config.preview_paths.

    Joel Hawksley

  • BREAKING: Support Ruby 2.7+ instead of 2.4+

    Joel Hawksley

  • BREAKING: Remove deprecated before_render_check.

    Joel Hawksley

  • BREAKING: Change counter variable to start iterating from 0 instead of 1.

    Frank S

Run into an issue with this release? Let us know.