Skip to content

chore(admin): Upgrade view_component to v4.x - #6540

Open
sascha-karnatz wants to merge 6 commits into
solidusio:mainfrom
fcpeuro:upgrade-view-component-in-admin
Open

chore(admin): Upgrade view_component to v4.x#6540
sascha-karnatz wants to merge 6 commits into
solidusio:mainfrom
fcpeuro:upgrade-view-component-in-admin

Conversation

@sascha-karnatz

Copy link
Copy Markdown
Contributor

Summary

Use the latest version of view_component. It was necessary to adjust a few configurations and fix smaller glitches (missing logger methods and changed translate behavior).

This change is breaking, because the gem is only compatible with view_component >= 4.0.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@sascha-karnatz
sascha-karnatz requested a review from a team as a code owner August 18, 2026 21:01
@github-actions github-actions Bot added changelog:solidus_admin changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem labels Aug 18, 2026
@sascha-karnatz
sascha-karnatz force-pushed the upgrade-view-component-in-admin branch from 95b32eb to dda1d34 Compare August 18, 2026 21:04
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.31%. Comparing base (3da19a9) to head (4ee5df0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6540      +/-   ##
==========================================
- Coverage   92.16%   91.31%   -0.86%     
==========================================
  Files        1037      772     -265     
  Lines       21195    16332    -4863     
==========================================
- Hits        19534    14913    -4621     
+ Misses       1661     1419     -242     

☔ View full report in Codecov by Harness.
📢 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.

@github-actions github-actions Bot added the changelog:solidus_promotions Changes to the solidus_promotions gem label Aug 19, 2026
Upgrade view component to the latest version and update the engine.rb  to prevent exception during the boot. Both configurations are simple replacements.

Ref: https://viewcomponent.org/CHANGELOG.html#400
The patch is not necessary anymore with ViewComponent v4.x in place.
The `config.view_component.test_controller` option was removed in favor of `vc_test_controller_class`.

Ref: https://viewcomponent.org/CHANGELOG.html#breaking-changes-devtest
Prevent undefined method `logger' for class SolidusAdmin::BaseComponent after rendering a component. Switch to the default Rails logger.
Since the upgrade to ViewComponent 4.x the missing translation fallback did not work anymore, because the internal translation handling was changed in view_component. Add two more tests to test the fallback behavior as well.
The SolidusAdmin::BaseComponent does not have an initializer and it is going to propagate the super call into the base view component that changed the signature in version 4.
@sascha-karnatz
sascha-karnatz force-pushed the upgrade-view-component-in-admin branch from dbaf4e7 to 4ee5df0 Compare August 19, 2026 07:58

@tvdeyen tvdeyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Thanks

@tvdeyen tvdeyen moved this to Review in Solidus Admin Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_admin changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem changelog:solidus_promotions Changes to the solidus_promotions gem

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants