Artificer
Artificer2w ago

Sharing a library between deno and frontend

Hey all, I've got a Deno server/api application setup, and now that I'm going to build the frontend, it'd be nice to split out a common library for the 2 projects to share, does anyone have any recomendations on how to do this? I'm trying to keep dependencies minimal, so I'd prefer to not have to add anything outside deno, and maybe Vite for the frontend app. Any help would be appreciated!
2 Replies
CodyC
CodyC2w ago
I'm interested to hear what other responses you get here. I've been sortof cobbling my own system together. I'm using Preact for server-side rendering for most of a project I'm working on, but then I want to be able to re-use some components for the parts that do need to be interactive client-side. (Take a look at the Fresh framework, which does a lot of this for you quite easily. I'm just being pedantic in my use case.) I wrote my own little tool, https://github.com/NfNitLoop/deno-embedder which can also run ESBuild to transpile typescript/TSX for use on the web. So now it's easy for me to use a component on the server or in the client.
Artificer
ArtificerOP2w ago
That's really cool! I may check that out for some inspiration if nothing else