Skip to content

Releases: maragudk/gomponents

Generic Map

22 Sep 07:44
f387a71
Compare
Choose a tag to compare
Generic Map Pre-release
Pre-release

⚠️ BREAKING: The Map function has been updated for Go 1.18 onwards, where the function signature is changed from

func Map(length int, cb func(i int) Node) []Node

to

func Map[T any](ts []T, cb func(T) Node) []Node

This should make it slightly easier to map slices of whatever type you're using to HTML components.

Update doc comments

21 Sep 08:54
3334d6c
Compare
Choose a tag to compare
Update doc comments Pre-release
Pre-release

This is a tiny release to update some doc comments.

Add http package for http handler glory

08 Oct 13:03
0001b1d
Compare
Choose a tag to compare
Pre-release

This release adds the http package, with defines a Handler and an Adapt function, which makes it easy to use gomponents with net/http handlers.

⚠️ BREAKING: The assert package has been moved to be internal only. No other breaking changes.

Add srcset and loading attributes

07 Sep 10:12
33524d6
Compare
Choose a tag to compare
Pre-release

Useful on picture and img elements. Contributed by @averageflow, thank you! 😎

Add the video element

18 Jun 07:41
ec86ca5
Compare
Choose a tag to compare
Add the video element Pre-release
Pre-release

This release adds the video element and loop, muted, playsinline, poster attributes.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video for the specs.

Escape those attribute values!

08 Jun 16:16
ba0d83f
Compare
Choose a tag to compare
Pre-release

v0.17.0 brings a security update, where the library now makes sure to escape attribute values. So feel free to pass user-generated values to Attr now. Special thanks to @philippta for reporting and guidance. 😎

Also, there are documentation updates, so there should be runnable examples on godoc soon.

Also, two new helper components made it into the components package: LinkStylesheet and LinkPreload. Enjoy!

Streamline all the elements

05 May 10:57
6f7752c
Compare
Choose a tag to compare
Pre-release

⚠️ BREAKING: All elements in the html package now take just Nodes as children. No more text strings as the first argument for certain elements like h1, em, and many more. This makes the API the same for all element helper functions. (Except Doctype, which isn't really an element but a document prefix.)

New: The svg package has begun. It provides helper functions for SVG elements for inlining into HTML documents.

Expose only the Node interface

30 Jan 15:57
c899a05
Compare
Choose a tag to compare
Pre-release

⚠️ BREAKING: All helpers now return the Node interface instead of NodeFunc. The latter is now more or less an implementation detail. For most users of the API, this change will probably not be noticeable.

Add data- attributes

07 Jan 08:55
d41c4e5
Compare
Choose a tag to compare
Add data- attributes Pre-release
Pre-release

⚠️BREAKING: This release adds a data- attribute helper. Therefore, the Data element helper has been renamed to DataEl.

Conditional nodes and aria attributes

22 Dec 10:18
b4918d5
Compare
Choose a tag to compare
Pre-release

This release adds the If helper function, to conditionally add nodes inline, as well as aria- and role attributes.