ViewComponent/view_component
49.7
Weak · 14 November 2026
6.3k
lines of production code
Ruby
primary language
5
measurements over time
What this system is
Features
Add benchmark view templates for rendering performance testing
New partial view templates (\_partial.html.erb and \_nested.html.erb) have been added to the performance/views/benchmarks directory to support rendering benchmarks. The \_partial template renders a heading and iterates 50 times to render the \_nested template, allowing for the measurement of view rendering performance under load.
performance/views · high confidence
Add performance benchmark components for ViewComponent patterns
Added a suite of ViewComponent-based benchmark fixtures in the \performance/components\ directory to measure rendering performance across different patterns. These include components for global I18n (\GlobalI18nComponent\), sidecar I18n (\TranslatableComponent\), nested rendering (\NameComponent\, \InlineComponent\, \NewInlineComponent\), and slot usage (\SlotsComponent\). These components serve as the basis for performance tracking and comparison.
performance/components · high confidence
Add support for Rails 7.1, 7.2, 8.0, 8.1, and 8.2
The gemfile appraisal suite now includes configurations for Rails 7.1, 7.2, 8.0, 8.1, and 8.2 (including the main development branch), enabling the library to be tested against these versions. This ensures compatibility with the latest Rails releases and allows users to integrate the library into applications running on these frameworks.
gemfiles · high confidence
Added GitHub Codespaces configuration for bug replication
Developers can now use GitHub Codespaces to quickly replicate bugs using a pre-configured Ruby on Rails and PostgreSQL environment. The new .devcontainer setup includes a Dockerfile with Rails and Webdrivers, a docker-compose configuration linking the app to a Postgres database, and a devcontainer.json that automatically runs the 'script/replicate-bug' command upon creation to streamline the debugging workflow.
.devcontainer · high confidence
Initial release of the TestEngine Rails engine
This change introduces the TestEngine, a new Rails engine that isolates the TestEngine namespace and provides a scaffold for ViewComponent-based features. It includes a basic ExampleComponent with its template, a preview for visual testing, and generator tests to ensure components, previews, and test files are created correctly within the engine's isolated namespace. The engine is initialized at version 0.1.0.
_test\engine · high confidence
New Active Job serializer for ViewComponent serialization
ViewComponent now includes a dedicated Active Job serializer that enables components to be passed as arguments to background jobs. The new \ViewComponent::ActiveJobSerializer\ detects \ViewComponent::Serializable::Proxy\ instances and handles their serialization and deserialization, allowing components to be safely queued and processed by Active Job.
_lib/view\component · high confidence
New preview and system test controllers for ViewComponent
Two new controllers are introduced to handle ViewComponent previews and system testing: \ViewComponentsController\ serves as the base for preview actions, while \ViewComponentsSystemTestController\ provides a dedicated endpoint for system tests. The system test controller includes security measures to prevent arbitrary file read vulnerabilities by validating file paths against a temporary directory, ensuring that only files within the expected scope are rendered.
app/controllers · high confidence
New preview index and detail pages for ViewComponent previews
The application now includes dedicated view templates for browsing and viewing component previews. The new \index.html.erb\ provides a list of all available previews with links to their individual pages, while \previews.html.erb\ displays the examples for a specific preview. The \preview.html.erb\ template handles the actual rendering of a selected preview, supporting both direct component rendering and template-based previews with locals.
_app/views/view\components · high confidence
New release and contributor automation scripts
The repository now includes several new scripts to streamline the release process and documentation maintenance. \script/publish\ handles the final release steps, including GitHub permission checks, tag creation, changelog extraction, documentation publishing to gh-pages, and GitHub release creation, while explicitly dispatching the \push\_gem\ workflow to ensure the gem is pushed to RubyGems. \script/release\ automates the pre-release workflow by creating a release branch, updating version numbers in \lib/view\_component/version.rb\ and \lib/view\_component/deprecation.rb\, updating lockfiles, building docs (which now includes syncing contributors via \script/sync\_contributors.rb\), and opening a PR. \script/replicate-bug\ helps developers create a minimal Rails app to reproduce bugs, and \script/sync\_contributors.rb\ fetches contributor data from the GitHub API to update \docs/\_data/contributors.yml\. Additionally, \script/console\ has been updated to require \view\_component\ instead of \action\_view/component\.
script · high confidence
Architecture
Centralize preview controller logic into a reusable concern
The preview controller functionality has been extracted into the \ViewComponent::PreviewActions\ concern. This change centralizes the logic for rendering component previews, handling locale setting, and managing view paths, ensuring that the preview actions are consistent and reusable across different controllers. Users benefit from a more modular architecture where preview-related behaviors are encapsulated in a single, maintainable location.
app/controllers/concerns · high confidence
Behavioural changes
1 commit (0 fixes) modifying lib/docs
A change to existing behaviour in lib/docs — 1 commit, 1 file: “do not ship DocsBuilderComponent or YARD::MattrAccessorHandler (\#2274)” (refs \#2274).
lib/docs · low confidence · unverified
29 commits (6 fixes) modifying lib/view\_component/cache\_digest
A change to existing behaviour in lib/view\_component/cache\_digest — 29 commits (6 fixs), 3 files: “Report the errors swallowed while computing a cache digest”; “Fix unresolvable interpolated render dependencies”; “Hook cache digest resolver into Digestor instead of view paths”; and 26 more.
_lib/view\_component/cache\digest · medium confidence · unverified
Add Ractor-readiness auditing and modernize development tooling
The project now includes an \.audition.yml\ configuration and a \.audition-baseline.json\ file to track Ractor-readiness findings (such as class-level state and unsafe calls) for Ruby's concurrency features, ensuring new code does not introduce regressions. Development tooling has been updated to use StandardRB instead of Rubocop-GitHub, and the test suite now runs RSpec tests alongside Minitest via a new \rspec\ rake task and \.rspec\ configuration. The \.tool-versions\ file sets the development Ruby version to 4.1-dev, and the \Appraisals\ file has been expanded to test against Rails 7.1, 7.2, 8.0, 8.1, and main branches.
(repo-wide) · high confidence
Generators reorganized under ViewComponent namespace with inline template support
The generator files have been moved into the \ViewComponent::Generators\ namespace and refactored to use a shared \AbstractGenerator\ module. This change introduces a new \--inline\ option for the component generator, allowing users to generate components with the template code embedded directly in the Ruby class (via \template\_engine\_template\) instead of a separate view file. The generators now read configuration from the \config.generate\ namespace (e.g., \config.generate.path\, \config.generate.sidecar\) and support generating Stimulus controllers with TypeScript options, locale files, and previews alongside the component.
lib/generators · high confidence
Removal of ActionView::Component monkey patch and base class
The file lib/action\_view/component.rb has been deleted, removing the previous implementation of the ActionView::Component base class and its monkey patch to ActionView::Base\#render. This change eliminates the custom rendering logic that allowed components to be rendered via the standard render helper, a patch that was previously necessary for Rails versions prior to 6.1.0. Users relying on this specific file for component rendering will need to update their setup, as the core component infrastructure has been restructured or moved elsewhere.
_lib/action\view · high confidence
Support for inline templates, serializable component proxies, and Rails 8.1 ERB compatibility
ViewComponent now supports single-file components via the new InlineTemplate module, allowing templates to be defined directly within the component class. It introduces a Serializable::Proxy that enables components to be serialized for background jobs and Turbo Streams by deferring instantiation and capturing slot calls. Additionally, the template compilation logic has been updated to handle Rails 8.1's ERB newline changes and prevent segfaults when Ruby coverage is enabled, while internal documentation components have been removed from the shipped library.
_view\component · high confidence
ViewComponent library initialization and autoload structure
The ViewComponent library now initializes by requiring core dependencies like ActionView and ActiveSupport, and defines the main ViewComponent module with explicit autoloads for key classes such as Base, Compiler, Config, and Translatable. Test-specific helpers (TestHelpers, SystemSpecHelpers, etc.) are conditionally loaded only when running in a Rails test environment, and the engine is automatically required if Rails is present, ensuring seamless integration without manual setup.
lib · high confidence
Test coverage
11 commits adding/updating tests in test/isolated; 7 commits adding/updating tests in test/script; Add RSpec test configuration and system spec driver; Added comprehensive test suite for ViewComponent sandbox; Added generator tests for ViewComponent scaffolding; Added performance benchmarks for components and translations; Added preview templates for testing component rendering scenarios; Added test coverage for ViewComponent previews and system interactions; Added test coverage for component translation scoping and preview rendering; Added test for preventing duplicate autoload paths; Added test mailer views for component rendering; Enhanced test infrastructure and new docs task coverage; Expanded test sandbox with new component fixtures; Removed legacy test suite and demo view for ActionView::Component; Removed test application configuration; Sandbox test environment initialization and validation; Sandbox test environment reorganized for Rails 8 and Turbo 2 compatibility; Test environment configuration updates and warning suppression.
Dependencies
ViewComponent v4.15.0: Rails 8.1 support and dependency overhaul
ViewComponent has been updated to version 4.15.0, introducing support for Rails 8.1 and requiring Ruby 3.2 or higher. The gemspec now explicitly declares runtime dependencies on \actionview\ and \activesupport\ (version \>= 7.1.0) alongside \concurrent-ruby\. Development dependencies have been significantly modernized, including upgrades to \minitest\ (\~\> 6), \haml\ (\~\> 7), \tailwindcss-rails\ (\~\> 4), and \turbo-rails\, while replacing \rubocop\ with \standard\ for linting. The project has also been renamed from \actionview-component\ to \view\_component\, and the documentation site now uses the \github-pages\ gem with \webrick\ for local development.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 49 → 50 (+1.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 75 → 72 (-2.5)
- Architecture 85 → 92 (+7.6)
- Maturity 60 → 68 (+8.5)
- Readiness 42 → 42 (-0.2)
- Security 39 → 39 (-0.3)
- Performance 90 → 90 (+0.0)
Resolved (24)
- Base.render_in (cognitive 23) (lib/view_component/base.rb)
- Base.render_in (cyclomatic 17) (lib/view_component/base.rb)
- Further sole-owners (lower concentration)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Hotspot: lib/view_component/base.rb (lib/view_component/base.rb)
- …and 4 more
New (20)
- Base.__vc_render_uncached (cognitive 20) (lib/view_component/base.rb)
- Check.classify (cognitive 16) (script/regression_check.rb)
- Check.classify (cyclomatic 17) (script/regression_check.rb)
- Check.select_tests (cognitive 21) (script/regression_check.rb)
- Duplicated block (6 lines × 2) (script/regression_check.rb)
- Edited copy of a member (13 corresponding lines) (performance/inline_benchmark.rb)
- High: security finding (details withheld)
- Low cohesion: Base (LCOM4 6) (lib/view_component/base.rb)
- Medium CVE: [GHSA redacted] (Gemfile.lock)
- Off-boarding risk: anonymized user #1
- Orphaned file (app/controllers/concerns/view_component/preview_actions.rb)
- Orphaned files with no living knowledge
- Outdated: haml
- Outdated: minitest
- Outdated: puma
- Outdated: reactionview
- Outdated: rspec-rails
- Repeated repair: lib/view_component/test_helpers.rb (lib/view_component/test_helpers.rb)
- TestDefinitions.visit_call_node (cognitive 20) (script/regression_check.rb)
- TooManyMethods: CacheDigest (lib/view_component/cache_digest.rb)
Changes since last survey
- 108 commits — 86 feature/other, 22 fixes
By area
- (repo) — 42 commits
- lib/view_component — 16 commits
- docs/CHANGELOG.md — 13 commits
- test/sandbox — 12 commits
- .github/workflows — 10 commits
- (root) — 7 commits
- docs/guide — 2 commits
- gemfiles/rails_main.gemfile.lock — 2 commits
- docs/CONTRIBUTING.md — 1 commit
- docs/Gemfile.lock — 1 commit
- docs/_data — 1 commit
- lib/generators — 1 commit
Notable commits
- fix: Fix bugs found in the main branch audit
- fix: Fix compatibility with the latest Rails main
- fix: Fix namespaced component digest dependencies with regex tracker
- fix: Fix remaining main branch audit bugs
- fix: Fix rendering, caching, and generator bugs from the project audit
- fix: Fix spacer documentation prose lint
- fix: Fix unresolvable interpolated render dependencies
- fix: Merge branch 'main' into fix-cache-digest-binary-sources
- fix: Merge main into fix-cache-digest-binary-sources
- fix: Merge pull request #2748 from ViewComponent/joelhawksley-regression-test-ci
- fix: Merge pull request #2751 from joeljunstrom/fix-cache-digest-binary-sources
- fix: Merge pull request #2757 from ViewComponent/joelhawksley-review-comment-fixes
- fix: Merge pull request #2762 from ViewComponent/joelhawksley-project-bug-audit
- fix: Merge pull request #2763 from ViewComponent/joelhawksley-main-bug-audit
- fix: Merge pull request #2765 from ViewComponent/joelhawksley-main-bug-audit-8e5
- fix: Merge pull request #2770 from ViewComponent/joelhawksley-fix-interpolated-render-dependencies
- fix: Merge pull request #2777 from ViewComponent/joelhawksley-content-behavior-regression
- fix: Merge pull request #2786 from czj/fix-slot-method-missing-without-component
- fix: Merge pull request #2787 from ViewComponent/joelhawksley-collection-rendering-fix
- fix: Merge pull request #2790 from ViewComponent/joelhawksley-code-scanning-fixes
- …and 88 more
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ViewComponent/view_component was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7aa7ed93303350bd95dd3a1b199486ab412cd9e0 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.