Releases: phlex-ruby/phlex-rails
0.9.0
Support for Phlex 1.6.
What's Changed
- Support new global render context by @joeldrapper in #79
Full Changelog: 0.8.0...0.9.0
0.8.0
Added support for Phlex 1.5 and a new adapter for the url_for
view helper.
What's Changed
- Override
plain
so it doesn't HTML-escapeActiveSupport::SafeBuffer
by @joeldrapper in #73 - Add
Phlex::Rails::Helpers::URLFor
by @marcoroth in #75
New Contributors
- @marcoroth made their first contribution in #75
Full Changelog: 0.7.1...0.8.0
0.7.1
Highlights
- Fixed an issue where C-level Procs — Proc generated by calling
to_proc
on a Symbol, e.g.foo(&:bar)
— would raiseArgumentErrors
when passed as Phlex content blocks. - Improved compatibility with ERB by wrapping ERB blocks in blocks that capture their output against the view context. An added benefit of this is it means we no longer need
Phlex::HTML
to pretend to be an OutputBuffer. - Fixed an issue with
Phlex::Rails::Helpers::Routes
that meant theurl_options
adapter was being overridden.
Other news
Improved turbo rails support
turbo-rails
merged support for using renderable objects (i.e. Phlex components) as turbo stream content. I expect this will be included in the next release of turbo-rails
. hotwired/turbo-rails#433
Until then, you can use the feature by updating your Gemfile to depend on turbo-rails/main
.
gem "turbo-rails", git: "https://github.com/hotwired/turbo-rails.git"
Lookbook support
Lookbook v2 (beta) supports Phlex. Check out the demo.
What's Changed
- Improve ERB compatibility by @joeldrapper in #70
- Fix routing helpers by @joeldrapper in #71
Full Changelog: 0.7.0...0.7.1
0.7.0
Highlights
- Fixed an issue with
Phlex::Rails::Helpers::Routes
that meant they sometimes wouldn't work as expected. - Added support for safe_concat, which is used by some templating languages like Slim.
- Improved support for rendering Rails partials inside Phlex components.
- Improved
phlex:install
,phlex:component
,phlex:view
andphlex:controller
generators. - Support for layouts — this is not documented yet, but you can generate your first layout with the
phlex:install
generator. Thephlex:controller
generator generates a controller that uses it.
What's Changed
- Declare HTML format by @joeldrapper in #56
- Improved generators by @joeldrapper in #57
- Support Rails layout interface by @joeldrapper in #58
- Revert C-level Proc fix by @joeldrapper in #61
- Add support for
safe_concat
API by @willcosgrove in #62 - Support Rails style rendering from options, closes #63 by @willcosgrove in #64
- Fix turbo stream helper by @joeldrapper in #65
- Generated component should inherit from
ApplicationComponent
by @joeldrapper in #66 - Add 3.2 to Ruby version matrix by @joeldrapper in #67
- Add
URLOptions
helper adapter by @joeldrapper in #68 - Support SGML for Phlex 1.4 by @joeldrapper in #69
Full Changelog: 0.6.1...0.7.0
0.6.1
What's Changed
- Support C-level Procs by @joeldrapper in #52
- Support for Turbo helpers by @joeldrapper in #54
- Support for DOM helpers by @joeldrapper in #55
Full Changelog: 0.6.0...0.6.1
0.6.0
Highlights
This version ships with adapters for almost all Rails view helpers. Each helper is defined as its own module under Phlex::Rails::Helpers
, e.g. Phlex::Rails::Helpers::LinkTo
, so you can include whichever helpers you need. There's also a special Phlex::Rails::Helpers::Routes
helper, which gives you access to your application routes.
If you were including Rails.application.routes.url_helpers
before, you should replace that with Phlex::Rails::Helpers::Routes
for better compatibility.
Full Changelog: 0.5.1...0.6.0
0.5.1
Highlights
- You can now render a Phlex view class without having to call
.new
on it if you don't have any arguments to pass to the view. - Fixed an issue where the
helpers
proxy didn't work when a Phlex view was rendered from ViewComponent.
What's Changed
- Render view class from ActionView by @joeldrapper in #42
- Access helpers from ViewComponent contexts by @joeldrapper in #43
Full Changelog: 0.5.0...0.5.1
0.5.0
Highlights
- You’ll now get a fancy warning if you accidentally override
append
orsafe_append
on a view. These methods are really important since Phlex views themselves are used as ActionView’s output buffer while rendering from ERB. - We added the helper
javascript_import_module_tag
, and you can also userich_text_area
inform_with
. - When rendering in an ActionView context, we unbuffer the yielded view. This makes it more consistent with other builder objects, as you need use
<%=
ERB output tags to output the result of a builder method. - We no longer generate an
ApplicationView
module on install.
The changes to ActionView rendering mean you can now render something from an outer view’s public interface inside an inner view. Here's an example:
<%= render OuterView.new do |o| %>
<%= render InnerView.new do |i| %>
<%= o.foo # <- this works now %>
<% end %>
<% end %>
Previously, this would have output in the wrong order.
What's Changed
- Warn when overriding
append
andsafe_append
methods by @joeldrapper in #27 - Use Ruby 2.7+ argument forwarding for rails helpers by @willcosgrove in #30
- Add
javascript_import_module_tag
helper by @willcosgrove in #31 - Yield with self buffer by @joeldrapper in #36
- Add rich_text_area alias to rails helpers by @michaelloistl in #37
- Unbuffer ERB renders by @joeldrapper in #38
- Switch to RSpec by @joeldrapper in #39
- Use
unbuffered
reference on the view by @joeldrapper in #40 - Don't create an
ApplicationView
on install by @joeldrapper in #41
New Contributors
- @willcosgrove made their first contribution in #30
- @michaelloistl made their first contribution in #37
Full Changelog: 0.4.2...0.5.0
0.4.2
What's Changed
- Fix ViewComponent rendering issue by @joeldrapper in #25
Full Changelog: 0.4.0...0.4.2
0.4.0
What's Changed
- Allow multiple captures from ActionView by @weapp in #22
- Switch to ERB::Util for HTML-escaping by @joeldrapper in #24
- Require Phlex 1.0 and up by @joeldrapper in #23
New Contributors
Full Changelog: 0.3.2...0.4.0