mde / ejs

Embedded JavaScript templates -- http://ejs.co
Apache License 2.0
7.66k stars 834 forks source link

ETS #715

Closed AngeloCore closed 1 year ago

AngeloCore commented 1 year ago

EJS but with typescript support?

mde commented 1 year ago

The "JS" in EJS is for "JavaScript." The main benefit of EJS is that it is simply JavaScript. That's the entire point.

AngeloCore commented 1 year ago

I mean add support for types when embedding

mde commented 1 year ago

I understand what you meant. It's not something I intend to pursue for EJS.

nhusby commented 1 year ago

This would be very helpful. We are going all in on TypeScript and it's preventing a lot of bugs. We still run into issues with templates crashing and preventing emails going out because a junior dev came along and changed the input data somewhere upstream not realizing it impacts data required by a template because there is no visibility into its requirements without scanning through the whole thing.

Actually using typing is optional, which makes TypeScript really easy to adopt... it's just JavaScript, but I get that you're not interested... it's probably something that should be a fork anyway.

@mde any advice for forking?

AngeloCore commented 1 year ago

Also a proper vscode extension wouldn't be bad 😅

mde commented 1 year ago

Nothing to prevent your using EJS in your own TS code. As you say, it's a superset of JavaScript. I know exactly what TypeScript is, and how it works. I have used it. And as I have already said numerous times, I don't find it to be a good tradeoff in terms of return on investment. I have zero plans for adopting it for EJS.