First stable release by the new maintainer. It shares no code with 0.1.0, so treat an upgrade from 0.1.0 as a move
to a new gem and start from the usage docs. The
alpha sections below record each change as it landed. This section gathers them in one place.
Added
Phlex::Hanami::ViewandPhlex::Hanami::Layout, the base classes for a view and a layout, and
Phlex::Hanami::Renderablefor aPhlex::HTMLbase class you already have.- Auto render. An action renders the Phlex view whose container key matches its own, so
MyApp::Actions::Posts::IndexrendersMyApp::Views::Posts::Indexwith noresponse.rendercall and no
configuration. An action with no matching view renders nothing, so a slice can move to Phlex one action at a time. - A view receives the exposures and params its
initializeasks for and drops the rest, so a stray query param does
not raise. An initializer that takes**receives all of it. - A layout convention:
Views::Layoutin a slice wraps that slice's views.layoutsets a different one, and
layout nilopts out. The view renders before its layout, so acontent_forset in the view shows up in the
layout'shead. - The view context in every view and every component under it:
path,url,asset_url,content_for,
csrf_token,flash,session,requestand more. A view reads the same whether or not hanami-view is bundled. t, which resolves a relative key against the view's container key, sot(".title")in
MyApp::Views::Posts::Indexlooks upposts.index.title.Phlex::Hanami::Helpers, an opt in for Hanami's helper library, such asform_forandformat_number. It needs
hanami-view. Their output renders as markup rather than escaped twice, and Phlex keeps its ownrawandtag.Phlex::Hanami::Componentfor everything below a view,Phlex::Hanami::Contextualfor a component base class you
already have, and support for Phlex kits.- Phlex views for hanami-mailer, through
Phlex::Hanami::Mailer::Viewand
Phlex::Hanami::Mailer::Layout. A mailer renders the view whose container key matches its own, and the gem builds
the plain text part from the HTML unless the view definestext_body. Phlex::Hanami::Testing::ViewHelpers, for testing a view or a component without a request, and
require "phlex/hanami/rspec"to include them in every example group taggedtype: :view.- RBS signatures for the public API, shipped in
sig. - Usage docs for every part of the gem, including how it hooks into Hanami and why code reloading needs no extra
work.