DEV Community

Discussion on: Vecty with Vue.js style templating

Collapse
 
athif23 profile image
At Indo

How about making a new extension like what VUE does, so you can write HTML without the '' ?

Collapse
 
progrium profile image
Jeff Lindsay

I don't understand, what do you mean?

Collapse
 
athif23 profile image
At Indo

I mean, vue have this file extension '.vue' where you can write raw HTML in it and it will be auto-compiled to javascript syntax with the help of webpack or browserify. So, why not make one too in GO? It will be much easier to see, than seeing the HTML wrapped with the single quote. Maybe like '.gox' or something?
Thanks.

Thread Thread
 
progrium profile image
Jeff Lindsay

Oh, yes. Actually a project that does JSX style Go exists (and uses .gox), but the reason I don't like this is that it's more complex and will pollute your files with .go and .gox files. This might be acceptable for JavaScript project, but I don't find it acceptable. What's more common in Go is to have separate template files, and that's easy to do here.

With Vecty if the HTML for a component is simple enough to not warrant a separate file then you can use the functional builder API that it currently comes with.

Thread Thread
 
norunners profile image
norunners

Check out vueg which uses go generate to achieve this.
github.com/norunners/vueg

Thread Thread
 
pejmanhkh profile image
pejman hkh

I developed somethings like Jsx for go with Gox name :

github.com/pejman-hkh/gdp/tree/mai...