This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-22
Channels
- # aws-lambda (2)
- # beginners (195)
- # boot (47)
- # capetown (14)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (103)
- # clojure-berlin (28)
- # clojure-dev (92)
- # clojure-dusseldorf (3)
- # clojure-finland (2)
- # clojure-germany (3)
- # clojure-italy (4)
- # clojure-russia (37)
- # clojure-spec (104)
- # clojure-uk (52)
- # clojured (2)
- # clojurescript (124)
- # community-development (7)
- # core-async (6)
- # cursive (41)
- # datomic (53)
- # dirac (2)
- # emacs (16)
- # hoplon (5)
- # jobs (3)
- # juxt (12)
- # lein-figwheel (6)
- # leiningen (15)
- # luminus (3)
- # off-topic (49)
- # om (5)
- # onyx (13)
- # overtone (27)
- # re-frame (7)
- # reagent (46)
- # ring (3)
- # ring-swagger (11)
- # spacemacs (2)
- # specter (40)
- # sql (6)
- # untangled (149)
- # vim (14)
I seem to have the following problem: if my code calls itself, and it does an (assert false), I get a stack trace fine in dirac/cljs-devtools However, if my code creates a (fn [] ... ) which reagent/react calls later -- and that function does an (assert false) -- then, instead of getting a tack trace, it loks like react catches it, returns NIL, and throws some other error
If the above is true, is there anyway to tell react to not catch exceptions, and let the exceptions remain uncaught so I can get my stack frames?
You should be able to “Pause On Caught Exceptions” in Chrome DevTools. This should allow you to identify who is exactly catching those exceptions thrown by your assert. Then you should be able to address it based on that information.
this is not really clojurescript related question I believe, this is general javascript problem
@darwin: lol, (1) I posted in #cljs isntead of #dirac thinking it'd be off-topic in #dirac (2) unfortunately, this hits an caught exception in (devtools.core/install!)
I understand that it could be annoying to stop on other exceptions, that is a reason why I think it is a bad practice to use exceptions to do normal non-exceptional control flow
is there any library that changes chrome dev tools into a SERVER which I can then connect to via emacs? I'm not looking for brepl; I want chrome canary to open up a port that emacs can talk to
JS interop question [minimal case]: given this nested map (def m {:location {:city "San Jose"}})
I want to convert the city to uppercase, but (update-in m [:location :city] .toUpperCase)
does not work; where am I going wrong?
Thank you!
A couple of interesting alternatives:
(update-in m [:location :city] (memfn toUpperCase))
or the portable:
(update-in m [:location :city] clojure.string/upper-case)
@negaduck you asked yesterday about a weird compilation error and I asked about the version, thinking I saw something that might be related yesterday for the latest version. But it may also actually hit your version: http://dev.clojure.org/jira/browse/CLJS-1948
https://anmonteiro.com/2017/02/compiling-clojurescript-projects-without-the-jvm/ Wow, this is amazing work 😄
it's only the beginning of what it could become
long way to go still, until we achieve feature parity with what the JVM compiler gives us
(also possibly some improvements to the Closure Compiler JS needed)
still, I'm bullish on cljs so anything which expands its reach is happy news for me 😄
@anmonteiro this is incredible, thank you for the efforts
@bbss, I’ll probably look into that later, thanks. That strange problem is solved by serving files separately from figwheel: https://github.com/emezeske/lein-cljsbuild/issues/458#issuecomment-281647384
(Rewrote this message to be more concise.) I want to include foreign libraries, so I'm trying the example at https://clojurescript.org/reference/dependencies#bundling-foreign-javascript-code. (However, I am running this on node, without advanced compilation; the examples on that page are for the browser.) I have a "yayquery.js" file that's the same as theirs. My build script: https://hastebin.com/ikevizihap.clj (I omit externs since I'm not using advanced compilation) My core file: https://hastebin.com/melosegoqi.clj When I try to build, I get errors: https://hastebin.com/pokabumugi.txt How do I include foreign libraries when using node?
I tried adding externs, but it didn't change anything.
(Should I be in the #beginners channel?)
ANN: Transforming Data with ClojureScript (online book in progress) The book, at http://langintro.com/cljsbook has interactive examples and is written for people who have not programmed before or are beginning programmers. The book is about two-thirds complete. Comments welcomed.
@tech_hutch Have you tried passing the yayquery.js
argument as a relative path? Looks like it wants relative paths (line 42 of the stack-trace)
I have not. I was trying to figure out where it was relative to. What's strange is that both putting the file in selfbot-cljs and in selfbot-cljs/src caused the error to show the right path to the file (selfbot-cljs or selfbot-cljs/src). I believe that the documentation says that it's relative to classpath, but what is that, since, as per the guide, I'm passing both cljs.jar and src with the -cp flag on the command line?
@tech_hutch hmm, have you tried renaming selfbot-cljs
to selfbot_cljs
. There's that weird thing about Java not liking hyphens in the classpath.
....and for some reason, underscores have to be used as a substitute for hyphens. Weird, I know.
Oh, I didn't know that.
I did remember reading something about namespace hyphens needing to be underscores in the file path, but I didn't know this applied to the whole path.
@tech_hutch I'm not sure if that will solve your problem, just a guess.
@tech_hutch I figured it wanting 'relative paths' translated to class paths 😛, and therefore no hyphens. But those two ideas might be completely separate concerns
Now I'm having another problem where I can't get a repl running from the browser. It was working yesterday. I'm not sure what's different.
I'm getting "Figwheel Server: Resource not found Keep on figwheelin'" in the browser even though it looks like figwheel started fine on the commandline - it was working yesterday, but now I can't figure out where things are going south
hi list. i'm working on a clojure (not clojurescript) thingie for webcomponents https://www.webcomponents.org. i have only a thin understanding of react, om, etc., but it looks like they all do sth more or less similar to what webcomponents do, in different ways. what's the clojurescript take on webcomponents?
I’m sure some higher level thing could be done with them to make them more functional friendly
I'm not sure what I'm doing differently now, but the repl in the browser is working now. Now to troubleshoot my other issue…
yep, that's basically my project. now that it's close to done in clojure i'm looking at cljs. om etc. and web components are not the same thing, but it looks like there is considerable overlap.
@mobileink in what way is om/React like WebComponents? In terms of their shadow dom stuff?
@emccue pretty sure not possible, you need IntelliJ not one of the standalone dev things - you might want to double check that in #cursive
@mikebelanger that, and what polymer https://www.polymer-project.org/1.0/ calls "data binding". as it happens, i have a defcomponent macro that from about 10,000 feet looks like defui from Om Next. But my defcomponent gets "compiled" to produce html + javascript, so it ends up using shadow dom. does Om Next use shadow dom?
@mobileink Om Next is just a wrapper over React, doesn’t use Shadow DOM
ok, thanks. one of the advantages, they say, of shadow dom is no css leakage. styling of custom components is not affected by app-level stylesheets. is that an issue in practice for Om/React?
I have a strange question: lein run
complies clj, cljs, and opens a browser for my builds.
However, not always does a server start on localhost:517621 or whatever random port number, and it's a bit perplexing. Usually I can get a server running within an attempt or two, but sometimes I just don't get a server running & it's not very straightforward to debug.
@mobileink cool - yeah WebComponents, shadow-dom look promising. I'd be interested to see your library.
more generally, i'm filosofizin' about the effects of webcomponents on stuff like react, om, etc. if all the major browser vendors implement, as they have apparently agreed to do, then such things will become at least partially obsolete. at least some of the problems they were designed to solve will have been solved in a standardized way.
@mobileink I was about to say, the only issue with WebComponents is browser coverage. Sadly, lots of good ideas like WebComponents either didn't get covered widely enough, or get poorly implemented (ie RSS, animated PNG).
@mobileink Sorry for sounding pessimistic. And at this point I guess I'm off-topic 😛
@mobileink What I'm trying to say is that while WebComponents look promising, its very possible for browsers to retract their commitment to them, and React and their wrappers will become the de-facto standard for quite a while.
@mobileink for many applications CSS leakage isn’t a real problem
besides, some really great clojure/clojurescript libs will surely make all the difference.
@dnolen i kinda suspected that. but the other nice thing about wc is you can just drop it in to any webpage, in principle.
in principle i do not see why you could not do that with compiled Om components. i wonder if anybody actually does that?
@mikebelanger yes, there is a risk. but in this case i think it's relatively low. when i started on this a year or 2 ago, polymer was the only game in town. but now look at https://www.webcomponents.org. an embarrassment of riches. it's not just google; check out https://www.polymer-project.org/1.0/blog/2016-03-10-community-highlights-predix-ui. with that kind of big $$$ backing it seems a safe bet.
@mobileink cool, yeah if GE is backing it too, makes it all the more promising
of course they have enough money to get it completely wrong and not break a sweat, but still. i believe even the behemoth from Seattle is on board, but you never know with them.
see https://www.polymer-project.org/2.0/docs/about_20#browser-support-and-polyfills
@mobileink web components sound cool but it is basically just a thin layer on top of the usual stuff
react etc are hacks. very useful, but still hacks, only needed because the base atuff is lacking.
web components is basically doing it the old way just providing some sugar so it is easier to isolate things
ok. but what i mean is just that you would not need them if browser standards already did.
it is irrelevant that it is built-in (which it isn't btw: http://caniuse.com/#feat=shadowdomv1, http://caniuse.com/#feat=custom-elementsv1 support is terrible)
the issue is when things change over time, doing it with data-bindings and callbacks is annoying
i confess i don't follow your last 2 comments, but give me some time. re: sugar, it's all sugar where naming is involved. defn is a sugar macro: it allows you to use a name instead of #(...). webcomponents are no different, really.
e.g. you write (my-fn "foo") and you get the expansion of my-fn with "foo" plugged in.
I hate some things about React
but the development workflow it enables is hard to beat
fwiw, having gotten my clojure thingie close to working, i'm looking at the clojurescript side of things and not having an easy time of it.
hiccup and scss and lately https://github.com/thheller/shadow/wiki/shadow.markup 😉