gems view_component 4.20.0

6 hours ago

4.20.0

  • Fix invalid byte sequence in UTF-8 errors when precomputing cache digests for components loaded from encrypted or binary source files.

    Joel Junström

  • Fix cache digests missing components rendered through a slot declared with the component's class, through a method or variable that holds the component, or through a module the component includes. Any constant naming a component in a component's Ruby or templates now counts as a dependency, and included modules are digested like superclasses.

    Erik Axel Nielsen

  • Add an informational CI check that runs added and modified tests without a pull request's implementation changes to identify regression coverage.

    Joel Hawksley

  • Speed up rendering with direct compiled-template calls and avoid intermediate method allocations when invoking lambda-backed slots.

    Joel Hawksley

  • Fix Couldn't find template for digesting errors when computing cache digests for templates that render components. Action View inferred a partial from render SomeComponent.new, so partials inferred from component renders are now discarded. Component renders are found with Prism rather than a regular expression, adding a dependency on the prism gem.

    Joel Hawksley

  • Fix components rendering the template for the first format a lookup context rendered in, instead of the current one. An Action Mailer email that declares format.text before format.html rendered the text template of each component into its HTML part. Components now reuse the details key Action View memoizes, which Action View resets whenever a detail such as formats changes. Regression from 4.16.0.

    Jan Schilbach

  • Look up each component's sidecar templates and translations once while eager loading, instead of again when it compiles, loads its translations, and computes its cache digest, and for each of its subclasses. Time spent in ViewComponent during the boot benchmark drops by about a quarter.

    Clément Joubert

  • Measure cache digest precomputation in the boot benchmark by disabling class reloading in the benchmark app and having each generated component render another.

    Joel Hawksley

  • Add a CI performance check that fails a pull request when any benchmark scenario's component/partial render-time ratio, or ViewComponent's share of app boot time, regresses by more than 5% against the base branch on Rails 8.1 or Rails main.

    Joel Hawksley

  • Fail the test suite when a gem in the Gemfile or gemspec isn't loaded.

    Joel Hawksley

  • Remove the unused selenium-webdriver and tailwindcss-rails development dependencies.

    Joel Hawksley

  • Speed up sidecar_files, which 4.18's cache digest precomputation calls for every component and superclass at boot, by globbing each directory once instead of once per extension. On an app with 302 components, compile.view_component drops from 2.3 s to 1.2 s.

    Clément Joubert

Don't miss a new view_component release

NewReleases is sending notifications on new releases.