Adrian Hesketh
Adrian Hesketh
Good points here. Thanks for your thinking on this. # `hx-on` I think it would be reasonable to enable support for this within the code itself. The generator is where...
Thinking more about running the script template on load events - it's possible to define a `templ.Component` as code, and use it, as per https://templ.guide/core-concepts/components So, in your Go code,...
Would shipping that little `onLoad` function as part of the templ runtime solve the issue? I called it `onLoad` above, but it could be accessed via `templ.RunScript(scripts templ.ComponentScript...)` (not sure...
I've linked a PR that I think solves the first part of the issue. I'm quite happy for the attributes to be non-configurable for now. If it keeps happening, I...
Still thinking about the extensibility and `` tag stuff, but thought I'd drop this PR in the meantime.
It's now possible to use script templates as templ components, outside of attributes: https://github.com/a-h/templ/pull/285 There's an update to the docs here: https://templ.guide/syntax-and-usage/script-templates#script-templates
Just thinking about this some more, now that the auto formatting, and spaces between variables are dealt with. Options as I see it from here: * Accept that this workaround...
For option 2 above, the solution would probably be something like how the indentation for autoformatting now works. The element type has a field on it to set the behaviour:...
Thanks for everyone's thoughts on this. One solution might be to drop built in minification as a goal, and suggest the use of something like github.com/tdewolff/Minify which provides HTTP middleware....
@vblinden - what do you mean "works" vs "doesn't work"? Would be good to see the actual HTML output vs what you expected.