hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
GusWill 2021-01-02T18:02:19.041600Z

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.

GusWill 2021-01-02T18:04:09.042200Z

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

2021-01-02T18:05:11.043100Z

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

GusWill 2021-01-02T18:13:32.044300Z

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

2021-01-02T18:54:36.046800Z

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

👍 1
GusWill 2021-01-02T20:29:53.050Z

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

2021-01-02T20:33:10.051500Z

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 :)

GusWill 2021-01-02T21:30:40.051900Z

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

GusWill 2021-01-02T21:33:05.052700Z

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

GusWill 2021-01-02T21:33:37.053200Z

https://github.com/rlander/conduit

GusWill 2021-01-02T21:34:05.053800Z

are they idiomatic examples?

2021-01-02T22:14:53.054200Z

Yup both of those look good to me

2021-01-02T22:16:58.056300Z

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

GusWill 2021-01-02T22:44:24.057600Z

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

👍 1
rlander 2021-01-02T23:52:49.060600Z

@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.

👍 1
rlander 2021-01-02T23:56:35.062900Z

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.

rlander 2021-01-02T23:59:20.064400Z

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.