This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-02
Channels
- # admin-announcements (1)
- # alda (3)
- # beginners (28)
- # boot (155)
- # braid-chat (8)
- # cider (22)
- # cljs-dev (46)
- # cljsrn (24)
- # clojure (94)
- # clojure-belgium (23)
- # clojure-czech (2)
- # clojure-germany (7)
- # clojure-greece (12)
- # clojure-india (1)
- # clojure-japan (1)
- # clojure-russia (118)
- # clojure-spain (18)
- # clojure-spec (40)
- # clojure-sweden (19)
- # clojure-taiwan (4)
- # clojure-uk (5)
- # clojurescript (185)
- # clojutre (10)
- # community-development (5)
- # core-logic (11)
- # css (5)
- # cursive (7)
- # datomic (5)
- # dirac (6)
- # emacs (2)
- # euroclojure (1)
- # events (5)
- # hoplon (355)
- # instaparse (3)
- # jobs-rus (5)
- # lein-figwheel (2)
- # leiningen (5)
- # mount (11)
- # off-topic (8)
- # om (20)
- # onyx (10)
- # other-languages (87)
- # perun (9)
- # proton (1)
- # re-frame (21)
- # reagent (16)
- # specter (28)
- # tmp-json-parsing (5)
- # untangled (19)
- # yada (43)
I keep wanting to refactor the cljs.repl/repl* code into a constructor for the functionality (read, eval, print, prompt, etc) and the bundled environment data and separate it from the loop. This would be a boon to piggieback with it's ugly duckling "setup a repl on every eval" behavior. There is also the possibility of factoring out the setup code into a group of functions that can be re-used. I guess the point is that the setup code is very valuable and it would be nice to have a convenient way to construct an eval function, or a type that we can call eval on.
(.then (get-json-promise) #(js/console.warn (.-url (first %))))
(.then (get-json-promise) (fn [data] (js/console.warn data) (map #(js/console.warn (.-url %)) data)))
With map
nothing happens. Why? first
works however.@debug: map
returns a lazy seq. If you want side effects you probably want doseq
. See this stackoverflow for an example: http://stackoverflow.com/questions/21069188/how-do-i-perform-a-function-with-side-effects-over-a-vector
@debug, as a quick fix, you can also replace map
with run!
[figwheel "0.5.4-SNAPSHOT"]
gives me an error about :compiler
being a wrong configuration key. Has something changed, or did I do this wrong all along? @bhauman ?
replacing it with :build-options
(as indicated in the error message) worked though. To be clear, I'm talking about running figwheel-sidecar.repl-api/start-figwheel!
. With 0.5.3
, the :compiler
key worked just as well, and I don't remember seeing a warning about it.
but you might also want to log them, because I didn't immediately discover it, due to running start-figwheel!
in a future
@bhauman changing cljs.repl/repl* just isnāt going to happen, all that stuff is more or less frozen in stone at this point.
making some new thing that piggieback can use is the only thing that would be considered
@pesterhazy thanks! Will try that
a constructor function that takes ReplEnv and returns an eval method or something like that was all that I was thinking of
i.e. why not put the framing stuff around Socket REPL connected to a ClojureScript REPL and separate all these problems
And I get that approach completely. There is no argument here, I do think that approach can lead to tools opting to parse strings for errors and warnings and such.
the tools to fix all these problems have been sitting around for a long time now, anyone can work on this - especially people without full plate of tooling work
how to make (secretary/dispatch! "/loginā) to change URL? changing URL will fire dispatch and according handler. but manually fire dispatch wonāt change browser url š
@dnolen: currently grokking the different implications of this... will let it ruminate
@rui.yang: there might be another way, but I just .setToken
on the goog.history.Html5History
@darwin @bhauman so something else thatās been on my mind related to tooling - it seems the need to inject something for setup into the build is pretty high
so Iām open to the idea of making some standard way to get thing X loaded and setup before user code
I know people already have workaround or what not, but if people have some strong opinions about how this should be handled - Iām listening
If you create an issue ping me. I'll look at what figwheel is doing and see if I can help.
@bendlas: what I want to do is to switch pages in my SPA. the correct way is call History.setToken to trigger secretary/dispatch!, instead of calling secretary/dispatch directly. thanks for the tips
Ok, I just gotta come in here to say how much I love cljs and reagent. Trying it for the first time to muck around on the front end, and I love how the combination of cljs and react just basically abstracts away all the ugly of dom manipulation. Such happy.
@rui.yang: you might also want to have a look at pushy, which integrates goog.History with well-known routing libs
@bhauman: figwheel fails when trying to show the warning dialog for warninged code: when calling format-line
from heads-up/display-system-warning
, a map gets passed, and subsequently goog.string.indexOf
gets called on that
The old display-warning composed over display-system-warning. it doesn't do that anymore.
strange, i see it called with a map with :ns :file :extra :column ....
in my debugger
@dnolen: that would be great, but I think the problem is two fold:
1) how to make sure init code for different tools runs in particular order before userās own code which runs last (also the user should be able to specify that order explicitly if needed)
2) how to provide configuration to individual tools
I think the first problem would be solvable by allowing compiler option :main
to accept a list/vector of namespaces. cljs-devtools would provide a special ābootstrappingā namespace which would contain (devtools/install!)
call, people would put it there before their own namespace(s). I think this is something @thheller already proposed in some JIRA ticket.
The second problem would be more work. I would like to see something like āenvironmental configā which could be passed in compiler options and tools could configure themselves based on it.
Right now, the best practice for cljs-devtools installation is described here:
https://github.com/binaryage/cljs-devtools/blob/master/docs/install.md#dev-builds
And the tool can be configured by altering default prefs before calling (devtools/install!)
https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/prefs.cljs
no, i depend on figwheel-sidecar 0.5.4-SNAPSHOT
, which in turn depends on figwheel 0.5.3-2
apparently
ok sorry, my dev meta-dependency depends on it and leiningen chose that one, sorry ...
@darwin: just fyi in case you don't already, boot-cljs does exactly what you said, the same convention could be brought to core: https://github.com/adzerk-oss/boot-cljs/wiki/Usage#multiple-builds
@dnolen: @darwin a thunk of code custom init code that runs before :main is required, could go a long way, this allows for a great deal of expression
hm, āuse componentā means āforce user to use componentā, because me using component does not help if user is not starting his app via compoenent model and integrate my component into his components deps properly
they can copy and paste some simple build config - and we provide a easy hook for these basic cases
btw. just curious, would you consider forking cljs-devtools into cljs.devtools namespace (a new project) and make it part of āout-of-boxā clojurescript experience? I think it got mature enough and I would be willing to make changes to make that happen
@darwin thatās interesting - but I think tooling stuff probably should evolve freely outside of the various restrictions around official projects
@bhauman: yeah, anything which reduces friction for new users sounds good to me, figwheel is first thing people install and if they get cljs-devtools for free, better
but you will still have the problem āhow to run devtools/install! before any userās codeā, without userās assistance, you cannot do that AFAIK
another topic: I want to integrate figwheel's nREPL with Dirac soon, something along these lines: https://github.com/binaryage/dirac/blob/master/docs/integration.md I think it should work in theory even now. But I want to make sure, the new improved error/warnings could be displayed nicely in Dirac when joined with figwheel REPL
the idea would be to start Figwheel with nREPL as usual, but include dirac nREPL middleware and then join it with Dirac REPL as described in the document
When running tests that use cljs.spec (using lein-doo) It prints the newlines as escaped in the validation errors, how do i tell it to print them instead?
Iām making a website plugin system. [cljs.core, my-base-code.core -> js] <<load scripts << [p1.cljs-> js] & [p2.cljs -> js]
Is it possible to compile cljs into a js file without including dependencies of require
ād namespaces. So I can then just include the plugin js files and they will work because cljs.core and other libs will already be loaded. I believe LightTable does something similar for itās plugins, Iām just not sure if this is a compiler option or more like defining my cljs code as externs⦠Any advise would be appreciated!
Is something changed since this thread started and where is a way to simplify patterns? https://groups.google.com/forum/#!topic/clojure/13gOQgzGEMk
@dragoncube: nothing has changed
Iām trying to use @raās clojurescript-npm to write a script. The following does what I expect if entered line by line into their cljs repl:
But this next file, in js, is not the right way to run it as a script ā it exits with no output:
@dnolen: I see, thanks
I'm having trouble finding a good explanation for how Hoplon and Reagent/Re-frame compare. I know Hoplon uses a "spreadsheet" metaphor with Javelin and doesn't use React, and Reagent uses FRP and React, but spreadsheets are sort of FRP, aren't they? How does the metaphor diverge? I want to make an app where much of the code I could reuse for the web, my phone, and the desktop, though this will most likely be a desktop-first app via Electron. I want to make a personal knowledge base (https://en.wikipedia.org/wiki/Personal_knowledge_base), so I want to be able to query and explore a multimedia graph database rendered in canvas or WebGL (I'm not sure of the GUI side yet, but the data structures side is pretty well-defined for me). I want to have the database be immutable and versioned, so I've been looking into using DataScript as the base for my database. How would DataScript fit into Hoplon or Reagent? Can you help me understand the pros and cons or differences between Hoplon and Reagent for someone who hasn't used React or ClojureScript before? I use JS a lot, but I don't have any real experience with the React or ClojureScript ecosystems nor even Clojure, so I don't quite know why I would want CLJS-flavored React any more than I know that I would want Javelin. I apologize for requesting such a comprehensive explanation from such ignorance. There's so much information to understand that it's difficult for a newcomer like me to make sense of it and make a good judgment on which framework/library is best for me. I have dabbled in different Lisps but haven't used any for real projects, though I've made a Lisp interpreter. I say this so you realize I'm not a complete newbie when it comes to Lisps in general, though I'm definitely a newbie to Clojure(Script).
Hi everyone. New at reagent. I defined a component, giving it a :name prop. Something like
(defn my-comp [name] [:h1#title {:name name} name])
. Elsewhere in code, I setup a click event listener for that component: (dommy/listen! (dommy/sel1 "#title") :click clicked)
. How do I access the :name prop from inside the event handler? (defn clicked [] ...)
@gamecubate: there is a #C0620C0C8 channel
@mhr: thereās a #C08BDAPRA & #C0620C0C8 channel, probably best to ask that question in the respective places
Yes I saw and (double) posted (here). Not so deep on Slack yet. Thanks will keep it to one channel.
<switching over to reagent>
@gamecubate: you probably want to attach your event listeners through react/reagent by providing an :onClick
property (might be :on-click
in Reagent). If you do it that way you will already have the :name
property in scope.
Understood but I want the handling to be done by a third-party, a mediator, who knows whether or not component clicks should be processed or, depending on some app-state property, ignored.
I have a quick noob question. I think it's a boot-reload question but I'm not 100% sure so I'll post here, please let me know if there's a better channel for it. I'm using boot on this small project and I have several modules, let's say I have core.cljs which imports module A which imports module B (core <- A <- B.) I make a change in B and only that module gets reloaded, but I want the reloading to "bubble up" through the modules up to core.cljs, is that possible? I want this because core.cljs has a "renderer" that needs to be reload in order for me to view the changes made in any of its submodules.
@volrath: Yes, unfortunately you currently need to use on-jsload
to call the renderer, because boot-reload doesn't use dependency graph to reload dependent namespaces
hey @dnolen ! @ericfode I havenāt tried cljs.spec yet. Do you mind filing an issue on doo so that I update to the latest cljs version and make sure it properly works?