Releases: maragudk/gomponents
Simplifications
This release has a lot of breaking changes, but it's worth it, I promise! We can now write HTML components in Go almost as if it's a DSL, but pure Go with all the benefits. 😎
html
. Because they're almost always used together, this makes perfect sense, and makes it easier to use dot imports. Unfortunately, because of name clashes, we now have FormEl
/FormAttr
, StyleEl/StyleAttr
, and TitleEl/TitleAttr
.
Document
element has been renamed Doctype
.
a
, form
, img
, input
, label
, option
, progress
, select
, and textarea
are now just regular elements (without helper parameters).
Render correct HTML5
<script>
and <textarea>
elements now render and work as expected, and that elements like <hr>
and <br>
render without a slash in them.
Also breaking: The Placer
interface has been removed. Implement Type() NodeType
instead if you need to create e.g. attribute helpers.
Add Map function
🗺
Render to io.Writer instead of returning string
Render
function has been changed from Render() string
to Render(io.Writer) error
. This is obviously a breaking change, but the upgrade should be pretty simple. Just use the Render
function directly instead of using the (now removed) Write
function.
A lot of new helpers!
This release adds a whole bunch of element and attribute helpers, as well as a new components
package for higher-level helpers. It has an HTML5 document template for now.
Thanks to @oderwat for contributing. 🥳
Add Group function
v0.7.0 Add Group function to group Nodes (#29)
More section helpers
v0.6.0 Use HTMLEscapeString in Textf (#27)
Now with form helpers
This release adds form, input, label, select, option, and more elements related to forms.
Bugfix release: Classes rendered as text
Introduce Placer interface (#18) When implemented, the `Place` method of the `Placer` interface tells `Render` in `El` where to put a Node. This is relevant for helpers that want to be rendered like attributes, inside the parent element. Fixes the bug where `attr.Classes` was rendered outside the element.
Better Classes, added Textf
- Breaking:
Classes
is now a map type, not a function - Added
Textf
for easy text node interpolation. - Changed
H1
-H6
andB
,I
,Em
,Strong
,Img
to accept children nodes, mainly for attribute use.