Skip to content

Releases: ViewComponent/view_component

4.0.0.alpha1

24 Apr 22:22

Choose a tag to compare

4.0.0.alpha1 Pre-release
Pre-release

Almost six years after releasing v1.0.0, we're proud to ship the first alpha release of ViewComponent 4. This release marks a shift towards a Long Term Support model for the project, having reached significant feature maturity. While contributions are always welcome, we're unlikely to accept further breaking changes or major feature additions.

Please test this release and report any issues to this repository.

  • BREAKING: --inline generator option now generates inline template. Use --call to generate #call method.

    Joel Hawksley

  • BREAKING: Remove use_deprecated_instrumentation_name configuration option. Events will always use render.view_component name.

    Joel Hawksley

  • BREAKING: Remove preview_source functionality. Consider using Lookbook instead.

    Joel Hawksley

  • BREAKING: Use Nokogiri::HTML5 instead of Nokogiri::HTML4 for test helpers.

    Noah Silvera, Joel Hawksley

  • BREAKING: Move generators to a ViewComponent namespace.

    Before, ViewComponent generators pollute the generator namespace with a bunch of top level items, and claim the generic "component" name.

    Now, generators live in a "view_component" module/namespace, so what was before rails g component is now rails g view_component:component.

    Paul Sadauskas

  • BREAKING: Require non-EOL Rails (>= 7.1.0).

    Joel Hawksley

  • BREAKING: Require non-EOL Ruby (>= 3.2.0).

    Joel Hawksley

  • BREAKING: Remove render_component and render monkey patch configured with render_monkey_patch_enabled.

    Joel Hawksley

  • BREAKING: Remove support for variant names containing . to be consistent with Rails.

    Stephen Nelson

  • BREAKING: Use ActionView's lookup_context for picking templates instead of the request format.

    3.15 added support for using templates that match the request format, i.e. if /resource.csv is requested then
    ViewComponents would pick _component.csv.erb over _component.html.erb.

    With this release, the request format is no longer considered and instead ViewComponent will use the Rails logic
    for picking the most appropriate template type, i.e. the csv template will be used if it matches the Accept header
    or because the controller uses a respond_to block to pick the response format.

    Stephen Nelson

  • BREAKING: Rename internal methods to have __vc_ prefix if they shouldn't be used by consumers. Make internal constants private. Make Collection#components, Slotable#register_polymorphic_slot private. Remove unused ComponentError class.

    Joel Hawksley

  • Fix bug where request-aware helpers did not work outside of the request context.

    Joel Hawksley, Stephen Nelson

  • ViewComponentsSystemTestController should not be useable outside of test environment

    Joel Hawksley, Stephen Nelson

  • Remove unnecessary ENABLE_RELOADING test suite flag.

    Joel Hawksley

  • Add test coverage for uncovered code.

    Joel Hawksley

  • Remove unnecessary #format methods that returned nil.

    Joel Hawksley

  • Clean up project dependencies, relaxing versions of development gems.

    Joel Hawksley

  • Test against turbo-rails v2.

    Joel Hawksley

  • Test against rspec-rails v7.

    Joel Hawksley

  • Remove unnecessary usage of ruby2_keywords.

    Joel Hawksley

  • Remove unnecessary respond_to checks.

    Tiago Menegaz, Joel Hawksley

  • Do not include internal DocsBuilderComponent or YARD::MattrAccessorHandler in published gem.

    Joel Hawksley

  • Only lock to concurrent-ruby 1.3.4 for Rails 6.1.

    Joel Hawksley

  • Fix generation of ViewComponent documentation that was broken due to HTML safety issues.

    Simon Fish

  • Add documentation on how ViewComponent works.

    Joel Hawksley

  • Clarify that config.use_deprecated_instrumentation_name will be removed in v4.

    Joel Hawksley

  • Run RSpec tests in CI.

    Joel Hawksley

v3.22.0

25 Mar 22:35
5dd1a97

Choose a tag to compare

  • Rewrite ViewComponents at GitHub documentation as more general Best practices.

    Phil Schalm, Joel Hawksley

  • Add unused mechanism for inheriting config from parent modules to enable future engine-local configuration.

    Simon Fish

  • Improve handling of malformed component edge case when mocking components in tests.

    Martin Meyerhoff, Joel Hawksley

  • Clarify error message about render-dependent logic.

    Error messages about render-dependent logic were sometimes inaccurate, saying during initialization despite also being raised after a component had been initialized but before it was rendered.

    Joel Hawksley

  • Remove JS and CSS docs as they proved difficult to maintain and lacked consensus.

    Joel Hawksley

  • Do not prefix release tags with v, per recommendation from @bkuhlmann.

    Joel Hawksley

  • Add ruby 3.4 support to CI.

    Reegan Viljoen

  • Add HomeStyler AI to list of companies using ViewComponent.

    JP Balarini

  • Add Content Harmony & Learn To Be to list of companies using ViewComponent.

    Kane Jamison

v3.21.0

19 Dec 21:52
644bfb7

Choose a tag to compare

  • Updates testing docs to include an example of how to use with RSpec.

    Rylan Bowers

  • Add --skip-suffix option to component generator.

    KAWAKAMI Moeki

  • Add FreeATS to list of companies using ViewComponent.

    Ilia Liamshin

  • Ensure HTML output safety wrapper is used for all inline templates.

    Joel Hawksley

  • Expose .identifier method as part of public API.

    Joel Hawksley

  • Add rails 8 support to CI.

    Reegan Viljoen

  • Updates ActionText compatibility documentation to reference rich_textarea_tag for Rails 8.0 support.

    Alvin Crespo

v3.20.0

31 Oct 19:15
2f4f062

Choose a tag to compare

  • Allow rendering with_collection to accept an optional spacer_component to be rendered between each item.

    Nick Coyne

  • Remove OpenStruct from codebase.

    Oleksii Vasyliev

v3.19.0

23 Oct 15:03
070f0dd

Choose a tag to compare

  • Relax Active Support version constraint in gemspec.

    Simon Fish

v3.18.0

18 Oct 12:31
14446d8

Choose a tag to compare

  • Enable components to use @request and request methods/ivars.

    Blake Williams

  • Fix bug where implicit locales in component filenames threw a NameError.

    Chloe Fons

  • Register ViewComponent tests directory for rails stats.

    Javier Aranda

  • Wrap entire compile step in a mutex to make it more resilient to race conditions.

    Blake Williams

  • Add Niva to companies who use ViewComponent.

    Daniel Vu Dao

  • Fix preview_paths in docs.

    Javier Aranda

v3.17.0

08 Oct 17:06
46a2ff2

Choose a tag to compare

  • Use struct instead openstruct in lib code.

    Oleksii Vasyliev

  • Fix bug where stimulus controller was not added to ERB when stimulus was activated by default.

    Denis Pasin

  • Add typescript support to stimulus generator.

    Denis Pasin

  • Fix the example of #vc_test_request in the API reference to use the correct method name.

    Alberto Rocha

  • Fix development mode race condition that caused an invalid duplicate template error.

    Blake Williams

v3.16.0

01 Oct 18:31
c7eca74

Choose a tag to compare

  • Add template information to multiple template error messages.

    Joel Hawksley

  • Add ostruct to gemspec file to suppress stdlib removal warning.

    Jonathan Underwood

v3.15.1

30 Sep 15:31
a528f1c

Choose a tag to compare

  • Re-add @private, undocumented .identifier method that was only meant for internal framework use but was used by some downstream consumers. This method will be removed in a coming minor release.

    Joel Hawksley

v3.15.0

27 Sep 20:12
0dc9342

Choose a tag to compare

  • Add basic internal testing for memory allocations.

    Joel Hawksley

  • Add support for request formats.

    Joel Hawksley

  • Add rendered_json test helper.

    Joel Hawksley

  • Add with_format test helper.

    Joel Hawksley

  • Warn if using Ruby < 3.2 or Rails < 7.1, which won't be supported by ViewComponent v4, to be released no earlier than April 1, 2025.

    Joel Hawksley

  • Add Kicksite to list of companies using ViewComponent.

    Adil Lari

  • Allow overridden slot methods to use super.

    Andrew Schwartz

  • Add Rails engine support to generators.

    Tomasz Kowalewski

  • Register stats directories with Rails::CodeStatistics.register_directory to support rails stats in Rails 8.

    Petrik de Heus

  • Fixed type declaration for ViewComponent::TestHelpers.with_controller_class parameter.

    Graham Rogers