Fork me on GitHub
#hoplon
<
2021-01-02
>
GusWill18:01:19

sente is pretty awesome ig, I’m familiar with it, but I’m looking for a more lightweight approach like castra. Like, I read and understood the entire codebase in like minutes.

GusWill18:01:09

something that I’ve been wondering: do I really need jquery for Hoplon?

jjttjj18:01:11

@guswill nope, just include the hoplon.goog namespace and you will use the google closure attribute providers instead of jquery

GusWill18:01:32

good to know @jjttjj. everything works 100% with google closure? why isn’t it the default?

jjttjj18:01:36

I believe so, at least in theory. I haven't been doing web stuff in a bit, but I always used just the goog providers. It's easy to patch up anything you need though if not. The functionality is just implemented via the do! multimethod for an attribute keyword, so you can just extend this multimethod yourself. https://github.com/hoplon/hoplon/wiki/Attribute-Providers

👍 3
GusWill20:01:53

I can’t find any recent hoplon project or template.... anyone willing to share a recent one?

jjttjj20:01:10

I don't think there's a good proper template. I would just look for a barebones cljs template (possibly shadow-cljs) then add the hoplon dep. then (:require [hoplon.core :as h] [hoplon.goog]) and then start hacking :)

GusWill21:01:40

makes sense, thanks... most of the examples use Boot but it isn’t strictly necessary ig.

GusWill21:01:05

After googling a bit for Hoplon + shadow-cljs I found these 2 projects:

GusWill21:01:05

are they idiomatic examples?

jjttjj22:01:53

Yup both of those look good to me

jjttjj22:01:58

Boot and the boot plugins really only add the ability to use .hl files and the page declaration. Just my opinion, but I wouldn't use those anymore anyway and just stick to regular cljs files with a "traditional" entry point mechanism like either of those projects you sent use

GusWill22:01:24

makes sense... thanks for all the help @jjttjj! 😀

👍 3
rlander23:01:49

@guswill The conduit one was written by yours truly ~ a year ago. I've added a few Hoplon projects to my belt since then and, although I'd do a few things differently today (like avoiding nested cells=), overall that's still pretty much the way I still do Hoplon + shadow-cljs nowadays.

👍 3
rlander23:01:35

It does use jquery and tbh it doesn't affect performance (which you can checkout here: https://hoplon-realworld.netlify.app/) nor the final bundle size. Even with the full jquery lib bundled, It compares very favorably to other implementations: final size -> middle of the pack, total loc -> top 3.

rlander23:01:20

Honestly I think the jquery thing is mostly a marketing problem (it is very hard convincing coworkers and colleagues to try a jquery-based lib in 2021), but in practice it is a non-issue.