This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-03
Channels
- # bangalore-clj (2)
- # beginners (29)
- # boot (52)
- # cider (4)
- # clara (3)
- # cljs-dev (34)
- # cljsjs (7)
- # cljsrn (3)
- # clojure (71)
- # clojure-austin (1)
- # clojure-dev (5)
- # clojure-france (20)
- # clojure-russia (51)
- # clojure-spec (9)
- # clojure-uk (20)
- # clojurescript (131)
- # core-async (56)
- # core-logic (6)
- # cursive (50)
- # datascript (19)
- # datomic (16)
- # dirac (118)
- # emacs (100)
- # events (4)
- # hoplon (14)
- # incanter (1)
- # jobs (7)
- # jobs-discuss (96)
- # jobs-rus (21)
- # lein-figwheel (5)
- # leiningen (21)
- # off-topic (11)
- # om (45)
- # onyx (42)
- # pamela (1)
- # pedestal (22)
- # portland-or (3)
- # re-frame (8)
- # reagent (5)
- # ring (9)
- # robots (1)
- # spacemacs (14)
- # specter (28)
- # sql (2)
- # untangled (165)
@darwin: I am using some library which catches (assert false)
which is bad; because I like getting exceptions + debugging stack frames in dirac/cljs-devtools. Rethrowing is not getting the stack frames I want.
My question now: instead of (assert false)
, can I do something like (call-dirac-break-point)
where my code, instead of throwing an exception, directly interacts with dirac to cause dirac to have a break point there? [I realize this would only work in dev mode, and that is fine.]
Basically, instead of jumping into dira/cljsdevtools via (assert false) [which other code can catch / screw up], I'd directly like to make a call into dirac-break-here.
can I do something involving https://github.com/binaryage/dirac/search?utf8=%E2%9C%93&q=js-debugger that triggers the debugger ?
I think nothing is stopping you to do that instead of assert, so you get a conditional breakpoint
can I set dirac breakpoints in my cljs files directly, without using the cljs-devtools-browser-ui ?
I don't know the proper name of the gui window that pops up when I click on the "dirac extension" inside of "chrome canary"
yes, but "dirac devtools" consists of that ui + parts in nrepl + parts in cljs code + dirac agent
cljs-devtools provides bunch of custom formatters to present cljs data structure in chrome console
I see, my mistake is confusing cljs-devtools (which provides pretty printing in clj format) with dirac-devtools
there are other tricks you could do, but I’m not sure if you should go that route, you could schedule an async call and throw assert exception there
something like this: https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/async.cljs#L13
I have a data structure which is a LIST of VECTORS. When I view the local in the "local scope vars" or in (. js/console log), I do NOT want to see
( [:foo 1] [:bar 2] [:cat 3] [:dog 444])
instead, I would prefer to see
([:foo 1]
[:bar 2]
[:cat 3]
[:dog 444])
is there anyway I can specify horiz vs vert rendering via meta -- or if not, add extra junk elements to change the way whether dirac choose horiz vs vertical?is there a way to tell dirac that instead of localhost:8230, it should look for this-ip:8230 ?
@giles @richiardiandrea @darwin : did this ever got resolved? https://clojurians-log.clojureverse.org/dirac/2016-08-23.html I'm basically running into the ezact issue
@qqq you could try to tweak cljs-devtools prefs, for example this one controls how many items you need to render “expanson disclosure triangle button"
https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/defaults.cljs#L42
as of the second issue, you probably need to tweak nrepl config, which controls weasel configuration: https://github.com/binaryage/dirac/blob/master/src/nrepl/dirac/nrepl/config.clj#L19
here you have some docs how this works: https://github.com/binaryage/dirac/blob/master/docs/configuration.md#dirac-runtime---page-specific-configuration
btw. nrepl-config override can be specified in runtime config, it gets constructed here and sent via bootstrap message: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L328-L334
what I'm curently trhing is: :dirac-opts {:nrepl-tunnel {:host .. ip ..}}} but clearly this is wrong
probaly because I'm doing this wrong; in that "preloads" = stuff injected into cljs land right? :dirac-opts comes from (doc dirac) // in boot which comes from powerlaces.boot-cljs-devtools
actually it is pretty tricky to configure nrepl middleware, because there is no mechanism supporting it in nrepl system (AFAIK)
a tip: if you open internal devtools console on "dirac devtools” page, you should see runtime config and messages about weasel connection attempts, you should see there if your setting got reflected there
@darwin: noted: the problem is -- during moving boot to a remote machine, I somehow broke my *.clj scode, which means I can't compile new cljs code / test out what you've already suggested
I would try just emacs to have a remote nrepl connection, but all dirac stuff sitting on single machine and use remote desktop or something to see the browser
so emacs = runniing on local MBP boot + dirac = running on remote beefy machine then VNC into remote machine to show browser + dirac ?
I have no doubt that's the right solution, but I now I think this is a matter of pride where if I can't get it working, I'll bother me for the rest of the week
and back to your question, I don’t have a day job, that is why I can be so responsive 🙂
actually I make money here: https://www.binaryage.com, but that is a dead business already, so I just play with cljs
okay, I have gottten error from: dirac failed to conenct on <ws://locaolhost:8231> to dirac agent is not listening at <ws://192.168.0.113:8231> I think I know what's going on, in my boot config for whatever's litening on 8231, it's doing it on localhost, not on 0.0.0.0
I want to build my next biz idea with cljs+clojure, but before that I had to make some better tools/libs to hopefully get there
yeah, in boot it says: Agent is accepting connections at <ws://127.0.1.1:8231> whoa, the 1.1 is NOT a typo, this is weird
if/when my startup becomes profitable, I'll be happy to pay subscription fee your way if you build tools
thanks, but this is not going to make enough to support this development, cljs community is tiny, at least not in short term
err, I think this channel is publicly logged; I'll send a beta invite you way when it's ready
it's actually not the idea that's private; it's that I don't want competitors to know I'm debugging my cljs with dirac 🙂
it's too bad that you can build somethign that 2xs productivity of 100 ppl, yet not be able to make a living off of it
I didn’t want to claim it is not possible, I haven’t tried, actually Colin made a living from Cursive, Clojure + ClojureScript ecosystem is much bigger that and code editor is something everyone needs. With dirac the target audience is much smaller and it is not that essential.
anyways, Dirac is now in mainenance mode, I have all features I wanted in place, now I will “just" keep maintaining it, there won’t be much my effort going into new development there
let me know if/when you get your remote setup working, I’m curious, but be aware that there might be some blocker, never tried it myself
okay, so I got it working, but not via dirac connecting remote (on second thought, the idea of opening up nrepls on 0.0.0.0 did not sit well with me) whatI did do ... was just port forward (over ssh) 7000 [http port], and 8230-8242
@darwin: one nice thing about being a founder/unemployed is large blocks of time to learn whatever I want I'm not asking you to do this for me -- I'm asking you to point me to the right direction so I can do this myself -- I think it's high tie I learn how to deal with either (1) chrome extensions or (2) chrome devtools extensions alright, so right now, in dirac devtools, when I get an exception printed in teh console, and it shows me something like: (window.cljs:50) when I click on that, it jumps me to window.cljs ,line 50
instead, I want to modify it so that when I click on it, it sends a REST request to some webserver somewhere (i.e. run by emacs) -- what is the minimal amount of tech I need to learn in order to do this?
given how basic the op is, I'm willing to do this in pure-js, it doesn't have to be a cljs setup
I wanted to implement it myself I will teach nrepl middleware to be configured to execute a shell command on such clicks
or more specifically it will execute a user-specified function, the default implementation will be a shell script execution (if the script exists)
it already got enough thumbs up: https://github.com/binaryage/dirac/issues/56
emacs / nrepl-server not on same machine, but not a problem; if I can setup clj callbacks for each "dirac devtools ui event", hooking up eamcs <-> remote nrepl is not going to be ahrd
I will introduce a new nrepl op, something like :dirac-devtools-request
, dirac nREPL middleware will handle it and launch a pre-defined function (in the context of nREPL server)
documented it in the same manner as https://github.com/binaryage/dirac/blob/master/docs/about-repls.md 🙂
you will be either able to specify that function via config, or write a shell script to do whatever you want, for example do http post somewhere
[unrelated to solving this for dirac] as an aisde, it's kinda of annoying how shitty modern dev cycles are; I should be able to right click an element, and say "for each element of this, type overwrite the :onClick handler to execute THIS CODE INSTEAD" instead, we have to jump through all these hoops to do otherwise such a conceptually simple task
did you program for web before firebug was introduced back in 2006 or so? that is what I would call a shitty dev cycle
no, I refused to learn web dev technologies for the longest time because javascript fucking hcanges all the time
hmm, what I meant to say (but not what I wrote is): if you learn an algorithm, like binary search or heap sort, that knowoedge will stay the same and likely not change for the rest of your life if you learn some javascript trick that works in Netscape 3.0, no one knows how useful that knowledge will be 5 years from now; in that sense, js knowledge "changes all the time" and is not that worth learning so instead of "js", I should have said "latest tricks to do cool things by exploiting new browser quirks"