eta-dev / eta

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
https://eta.js.org
MIT License
1.41k stars 65 forks source link

Bun-inclusive #181

Closed NightScript370 closed 1 year ago

NightScript370 commented 2 years ago

Is your feature request related to a problem? Please describe. I am currently a proud eta user on Deno, but with Buns release, it's only a matter of time before I switch (aka just waiting for the permission system of Deno and native Windows support without the use of WSL). I can easily transfer over the rest of my code (since its mostly just independent JS), but this might be something different considering how engines are layered on top of the base code.

Describe the solution you'd like I am unsure whether I can use bun with a polyfill for Deno, but it might be best to dynamically support it. Either that, or if its already supported from either end, then instructions on plugging it in would be nice.

Describe alternatives you've considered N/A

Additional context https://bun.sh/

shadowtime2000 commented 2 years ago

@NightScript370 Most of the API between Deno and Node for Eta are the same, and by the looks of it, it seems that Bun supports node_modules and NPM, but also allows for ESM. So you could just switch out URL imports to import from node_modules, right?

NightScript370 commented 2 years ago

Huh, I didn't think of that. Thanks for telling me.

Would you guys be open to putting example code on the site, though, on how to use this with bun?

shadowtime2000 commented 2 years ago

@NightScript370 Sure! I'll get to that soon.

shadowtime2000 commented 1 year ago

I finally came around to trying to add it - however Vercel is failing the deployment and I do not have access to the Vercel dashboard while Ben is away so I don't think this will get added anytime soon, since I can't check where the error is coming from.

nebrelbug commented 1 year ago

I've closed this because we added a section to the documentation website and, as @shadowtime2000 mentioned, it should be possible to use Eta with Bun as-is.