got http server working that talks to pg https://github.com/yogthos/squint-http-server
@borkdude let me know if you think anything can be improved there, and I can make a pr for examples
the whole async thing in js kills me inside 😅
What are the current limitations of protocols in squint? I started adapting a library to work with squint, but I've run into a few issues.
Most were relatively minor -- for example, :extend-with-metadata isn't supported, and docstrings can't be included in the protocol's methods.
However, it also looks like extend-protocol isn't supported.
@tmcothran feel free to post issues about those with repros, then I'll have a look at each one of them
I posted the docstring one to github. I think extend-protocol was the result of trying to extend a type that exists in CLJS but not squint. Testing that theory now
https://clojurians.slack.com/archives/C015AL9QYH1/p1732811418827929
@tmcothran extend-protocol to nil is also fixed
i like it on the first skim. The fact you are using the basic http server is awesome 😄. I would have thought that you would use something like express or better hapi
maybe i'll check hapi how it works in squint cause it looks like a good fit. Its data first
@ales.najmann also posted a hono example recently in this channel
https://clojurians.slack.com/archives/C03U8L2NXNC/p1731538230301869
(not familiar with it, so I can't say I endorse it or not)
@mathaeus.peter.sander oh yeah for anything more serious using something like express would probably make sense, in my case I just have a minimal lambda API I'm using this for, so went with the most basic thing available 🙂
I would have done the same
Makes sense. I'd still use Hono even for that since it has uniform APIs for such things (cloudflare workers, cloud functions etc).
oh yeah that could be handy
my familiarity with the js ecosystem is very minimal
don't worry, I also do this "only on fridays" kinda 😞
I find the async part trips me up the most with js, I'm just not used to thinking in this way and even with using stuff like await I still find there are things that trip you up
for example (.-rows (js-await (.query pool query params))) having to do js-await before you can grab rows is easy to miss, and then the errors you get aren't terribly helpful
and once you have an async function happening then everything that calls it has to deal with promises, and it's the whole callback hell business 🙂
it's not too bad if you can keep this at the edges though
@yogthos About the PR, maybe we can just make a link to your repo. All these involved examples increase the maintenance burden for me when something is out of date and I don't like to have to run databases etc just for an example :)
oh sure yeah
makes sense, testing does get gnarlier this way
about promises: https://clojurians.slack.com/archives/C0459PCHLTW/p1731617770606899
Ah it seems also has a hiccup implementation:
https://squint-cljs.github.io/squint/?src=KHJlcXVpcmUgJ1siaHR0cHM6Ly9lc20uc2gvQHRoaS5uZy9oaWNjdXAiIDphcyBoXSkKCihoL3NlcmlhbGl6ZSBbOmEjZm9vLmR1ZGUuYmF6IDFdKQ%3D%3D