Fork me on GitHub
#clojurescript
<
2020-03-09
>
unbalanced14:03:15

curious if anyone has any resources for managers on clojurescript, react, and/or SPA "value prop" type stuff? this is for technical management but not current on modern SPA stuff

lukasz14:03:50

"no full page reloads" is the only value prop IMHO ;-)

lukasz14:03:06

for SPAs that is, regardless of the underlying tech stack

unbalanced14:03:40

😛 surely we can do a little better than that

unbalanced14:03:26

even though I agree with you in principle that's not gonna persuade my manager much haha

kszabo14:03:17

this is quite fulcro focused, but generally you have an easier time selling a larger framework for stakeholders, as it does more stuff instead of you (who they have to pay for 🙂 )

unbalanced14:03:56

10-4. much appreciated 🙂

Nick M15:03:42

[HIRING] I'm looking to hire a ClojureScript dev to fork an open source trading card game web-based project. Looking for fast turnaround and willing to pay accordingly. Open source script is http://Jinteki.net

cjsauer15:03:28

@nick756 try #jobs and/or #remote-jobs

Nick M15:03:59

Okay thanks

mbarillier16:03:52

the following generates "item.getAttribute is not a function" ... why?

[:li {:on-click (fn [item] (.getAttribute item "class"))} "foo"]

isak16:03:19

@mbarillier I think you need to call it on e.target instead of e (what you call item)

unbalanced16:03:45

good call. "item" by itself is a react synthetic event: https://reactjs.org/docs/events.html

mbarillier16:03:38

@isak right -- thanks!

roklenarcic19:03:31

I’m using a npm module in shadow-cljs, which has this code in lib/index.js -> `

return new Worker('./qrcode.worker.js');
, and there is a lib/qrcode.worker.js, but clojurescript compiles everything into one main.js so the browser returns a 404 error for GET 404 (Not Found) . How do I work around this?

thheller20:03:06

you can try copying that file manually. if it doesn't have any dependencies it should work. shadow-cljs has no support for detecting those kinds of files.

roklenarcic15:03:04

Of course the worker has it;’s own imports (the most common scenario is that the worker file is a thin wrapper of something else):

import * as Comlink from 'comlink';
import QRCodeReader from '@zxing/library/esm/core/qrcode/QRCodeReader';
import BinaryBitmap from '@zxing/library/esm/core/BinaryBitmap';
import HybridBinarizer from '@zxing/library/esm/core/common/HybridBinarizer';
import { ImageDataLuminanceSource } from './ImageDataLuminanceSource';

thheller15:03:11

yeah sorry thats non-standard webpack only stuff

lordie19:03:45

related to this: https://clojurians.slack.com/archives/C03S1L9DN/p1583286732330700 , that's what I ended up doing

(defn cmp [x]
  [(partial #(re/sub [:get-state %1 %2]) x)
   (partial #(re/dispatch [:set-state %1 %2 %3]) x)])

(defn main-page []
  (let [[get-state set-state] (cmp 'main)]
    (if @(get-state 'form)
      [:> grom/Box
       [:> grom/Button {:label "Close" :onClick #(set-state 'form false)}]]
      [:> grom/Box
       [:> grom/Button {:label "New" :onClick #(set-state 'form true)}]])))

lordie19:03:38

any advice is welcomed

mruzekw20:03:37

Are Fulcro and re-frame the only well-supported/used frontend frameworks in CLJS land?

shaun-mahood20:03:12

Those are the most common, but you could look at the following libraries as well and probably not have too many problems: https://github.com/keechma/keechma https://github.com/tonsky/rum https://github.com/Lokeh/helix (a little newer but under active development)

cjsauer21:03:31

It’s worth pointing out that Fulcro is really a full-stack framework, and has solutions for the entire client/server story. The projects being compared are not quite in this same space (imo).

cjsauer21:03:24

There’s something of a spectrum ranging from “React wrapper” (Rum) < client event/subscription model (re-frame) < full-stack operation (Fulcro)

👍 8
mruzekw21:03:55

Understood. I was really only considering the frontend side of things, given that the backend of fulcro is pluggable

mruzekw21:03:23

I really like the way Fulcro handles things. All the way from the client graph database to the co-located queries

mruzekw21:03:53

I’m just worried of running into quirks with Fulcro, like not being able to use hooks for instance (though I know someone is working on that)

mruzekw21:03:58

Oh wow, this must be super recent: http://book.fulcrologic.com/#_react_hooks_support

✔️ 4