Releases: volfpeter/htmy
v0.4.2
What's Changed
- Formatter: skip properties whose value is
None
by @volfpeter in #31
Full Changelog: v0.4.1...v0.4.2
v0.4.1
v0.4.0
What's Changed
- New default renderer with 2-6x better performance by @volfpeter in #25
Full Changelog: v0.3.6...v0.4.0
Additional notes from #25
htmy.HTMY
should be considered deprecated and replaced byhtmy.Renderer
.htmy.Renderer
is a completely new renderer implementation with 2-6x performance compared to the renderer in version0.3.6
, largely depending of course on the use-case.htmy.renderer
is now a package that offers the defaultRenderer
of the lib, and also aBaselineRenderer
(the original renderer of the lib). The reason for keeping the latter is its simplicity and easy to prove correctness. It can be used for debugging, testing, benchmarking other implementations.
Regarding performance, the improvement you can expect strongly depends on the composition and depth of your component tree. The 2-6x improvement (compared to 0.3.6
) can be expected for component trees that have a mixture of sync components, async components, and ErrorBoundary
s. Some general recommendations:
- Sync components can be resolved faster, so (as recommended in the docs) if a component doesn't need to be async, don't make it async.
- Less nesting improves performance. If a component is mostly "boilerplate" (some HTML layout with dynamic content in a couple of places), then you could consider using
Snippet
instead with atext_processor
to fill in the dynamic parts. ErrorBoundary
components can be relatively expensive, use them only where they are necessary.
With the tips above, you can potentially expect even better performance. This will still be considerably slower than Jinja for example, but there is no free lunch. For really performance critical parts, you could still create a wrapper component that uses a different rendering engine internally and return its result as a SafeStr
.
v0.3.6
What's Changed
Snippet
andMD
text pre-processing by @volfpeter in #21
Full Changelog: v0.3.5...v0.3.6
v0.3.5
v0.3.4
What's Changed
- Fix attribute quoting in
Formatter
by @volfpeter in #17
Full Changelog: v0.3.3...v0.3.4
v0.3.3
v0.3.2
v0.3.1
What's Changed
- Added API docs for i18n by @volfpeter in #11
- Merge default and render contexts if there's both by @volfpeter in #12
Full Changelog: v0.3.0...v0.3.1
v0.3.0
What's Changed
- Markdown example doc improvement by @volfpeter in #6
- Added the
i18n
module andI18n
utility for async, JSON based internationalization by @volfpeter in #9
Full Changelog: v0.2.0...v0.3.0