Fork me on GitHub
#clojurescript
<
2018-12-17
>
drewverlee15:12:08

Is this still the ideal way to find the position (start, end) of a regex match in clojurescript? https://stackoverflow.com/questions/18735665/how-can-i-get-the-positions-of-regex-matches-in-clojurescript

royalaid16:12:35

Hey all, been messing around with Shadow and AWS some, I wrote a quick post of how to work with both https://dev.to/royalaid/aws-api--lambda--cljs-29ca

Whiskas17:12:52

what are the best ways to debug clojurescript?

royalaid17:12:41

@mateus.pimentel.w What env are you working from? Do you have a repl set up?

dnolen17:12:48

@mateus.pimentel.w in Chrome it mostly just works, especially if you're using cljs-devtools

dnolen17:12:15

it also works in Safari & Firefox, but cljs-devtools gives Chrome the advantage

Whiskas17:12:38

nice, i realized that when i was using figwheel, i could set breakpoints on the .cljs files even with hot reloading. Now with shadow-cljs i think i will have to do some configuration in order for it to work like that

Whiskas17:12:00

i will see what is missing

dnolen17:12:24

breakpointing doesn't really have anything to do w/ tooling btw

dnolen17:12:30

fundamental feature

dnolen17:12:57

it is true that your hot-loader does need to be careful to not mess things up

Whiskas17:12:17

i think the files are just not being updated on the browser then

Whiskas17:12:47

as they were with fighwheel, which setted a kind of unique id for every resource ( with ?timestamp= or something like that )

dnolen17:12:00

right cache busting

darwin17:12:52

(shameless plug) for desperate cases when you need to debug/explore something in the middle of complex foreign code, there is Dirac DevTools[1], it has complicated setup, but it allows you to eval cljs code in the context of a paused breakpoint. [1] https://github.com/binaryage/dirac

bmills17:12:04

I've set up Material UI using the npm bundles option in figwheel and a webpack bundle. Problem is, I'm getting two versions of React in my page. One from the webpack bundle (which it needs to bundle Material UI), and another from Reagent's use of clsjs.react. Is this something folks have dealt with before?

dnolen17:12:16

you need an exclusion

dnolen17:12:44

just exclude react from cljsjs.react deps

bmills18:12:50

@dnolen hm. I tried that, but now get build errors calling Reagent function (like reactify-component).

dnolen18:12:03

@bryan778 I don't understand "build errors" when you're talking about runtime stuff

dnolen18:12:08

can you provide more details

bmills18:12:15

the cljsjs package is explicity referenced in reagent

lilactown19:12:48

apparently React elements are immutable?

lilactown19:12:56

like, literally I can’t seem to mutate them?

jstaab19:12:43

Is there a clojurescript port of ring?

jstaab19:12:52

Wrapping nodejs' http perhaps?

lilactown19:12:49

it’s not exactly like ring because Node.js relies on callbacks

lilactown19:12:01

but we’ve been using it at work for the last ~11 months and it’s been pretty good!

jstaab19:12:15

Cool, I'll take a look!

dnolen19:12:52

@bryan778 the problem is that your replacement is not specifying that it provides react

dnolen20:12:02

that last couple sections of https://clojurescript.org/guides/webpack cover this

dnolen20:12:32

you should examine the build configs here very closely - they are pretty simple but the pattern must be followed exactly

matthewdaniel21:12:47

anyone use nervous-system's cljs-lambda?

matthewdaniel21:12:20

I've got the demo echo working and not quite sure what it is doing when it sets body to (event :body). I thought maybe if i replace that with some custom edn i would get the edn back but i'm not understanding what's going on here.

matthewdaniel22:12:15

I was mistakenly under the impression that it was piping the input through js->clj and output through clj->js

idiomancy19:12:47

heyya, I've been working with it a bit. let me know If you still need some support. I'll try to help out

bmills21:12:36

@dnolen I think that makes sense. I'll give it another shot this evening. Thanks for the help.