| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just concatenating the strings is much faster.
Before:
```
make benchmark
go test -bench=.
goos: darwin
goarch: amd64
pkg: github.com/maragudk/gomponents
BenchmarkAttr/boolean_attributes-8 8194791 139 ns/op
BenchmarkAttr/name-value_attributes-8 5143292 229 ns/op
PASS
ok github.com/maragudk/gomponents 2.841s
```
After:
```
make benchmark
go test -bench=.
goos: darwin
goarch: amd64
pkg: github.com/maragudk/gomponents
BenchmarkAttr/boolean_attributes-8 16755404 67.0 ns/op
BenchmarkAttr/name-value_attributes-8 10208625 116 ns/op
PASS
ok github.com/maragudk/gomponents 2.702s
```
|
|
|
| |
This makes it easier to e.g. conditionally skip a component for rendering.
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
| |
Like Text, but calls fmt.Sprintf before rendering.
|
| |
|
| |
|
| |
|
|
|