Skip to content

Releases: maragudk/gomponents

Simplifications

10 Dec 13:33
428a251
Compare
Choose a tag to compare
Simplifications Pre-release
Pre-release

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. 😎

⚠️ Breaking: All elements and attributes have been moved into a single package 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.
⚠️ Breaking: The Document element has been renamed Doctype.
⚠️ Breaking: a, form, img, input, label, option, progress, select, and textarea are now just regular elements (without helper parameters).

Render correct HTML5

16 Nov 12:07
633b000
Compare
Choose a tag to compare
Render correct HTML5 Pre-release
Pre-release

⚠️ Breaking: The rendering is changed to correctly render HTML5. This includes not rendering an end tag for void elements (see https://dev.w3.org/html5/spec-LC/syntax.html#void-elements), and always rendering an end tag for all other elements. This means that <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

02 Nov 10:06
87d09c3
Compare
Choose a tag to compare
Add Map function Pre-release
Pre-release

🗺

Render to io.Writer instead of returning string

02 Nov 09:18
6c8f0c2
Compare
Choose a tag to compare

⚠️ Breaking: To make it easier to keep memory requirements low for servers that potentially render a lot of web pages, the 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!

29 Oct 11:05
3df4208
Compare
Choose a tag to compare
A lot of new helpers! Pre-release
Pre-release

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

22 Oct 07:08
6d2fb0e
Compare
Choose a tag to compare
Add Group function Pre-release
Pre-release
v0.7.0

Add Group function to group Nodes (#29)

More section helpers

21 Oct 20:02
42433a4
Compare
Choose a tag to compare
More section helpers Pre-release
Pre-release
v0.6.0

Use HTMLEscapeString in Textf (#27)

Now with form helpers

25 Sep 08:01
5da578c
Compare
Choose a tag to compare
Now with form helpers Pre-release
Pre-release

This release adds form, input, label, select, option, and more elements related to forms.

Bugfix release: Classes rendered as text

24 Sep 11:21
4c109f9
Compare
Choose a tag to compare
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

23 Sep 20:18
f27cb0c
Compare
Choose a tag to compare
Pre-release
  • Breaking: Classes is now a map type, not a function
  • Added Textf for easy text node interpolation.
  • Changed H1-H6 and B, I, Em, Strong, Img to accept children nodes, mainly for attribute use.