- [Added] new
Phlex::CSV
class for streaming CSV views - [Added] new (experimental)
Phlex::Kit
for collections of components - [Added] support for selective rendering
- [Changed]
mix
does a better job when mixing different types of attributes - [Changed] Phlex will now try to call
to_s
on attribute values - [Changed] No runtime dependencies
- [Deprecated]
Phlex::HTML#param
, (<param>
) tags have been deprecated - [Deprecated] Defining the
template
method is now deprecated. You should defineview_template
instead. In Phlex 2.0, thetemplate
method will render a<template>
tag.
- Security update
- Improved documentation
- Fixed an issue with flushing to the buffer while capturing
- Added
<canvas>
element - Very minor performance improvements by using
block
instead ofblock_given?
where a block has already been captured Integer
objects are now handled by theformat_object
method, which you can override to customise how various objects are rendered- You can now use
render
withString
andMethod
objects
- Rendering a component with a false
render?
predicate should return an empty String rather thannil
.
- Support
Integer
andFloat
attribute values, and fall back to callingto_str
on other objects.
- Experimental Smart chunking.
- Improved YARD documentation, which is now available here https://rubydoc.info/gems/phlex
SGML#render
can now render lambdas with zero or one arguments. Previously, it could only render lambdas with exactly one argument, although it could always render Procs with any number of arguments. When an argument is accepted, theself
of the component rendering it is yielded to the Proc.- Raise an error when outputting an unknown object using
SGML#plain
. - Raise an error when using attribute keys that aren't Strings or Symbols.
- Support Array and Set values for HTML/SVG attributes.
- Removed the
menuitem
element as it's a deprecated HTML element. - Removed the
SGML#text
method. This has been replaced withSGML#plain
.
Before this changelog was introduced, changes were logged in the release notes.