Fork me on GitHub
#off-topic
<
2020-01-09
>
mloughlin14:01:16

is anyone using Bootleg for their sites? https://github.com/retrogradeorbit/bootleg

mloughlin14:01:26

No, but I'm looking for a static site generator for a personal website and I like hiccup 🙂

borkdude14:01:17

It looks like a good option to me, but I might be a bit biased, since he's using the same Clojure interpreter that is powering https://github.com/borkdude/babashka/.

mloughlin17:01:58

Are you talking about Sci? That's a very nice lib. It seems like a lot of Sci projects target GraalVM. Does Sci make it easier to compile with Graal?

borkdude17:01:12

sci basically solves the eval problem for graalvm

jaide19:01:53

I've had good success with perun.

mloughlin22:01:02

perun looks OK but I don't want to learn boot

dominicm16:01:54

I can't find this, but I assume it exists: A library for managing crud in spas. I write a lot of boilerplate around fetching the data a component needs, waiting for it in flight (loading vs loaded), refetching at the "right" time, collecting data up to be submitted. I'm hoping someone has produced a simplified model I could use for simple cases.

borkdude16:01:41

wasn't there something like this announced by the company you work at? https://juxt.pro/blog/posts/clojurescript-form-library.html

dominicm17:01:25

Yeah, that manages some of it. I guess the read element has a lot of emphasis for me. I'm not writing back a lot of the data.

borkdude17:01:47

fulcro? fulcro rad? om.next?

👍 4
borkdude17:01:20

haven't used any of these myself, but I've heard they manage these things for you somehow

dominicm17:01:57

Fulcro requires whole app buy in. Haven't looked at the rad version. Something like those which can be done bit by bit would be cool, preferably with a simpler language for communication.

borkdude17:01:32

Maybe @U5WAJK60M can tell you more about if RAD can do this already

borkdude17:01:17

or ask in the fulcro channel

dominicm17:01:08

Fulcro RAD does a lot of stuff. Too big for me :).

kszabo17:01:02

Fulcro is big as it is because all of the components in it are necessary to meet the requirements you listed. I.e.: you can’t have easy/automatic data fetches without a normalized client side DB with the concept of idents. What I’m saying is eventually you will build a subpar implementation of Fulcro with reagent/re-frame/some datafetch lib (at least that’s what I did).

lilactown17:01:25

it sounds a lot like apollo or relay for JS

lilactown17:01:44

I don’t think something like that exists exactly in the CLJS ecosystem yet

lilactown17:01:27

once I am done working on helix (defining React components and using Hooks), my next planned project is exactly what you’re talking about using React Suspense. Nothing to show yet though

dominicm19:01:00

@U08E8UGF7 My issues with fulcro have historically been that it's too complicated for me to understand. In general I'm willing to take something that doesn't give the client so much power (e.g. arbitrary queries of subsets of data) in exchange for something which really just handles the networking parts of stuff.

dominicm19:01:47

Yeah, the original dream(s) of relay sound similar. Although, I'd be happy for something that composes a little better with other stuff. Qlkit was pretty cool for Cljs, although re-frame was ultimately chosen for us.

lilactown19:01:20

I’ve found that re-frame is very antithetical to doing this, as idiomatic re-frame completely separates the component from networking. React Suspense goes a long way to making this case much more composable and easy to provide a better UX. It sounds like what you want. However, you’ll have to wait for that to be released in React 😕

dominicm20:01:30

Maybe something higher-order like https://github.com/ericclemmons/react-resolver would do the trick

lilactown20:01:13

that lib looks pretty out of date, but I think something similar to a HOC or a custom hook would suffice until Suspense is ready

lilactown20:01:10

in the past, with Reagent I’ve used a function that returns a reaction that represents the {:data .., :loading …, :error …} state. it’s not a ton of work

lilactown20:01:41

however, it’s less composable than what suspense provides because you can’t easily lift where the loading state is shown

yannvahalewyn21:01:15

@U09LZR36F RAD will attempt to kill boilerplate, especially for CRUD in any apps. It’s still in waaay pre alpha, but I think it would be preferable to opt into Fulcro as well, especially for SPA’s, because you will get every aspect of boilerplate killing (form generation, form diffing, submission to server, persisting in whatever shape en reading it back out into other views). You could use just the SQL or datomic plugin and form delta calculation of RAD and use your own UI layer for them though, it’s just more work and I don’t feel like the fulcro way would lock you in

yannvahalewyn21:01:34

RAD will generate pathom resolvers for attributes based on identity attributes (e.g: an account id can get you account name, email, join addresses), so I think you could use RAD backend only if that’s what you’re looking for

dominicm21:01:02

I don't work on an app, I work at a consultancy. Sometimes the backend is out of control, but I need tools I can use anywhere.

yannvahalewyn21:01:54

It’s too early to tell if RAD would help you. How I see it now it’s targetted at building new things, not fixing spaghetti’s 🙂. With RAD if the domein is ‘wrong’, it won’t help you and you’ll need to write a lot of custom code anyway

yannvahalewyn21:01:45

but reading your first message of the thread yes, that’s exactly what RAD aims to achieve

yannvahalewyn21:01:02

it will be very simple, just declaring the attributes and generating the mechanical things for you

dominicm21:01:43

Fwiw, I found the readme a little off putting because it all sounds very entangled. Just as an initial reaction to what I saw.

yannvahalewyn21:01:00

I get that. It’s not ready clear yet so it won’t be usable for a while anyway. I don’t understand your needs totally. So maybe I’ll explain the summary of what it’s intent is and you can see if it would help (I find it interesting too). RAD itself is super simple: it’s just about declaring attributes that go through your system and their relationship (joins, entities, auth, validation) in the form of open maps, that’s it. Then there will be some pre-fab plugins that take care of things: Generating and validating forms, auth, persisting to datomic and SQL, reading from those sources. If you combine enough plugins it becomes a framework. And it’s meant that you can write your own plugins, say you often talk to a CRM, you write the plugin that can read and write to it, and then in every app you make just declare the bits of information that the plugin needs to do it’s job correctly.

yannvahalewyn21:01:47

I think of it as a badass boilerplate killer 🙂

dominicm21:01:15

These things sound familiar. Universal schemas are everywhere. Some people are trying to use spec as one for example. Does RAD have a novel technique?

yannvahalewyn21:01:08

not that I know of, except that it won’t try to do any heavy lifting

yannvahalewyn21:01:25

so my frustration with solutions I see is that they all try to solve domain problems too. RAD tries to solve many mechanical things, but won’t interfere with your domain and that’s what I think is novel. If you want to know more maybe talk to Tony Kay on Slack

yannvahalewyn21:01:40

do you know of another universal schema solution that is extendable (eg open maps and plugins) ?

dominicm21:01:34

JSON schema

dominicm21:01:03

Vvvval weaselnyk (completely typod, sorry!) described an interesting custom one he designed around datascript for querying the data in different ways.

yannvahalewyn21:01:06

yeah that’s an inspiration for me

yannvahalewyn21:01:21

but we won’t need datascript to do things our way.

yannvahalewyn21:01:31

I don’t see how json schema is related to this though

yannvahalewyn21:01:49

RAD will be more like vvvvals idea about using such a schema to query and generate basic mechanical things, which I miss in json schema

dominicm21:01:55

It is used for validation and form generation already. But I think with a few annotations it could do more. I think there's mock servers which generate fake data based on the schema. There's an official hypermedia extension. It's been through many years of refinement to find something that works so well.

yannvahalewyn21:01:32

so what are the needs you have that don’t fit into that?

dominicm22:01:45

Well for one thing I'm not using it on the current project. But the small piece I'm really looking for doesn't include form generation or schemas. I just want to declare that I need an opaque blob of data and have all of the boilerplate around that managed.

dominicm22:01:11

Well, I'm lying a bit. I'm using JSON schema a lot for form generation, validation, etc. Before sending it to the server.

yannvahalewyn22:01:27

what do you mean by opaque blob of data?

dominicm22:01:20

Hmm, given that https://github.com/oliyh/martian exists. I don't entirely care about the network either. I really just don't like the indirection and event pinging that reframe has.

dominicm22:01:39

I mean that I don't want to define a schema for it, or describe it in any way. I have an endpoint that produces data, and that data is something my component understands how to use.

yannvahalewyn22:01:59

well if you don’t want to describe it rad isn’t for you indeed. But how do you want to kill boilerplate without describing it?

lilactown22:01:42

There's a lot of mechanical bits to do with loading state, caching, etc. That UI needs to care aboit

lilactown22:01:57

I think that's what Dominic is referring to

dominicm07:01:24

Yeah that's it ^^. I want to have a simplified model for fetching the data, and knowing when to wipe it, refetch, etc. I'm happy to write out my forms manually, because they're either custom enough that generation wouldn't work, or they're generated via an existing mechanism.

yannvahalewyn13:01:29

nice to zone into the problem 🙂. When should it be refetched?

dominicm13:01:02

That depends on the page. That is something I would happily declare, or maybe just manage manually? Sometimes I want to reuse for the lifetime, sometimes I want to fetch data when navigating back to the page. When refetching it is sometimes okay so show out of date data briefly, and sometimes it isn't.

yannvahalewyn18:01:08

If you didn’t know already Reagent atoms have an on-dispose hook. What we usually do for these things is write fetching logic once for every data fetching thing, and somehow couple the view to that datafetching. So when the view mounts the data is loaded, and if this is a view where this is needed, the on-dispose hook would remove the data from the app state, effectively refetching when the view gets mounted again. No libraries needed really just some reusable functions