tatethurston / embedded-typescript

Type safe embedded TypeScript templates
MIT License
46 stars 1 forks source link

Custom delimeters #13

Open Jacknq opened 1 year ago

Jacknq commented 1 year ago

Hi, is there any possibility to add custom Custom delimeters? like {{ }} , {{=}} and so on..

tatethurston commented 1 year ago

Hey @Jacknq I’m happy to support this. Are you interested in arbitrary delimiters or just {{ instead of <%

Jacknq commented 1 year ago

Hi, So in general any deliminiers make them configurable, like in squirelly, handlebars and so on. Even awesome If it keeps working with vs code plugin.. Also looking for option to execute template from code rightaway without compling? Im looking to more things in your project, with questions.. if I should put them here or in general new issue.

Good work Thanks for feedback

tatethurston commented 1 year ago

Im looking to more things in your project, with questions.. if I should put them here or in general new issue.

@Jacknq whichever you prefer. Here or new issues are both fine

tatethurston commented 1 year ago

Also looking for option to execute template from code rightaway without compling?

This is something I’m probably not going to support, because it only adds runtime overhead. That said, if you explain your use case I’m happy to consider it.

tatethurston commented 1 year ago

So in general any deliminiers make them configurable, like in squirelly, handlebars and so on.

I see the appeal in theory, but in real world projects I’m under the impression that the overwhelming majority of usages are either <% or {{, which makes me inclined to only support those tokens rather than arbitrary delimiters. I’m certainly open to counter points though

Jacknq commented 1 year ago

Ok, thats fair, even {{ is more readable then <% So definitely, more diversity (flexibility) makes the solution more attractive.