This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-08
Channels
- # admin-announcements (22)
- # beginners (28)
- # boot (8)
- # cider (9)
- # cljs-dev (1)
- # cljs-site (3)
- # cljsjs (6)
- # cljsrn (6)
- # clojure (20)
- # clojure-germany (3)
- # clojure-russia (16)
- # clojure-uk (6)
- # clojurescript (106)
- # datascript (9)
- # datomic (19)
- # devcards (4)
- # dirac (42)
- # docker (4)
- # emacs (3)
- # hoplon (89)
- # jobs-rus (1)
- # keechma (6)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (11)
- # off-topic (1)
- # om (1)
- # om-next (1)
- # onyx (19)
- # other-languages (37)
- # parinfer (1)
- # proton (1)
- # reagent (9)
- # rethinkdb (17)
- # rum (2)
While I have the mic... :repl-options {:init-ns foo.bar}
seems to be ignored by Figwheel, and I haven't yet found an alternative. Any suggestions?
Yeah, I see what you're saying. Maybe add-watch
would work better? I know that Figwheel should report the error lines where they appear. Or you could try Vivaldi, it's pretty nice
I would def like to know if someone has managed to get the console traces/line numbers work with source maps
Well, it seems to work in Chrome.
But if you mean "in other browsers besides Chrome" then yes, I too would love to know if someone has managed to get this to work, haha.
has anyone here tried to do a port of react-router? or accomplished something similar?
https://github.com/ghedamat/reagent-react-router procede with caution, it hasn’t been updated in a year
yea I saw that but he just wrapped react-router
I was looking for a native version to fork perhaps 😕
I may just use secretary and accountant and add a component wrapper around them
might be easiest way to go
you might wanna look into the non react specific solutions: https://github.com/juxt/bidi
they have a comparison chart where they show the different available routing solutions
yea I just need client only
i think that it might be worth making your own and just wrapping the html 5 history api
I have a ref impl its just not great lol
I basically just stole helpers from secretary and accountant
and then wrapped them in reagent components
hmm, I have been working on something. maybe I will try to make it more generalized and release it as a standalone package
but I might just use the libs directly instead
i honestly really like react router and wish we had something similar to that on cljs, and none of our existing solutions use its approach
which is I am starting from scratch as opposed to using something else
I like the declarative nature of react-router and its just a container component
instead of using async dispatching to trigger a state change
just for routing specfically
like most re-frame projs
I dislike the routing pattern used in the templates
for me another thing is on transition hooks. I would really like to be able to create a transition as a new page comes in. similar to how ios/android does
so if I have a master > detail view, I can have the detail slide in from the right
and if I want a new item I can have it slide up from the bottom or something
interesting
like a dialog transition with a hash route or something
yeah, still haven’t figured out how to make it work well. especially if you want it to remain declarative
well you need to pass in props and query strings
so youd just have to have ?dialog=true then inside the parent component it would need to trigger the state change on component-will-receive-props
id assume
for the dialog component which would need to be controlled externally
interesting...I think ill add that to my ref impl
nice! if you finish it you should toss up a link on here, im sure people would be interested to see how it worked for you
will do of course..just started working on it past 2 hrs or so 😛
When compiling to node.js I want to set js/document
as (set! js/document (js/require "libxml-dom/lib/document.js"))
, but closure compiler doesn’t allow me, cuz document
is defined as constant in externs file. I’ve tried :closure-warnings {:externs-validation :off}}
, but didn’t help.
This is error:
ERROR: JSC_CONSTANT_REASSIGNED_VALUE_ERROR. constant document assigned a value more than once.
Original definition at externs.zip//browser/window.js:47
Is there workaround for this?@ivanreese: Vivaldi uses Chrome Dev Tools and Chrome Extensions. It works there.
I’m having some trouble debugging a Clojurescript RTE that occurs when loading the bluebird.js code at the top of my target js file, before it hits any of my app code. It and only happens when I set :optimizations :advanced
, and interestingly if I set the compiler option :pseudo-names true
the code works fine. Does anyone know what that might mean or what else I could try to hone in on the error?
@lsnape: Try :output-wrapper
. It could be that minified names in adv optimized code and the library clash.
@juhoteperi: thanks. That’s likely to be the cause, trying now..
also found a related discussion in this channel’s history: http://clojurians-log.mantike.pro/clojurescript/2015-10-12.html
@juhoteperi: that was it. Thanks for your help :thumbsup:
Surprised that these naming collisions aren’t more common. Perhaps they are and I just haven’t come across it before
I think library code is often wrapped in a closure which prevents clashes.
Hi guys
Alas, I have to give up on ClojureScript modules. I can't get them to work at all. Even a simple split (one unused namespace in one module and everything else in the default :cljs-base
module) produces cljs-base
that loads with errors (undefined symbols). Perhaps some day…
i have defined some global atom at clj file which i need to use inside cljs file, how can i achieve this?, i have read about reader conditionals which expect files cljc, but still don't know how can i do this inside cljs
@abdullahibra: make a single cljc file instead of clj+cljs. Then use #?(:cljs (cljs-form-here) :clj (clj-form-here))
.
@jrychter: and what next should i do with this cljc?
suppose i want to view the content of the atom from clj into html tag at cljs
@abdullahibra: ah, that depends on what you use for compilation. In my case (leiningen+cljsbuild), I add src/cljc
to my :source-paths
, place the cljc there, and everything else happens automatically.
@abdullahibra: actually, you add the path twice: to :source-paths
of the main project structure and to :source-paths
in :cljsbuild :builds :your-build-name
map.
@jrychter: thanks, i'll try it
@abdullahibra: good luck!
i'm trying to get value from redis using carmine and attach it to cljs, but i got undefined, (def foo #?(:clj (wcar* (car/get "foo")))) (defn foo [] (js/console.log foo)) (foo) i have required carmine using #?(:clj (:require [....])) in ns
is there something i miss for this?
@jrychter: still around?
previous code i placed at cljc file
there is a point i can't understand about interaction between clojure and clojurescript in project, can anyone help me to get it?
i got it, i can interact with the clj "server" using Ajax, or maybe i'll try :crossovers, or directly eval clojure code
@abdullahibra: no :crossovers are no longer needed see Reader Conditionals http://clojure.org/guides/reader_conditionals
these also came through on the Cognicast Episode 100 … on the other hand I want to be sure to pick features that are accessible (for some value of that term!)
to new to Clojure/Script programmers ...
I have seen core.async referenced on quora but am not so sure that’s yet considered a sufficiently core / default feature (but am open to persuasion!)
these are also things that the JS community is pushing but that are far from defaults on the platform (except LISP of course!)
I mean they are not pushing LISP 😉
All essentially modelled around simplicity: LISP for its consistently simple syntax, Immutability for consistent data handling and laziness for the ability to have powerful yet high performance abstractions
Hey guys, I'm using re-com (https://github.com/Day8/re-com) which has a couple of css files and images that need to be included as dependencies. Is there a relatively easy way I could load them from index.html without copying them into my resources/public folder to avoid committing dependency files to VCS. Essentially accessing, re-coms resources/public folder in my dependency tree somewhere.
Seems like if they are already compiled and are assets you would want them in version control
I assuming the problem you are trying to solve is...if I update re-com how can I ensure I have the correct assets
that is the main issue yes, I do see your point about committing however generally third party css I would handle using a package manager.
well there isnt a package manager that pulls it from the jar if it exists in there
its not a big deal to commit the files for sure, more about understanding the dependency system better seeing what can be done
you could write a script to do it
I suppose
Ive never tried personally
I guess I do see a good use case related back to how node_modules work
I mean I have my own component lib with its own assets
and it is a pain to always bring in the new css manually
I mean a 10 minute pain..but a pain nonetheless
yeah its relatively minor, and easy to document in this case since its only a few files. I could see it getting confusing across a team on a larger codebase with many different css dependencies
thanks though for chiming in, I'll keep digging around any maybe script it as part of the build process
cool yea now that you brought it up I may in fact look into that myself 😛
In general .@raymcdermott that's a no
Fair enough
Hi guys
if i have multiple of this <a href="#" id="foo"> <img src="..." id="bar"></img></a> and i h
have create an listen even when click the link image and i want to get the src attr of the image clicked, all links and images have same id
i tried (-> (js/$ this) (.find "img") (.att "src")) i got undefined
can anybody help in this?
@raymcdermott: I was going to comment earlier but I got sidetracked. Here's my anecdotal 2¢ — what drew me to CLJS from JS was, largely, the talks given by the various members of the CLJ community. There were so many interesting ideas to chew on... I guess it sort of nerd-sniped me into learning the language. So if I had to pick the #1 quality of CLJS that attracted me, it would be the quality of thought and emphasis on design and consideration, both in the language itself and in the way people use it to build software. Beyond that.... I jump back and forth between CLJS and JS a lot these days, and when I'm in JS the main thing I miss is the uniformity of the CLJS data structures and the functions that act on them. It kills me a little bit every time I need to merge two object hashes in JS, or want to use something resembling a set.
If I had to pick my 3 tentpoles, they'd be: 1) It's a thoroughly well-designed language — none of this "10 days", none of this "let's add promises, and generators, and async/await" or "let's add yet another kind of function with its own syntax" 2) The data structures — sure they're persistent, and that's a cool thing to learn about if it's a new concept to you.. but they are also consistent, and many of the functions you'd use on any one will work on all the others (thanks, seq abstraction!) 3) For me, the LISP syntax.