Skip to content

1.2.0

Compare
Choose a tag to compare
@joeldrapper joeldrapper released this 05 Apr 20:30
· 94 commits to main since this release

This release adds support for Phlex 1.10.

Highlights

New Streaming Tools

You can now include Phlex::Rails::Streaming into a Rails controller and then use the stream method instead of render to stream HTML or CSV views. Note, this is not compatible with Rails built-in layout system. It will only work if you render your layouts from your Phlex views like any other component.

Enhanced support for Phlex::CSV with ActiveRecord::Relations

Unordered ActiveRecord::Relations will enumerate with find_each by default when passed to a CSV view.

Parameterised layouts

You can now initialise a Phlex::Rails::Layout with parameters.

layout -> { ApplicationLayout.new(foo: "bar") }

[Experimental] support for Selective Rendering (incomplete)

Phlex 1.10 introduced experimental Selective Rendering and phlex-rails now has limited support for this via the X-Fragment HTTP header. Currently, this only works for views that are 100% Phlex. In the future, we plan to use Nokogiri to parse ViewComponent components and ActionView views and output helpers so they can be selectively rendered too.

Performance Improvements

  • The same buffer performance improvement in Phlex 1.10 has been applied here
  • Helper adapters are now auto-loaded, which should improve startup performance

Deprecations

  • Helper modules have been renamed for better consistency with the respective helper method names — the old module names still work but will print a deprecation warning now.

Other notable change

  • If you call a Rails helper without including the adapter module, the error message will guide you to include the appropriate module
  • Support for new Turbo 8 helpers
  • Fixed Tailwind configuration path in the install generator
  • Better support for translation helpers

PRs merged

New Contributors

Full Changelog: 1.1.2...1.2.0