Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperscript support #139

Closed
aggroot opened this issue Sep 4, 2023 · 2 comments
Closed

Hyperscript support #139

aggroot opened this issue Sep 4, 2023 · 2 comments

Comments

@aggroot
Copy link
Contributor

aggroot commented Sep 4, 2023

I would like to add support for hyperscript templates similar to js scripts using the following syntax

hyperscript Name(params){
// hyperscript definition here 
}

and be able to use it inline only on _ attributes. It pairs very well with Htmx

@joerdav
Copy link
Collaborator

joerdav commented Sep 6, 2023

Is this something that is available in other templating languages that support htmx/hyperscript? My personal opinion is that you should be able to write htmx and hyperscript code as similarly to the hyperscript docs as possible.

Maybe a good solution for now is to create a string function?

func Name(params) string {
	return `
		// hyperscript definition here 
`
}

@aggroot
Copy link
Contributor Author

aggroot commented Sep 6, 2023

You're correct.
I suppose the primary advantage is syntax highlighting, but hyperscript is already friendly from readability pov.
I mistakenly believed it might offer significant runtime processing benefits, but after thinking a little bit more, those seem minimal.

Thank you for your insights. I'll be closing this for now.

@aggroot aggroot closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants