This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-26
Channels
- # admin-announcements (33)
- # beginners (41)
- # boot (97)
- # clojure (220)
- # clojure-berlin (3)
- # clojure-russia (31)
- # clojure-sg (3)
- # clojurebridge (2)
- # clojurescript (137)
- # clojutre (13)
- # core-matrix (10)
- # core-typed (1)
- # cursive (18)
- # datascript (1)
- # datomic (93)
- # devops (6)
- # editors (18)
- # emacs (1)
- # funcool (43)
- # hoplon (4)
- # immutant (6)
- # instaparse (3)
- # jobs (25)
- # ldnclj (14)
- # ldnproclodo (4)
- # off-topic (20)
- # om (21)
- # rdf (79)
- # re-frame (14)
- # reagent (12)
- # ring-swagger (18)
- # yada (52)
Hey, will lein-cljsbuild pass the :closure-defines
options down to the clojurescript compiler? I’ve got {:builds {:dev {:compiler {:closure-defines {“spam” “eggs”}}}}}
but I’m getting warnings about "unknown @define variable” at compile time
@timgilbert: Afaik :closure-defines
only works for :advanced
builds. You can use goog-define
to set values for dev builds (requires 1.7.48).
@timgilbert: https://github.com/clojure/clojurescript/blob/04d0b92da513c8e7129e06bc34b19b1801207c32/src/main/clojure/cljs/core.cljc#L690
Oh, thanks @juhoteperi. Actually I think what I was missing was including the namespace in my define (I was using :advanced)
Will give that a try. Looking at the source is helpful.
I have something like this:
(defn main-view []
[:div
[target-component {:sub-category (-> @state/categories :sub-categories first)
:category (-> @state/categories :categories first)
:target ""
:editing? true}]
[target-list]])
@viesti: this really depends on how what target-component does
but initializing local state like this is probably the reason this goes wrong
I mean, your best chance is to not use local state
@andre.richards: thanks, still struggling with my English sometimes
@val_waeselynck happens also if I don't have local state in target-component. Seems that the component is created once with the data given as argument isn't refreshed
@viesti: hard to help you without seeing what's inside target-component
Can happen if target-copmponent
is in the form (fn [args] <do something> (fn []))
@viesti: this can help you: https://github.com/vvvvalvalval/reagent-phonecat/wiki/Step-10:-stateful-components
Anyone else using pushy
? Looking at the source it seems like it tries to handle all URLs, even those that do not point to the site itself. Workaround might be adding external URLs as targeting _blank
.
@jellea: can you be more specific? are you trying to do something that isn't working?
@jellea: I think ES6 classes are just regular ES5 prototypes. ES6 adds new syntax, but I think the underlying functionality is the same.
ricardo: I’m using it, but I haven’t added any external links yet. That sounds like a bug.
This document explains how to have figwheel running: https://github.com/bhauman/lein-figwheel/wiki/Quick-Start but I don’t want figwheel in production, do I? How should I handle the difference between dev and prod here?
#tel React components have a lifecycle protocol and should work pretty well for managing services. And as a bonus you can declare them in and out of existence easily.
I'm just suggesting that you can sometimes bottle that state in custom React components.
does anybody have experience using custom tag literals with data_readers.clj
while compiling ClojureScript?
@bhauman: in any case it's not trivial. so I won't solve it today. Therefore I might as well fire up Figwheel 0.3.8-SNAPSHOT
!
@bhauman: Not sure if I've said it before, but thanks a ton for figwheel. I have had to start doing some C# dev work that includes a bunch of reloading again and it reminded me how much of a difference figwheel has made to all off my web development.
@shaun-mahood: thanks man! I appreciate it.
I just tried upgrading from clojurescript 0.0-3308 to 1.7.48 and have run into an error java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement (Matcher.java:809)
- anyone have any idea where to start looking for the problem?
@shaun-mahood: to be honest, it doesn't ring any bells. Are you defining your own macros?
@shaun-mahood: I have seen that before
@shaun-mahood: lein clean is your friend
@bhauman: Tried lein clean, tried clojure 1.7 and 1.8.0-alpha4, no luck
@bensu: none of my own macros
@shaun-mahood: the only thing I can think of is to look at lein deps :tree
and look for new conflicts
Oh cool - moved to clojurescript 1.7.107 and it works again!
@bhauman: you mean without restarting and editing project.clj
just drop a file and require it?
Might be a problem specific to developing on a windows machine
@shaun-mahood: hahahaha! you should always start with that. after a fair amount of major releases, windows bugs are quickly discover and windows specific issues are cut.
@bensu: the cljs github has 1.7.48 listed as the latest stable version, I'm not used to going to maven to see what is newer than that.
for newest.js
with goog.provide('newest')
if fails to find it once I require it. I'll now try with a properly namespaced one
for example example/core.cljs
has example/helper.js
that provides goog.provide('example.helper')
ok, there might be one hiccup: I'm using a hyphenated folder name: dep_graph/helper.js
. do I provide goog.provide(
dep_graph.helper`)` or goog.provide
(dep-graph.helper)`
Does cljs.repl
support nREPL? I can’t find anything in the repo besides nrepl files being in gitignore, which suggests “no"
bhauman: A friend of mine asked recently whether I miss LiveReload. I said I don't, because I have figwheel now, and it works where LiveReload does not.
This is giving me the strange feeling that I should start using Google Closure and a ClojureScript workflow for my JavaScript only projects which is clearly insane. Cool!
One thing I didn't try was to see if an empty project with just a single js file will work
@dottedmag: didn't see your comment. That's sweet!!! you should try the new js reloading it's kinda freaky
@bhauman: This friend is actually the author of LiveReload :) Thanks a lot for figwheel.
@dottedmag: OMG thats rough, LiveReload has a ton of code in it now
but tree src
shows only one js file, the compiler produces a full goog.base & cljs-deps file, and figwheel takes it from there
@bhauman: That's what one gets for supporting everything and a kitchen sink and not being integrated in one build system. I pity him sometimes :)
@dottedmag: he started a great thing though
@bensu: its actually not part of the design, just something that happens as a side effect
If you are interested in documenting the implicit GClosure js behavior that would be amazing, if not no big deal
@bhauman: paradoxically that is what happens when you have good design, it surprises you in pleasant ways.
ohh sure, I'm not proposing this as anything reasonable nor fully functional, but it's fun and somebody might find some use for it
@bensu: there is one more important improvement, figwheel 0.3.8 is automatically reloading dependents wether they are recompiled or not.
@bensu: if a file is dependent on a recompiled file now it gets reloaded, so things are now pretty seemless
@bhauman: I got interrupted, here is the sample project https://github.com/bensu/figwheeljs
with a short notice not to open issues for this use case since it is not a priority at all
@domkm: In omelette, here: https://github.com/DomKM/omelette/blob/master/src/omelette/render.clj#L12 does it mean you are parsing JS in every HTTP request?
@pupeno: No, it's just run once for each renderer https://github.com/DomKM/omelette/blob/master/src/omelette/render.clj#L48
Ah, I see. I’ll have to implement something like that.
I am loading the JS in each request so far: https://github.com/ldnclj/proclodo-spa-server-rendering/blob/master/src/clj/proclodo_spa_server_rendering/handler.clj#L18
I think there is now a way to store parsed JS in Nashorn so you don't have to keep reading it. I haven't looked at Nashorn in ages but it might be worth looking into.
Oh, I’ll look into that.
@bhauman: final note on the Figwheel for javascript adventure, a short demo: https://www.youtube.com/watch?v=Y0ulIVLbuX8