Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 30, 2025

Bumps view_component from 3.23.2 to 4.0.0.

Release notes

Sourced from view_component's releases.

4.0.0

Two years after releasing 3.0.0 and almost six years since 1.0.0, we're proud to ship 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 report any issues at https://github.com/ViewComponent/view_component/issues.

Breaking changes (production)

  • Remove dependency on ActionView::Base, eliminating the need for capture compatibility patch. In some edge cases, this change may require switching to use the helpers. proxy.

  • Require non-EOL Rails (>= 7.1.0) and Ruby (>= 3.2.0).

  • Remove render_component and render monkey patch configured with render_monkey_patch_enabled.

  • Remove deprecated use_helper(s). Use include MyHelper or helpers. proxy instead.

  • Support compatibility with Dry::Initializer. As a result, EmptyOrInvalidInitializerError will no longer be raised.

  • Remove default initializer from ViewComponent::Base. Previously, ViewComponent::Base defined a catch-all initializer that allowed components without an initializer defined to be passed arbitrary arguments.

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

  • Remove unnecessary #format methods that returned nil.

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

  • 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.

  • 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, that is 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, that is 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.

Breaking changes (dev/test)

  • Rename config.generate.component_parent_class to config.generate.parent_class.

  • Remove config.test_controller in favor of vc_test_controller_class test helper method.

  • config.component_parent_class is now config.generate.component_parent_class, moving the generator-specific option to the generator configuration namespace.

  • Move previews-related configuration (enabled, route, paths, default_layout, controller) to under previews namespace.

  • config.view_component_path is now config.generate.path, as components have long since been able to exist in any directory.

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

  • Remove broken integration with rails stats that ignored components outside of app/components.

  • Remove preview_source functionality. Consider using Lookbook instead.

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

  • 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.

New features

  • Add SystemSpecHelpers for use with RSpec.
  • Add support for including Turbo::StreamsHelper.
  • Add template annotations for components with def call.
  • Graduate SlotableDefault to be included by default.
  • Add #current_template accessor and Template#path for diagnostic usage.
  • Reduce string allocations during compilation.

... (truncated)

Changelog

Sourced from view_component's changelog.

4.0.0

Two years after releasing 3.0.0 and almost six years since 1.0.0, we're proud to ship 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 report any issues at https://github.com/ViewComponent/view_component/issues.

Breaking changes (production)

  • Remove dependency on ActionView::Base, eliminating the need for capture compatibility patch. In some edge cases, this change may require switching to use the helpers. proxy.

  • Require non-EOL Rails (>= 7.1.0) and Ruby (>= 3.2.0).

  • Remove render_component and render monkey patch configured with render_monkey_patch_enabled.

  • Remove deprecated use_helper(s). Use include MyHelper or helpers. proxy instead.

  • Support compatibility with Dry::Initializer. As a result, EmptyOrInvalidInitializerError will no longer be raised.

  • Remove default initializer from ViewComponent::Base. Previously, ViewComponent::Base defined a catch-all initializer that allowed components without an initializer defined to be passed arbitrary arguments.

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

  • Remove unnecessary #format methods that returned nil.

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

  • 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.

  • 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, that is 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, that is 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.

Breaking changes (dev/test)

  • Rename config.generate.component_parent_class to config.generate.parent_class.

  • Remove config.test_controller in favor of vc_test_controller_class test helper method.

  • config.component_parent_class is now config.generate.component_parent_class, moving the generator-specific option to the generator configuration namespace.

  • Move previews-related configuration (enabled, route, paths, default_layout, controller) to under previews namespace.

  • config.view_component_path is now config.generate.path, as components have long since been able to exist in any directory.

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

  • Remove broken integration with rails stats that ignored components outside of app/components.

  • Remove preview_source functionality. Consider using Lookbook instead.

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

  • 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.

New features

  • Add SystemSpecHelpers for use with RSpec.
  • Add support for including Turbo::StreamsHelper.
  • Add template annotations for components with def call.
  • Graduate SlotableDefault to be included by default.
  • Add #current_template accessor and Template#path for diagnostic usage.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.23.2 to 4.0.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](ViewComponent/view_component@v3.23.2...v4.0.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Updates to dependencies (gems and node modules) major Big (or otherwise significant) pieces of work ruby Involves Ruby code labels Jul 30, 2025
@denny denny merged commit 8583be8 into main Aug 4, 2025
4 checks passed
@denny denny deleted the dependabot/bundler/view_component-4.0.0 branch August 4, 2025 14:06
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7a1f01e) to head (64fd74e).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2079   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          419       419           
  Lines         5861      5863    +2     
=========================================
+ Hits          5861      5863    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Updates to dependencies (gems and node modules) major Big (or otherwise significant) pieces of work ruby Involves Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants