This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-01
Channels
- # beginners (121)
- # boot (12)
- # cider (14)
- # clara (19)
- # cljsjs (1)
- # clojure (124)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-russia (47)
- # clojure-spec (20)
- # clojure-uk (7)
- # clojurescript (102)
- # cursive (16)
- # datomic (10)
- # emacs (2)
- # events (2)
- # immutant (3)
- # luminus (5)
- # lumo (33)
- # off-topic (2)
- # om (5)
- # onyx (22)
- # parinfer (1)
- # pedestal (32)
- # protorepl (1)
- # re-frame (6)
- # reagent (2)
- # ring-swagger (2)
- # rum (1)
- # spacemacs (8)
- # specter (17)
- # yada (1)
@quentinpaden There’s good figwheel support for nodejs. https://github.com/bhauman/lein-figwheel/wiki/Node.js-development-with-figwheel
https://gist.github.com/hkjels/ba240c989da00e06e3d0e536fc27a176 I’m sorry to bring up such a broad question, but I haven’t been able to create a minimized failing example yet
the obvious part is the fact that it’s finite, but that’s not the issue I’m troubling with
hi, I need to generate URIs. I found https://github.com/cgore/gin which I think would work but I need a clojurescript version. anybody know of one?
thanks, I am using that, but I don’t see how to use it to generate e.g. random ipv6 addresses like “coap://[fe80::b1d6]:1111” - is that possible?
Also check out this code. Very similar + infinite: https://gist.github.com/rauhs/ac6349dd20f1799982a1906f9a59e7d6#file-dynamic-css-class-gen-clj-L196-L217
If you use Lumo, please consider sharing: https://twitter.com/anmonteiro90/status/859094963358793728
Hello there, would you recommend some beginner friendly video tutorials on Clojurescript. I've asked about them on the reddit and some guy suggested to ask you: https://www.reddit.com/r/Clojure/comments/68m6wq/any_good_video_tutorials_on_clojurescript/
No need to explain about s-expressions, immutability and so on. But I cannot even consistently start brepl
😄 and do not know why
What is the purpose of connectiong REPL to editor? Just for a convenience? Is it the same that just keep editor and terminal with running REPL separately?
Hello folks, so is anybody able to debug a node.js project with --inspect
and Chrome DevTools?
It shows the .js
files and says that source maps are there, but I don't see them in the file tree
also, the sources
key in the source map contains the file name only, not the path
@richiardiandrea did you install source-map-support
in your project?
uhm, let me see
the compiler will try to require it but fail silently if it’s not available
@richiardiandrea I think you need this: https://dev.clojure.org/jira/browse/CLJS-1902
oh ok, I am trying
trying source-map-support
first
ah, now I remember, node.js speaks about file-system paths when generating source-maps, but devtools understands only urls
and it is unclear how to map file-system paths to urls in a general way (depends on your web server configuration of course)
@richiardiandrea try this https://github.com/thheller/shadow-devtools/wiki/ClojureScript-for-node.js-scripts ... source maps and --inspect
work
@thheller thanks! that might be how we'd go about eventually...but it would be great to understand why it is not working ootb
so an example of generated sm is: {"version":3,"file":"\/Users\/user\/cqrs-engine-cljs\/out\/cqrs\/event_store.js","sources":["event_store.cljs"], ...
@thheller I don’t remember the details, but I think the problem was inside the .map file, it used full file-system path for the orig src file
yes exactly 😄
oh wow ok
ok so basically is either your patch or serving the maps from a web server for now right?
@darwin thanks! this should go on the main website I think
uhm that conclusion seems wrong? I don't have a web server or anything running and source maps work just fine?
maybe it doesn't like absolute paths but shadow-build generates source maps directly next to the sources and that works just fine
@thheller I guess it is a workaround waiting for the patch above to be in?
well, depends on options, maybe you are feeding cljs compiler with different defaults, try to reason about this code and let me know 😉 https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L1232-L1247
so demo/foo.cljs
will have a demo/foo.js
and a demo/foo.js.map
where foo.js
just links to //# sourceMappingURL=foo.js.map
so never any paths in that link
the problem is not //# sourceMappingURL=
the problem is inside the .map file, whoever generated it
yep confirming the problem is the actual map, not the comment linking to it
usually this should be a relative url, but in node.js case, it is full file-system path
the exact behaviour depends on cljs compiler options, :source-map-asset-path
is a way to control that
ok, maybe, but then something else didn’t click, devtools maybe expects the urls to be relative to server-root, but .map generator expects them to be generated.js relative or something like that
@thheller oh ok so in my case {"version":3, ..., "sources":["event_store.cljs"] <- this guy is the problem ...
yep confirmed, just changed my map to {"version":3,"file":"blubb/demo/script.js","sources":["script.cljs"],"lineCount":82 ...}
and it still works
ok cool so sources still need to be relativized I guess
@richiardiandrea not if event_store.cljs
and event_store.js
+ .map
are in the same directory
anyways, inlined source maps is the way how to avoid all these headaches. I’m out for now 🙂
yep they are
I think I need to read more on how they get resolved, to understand why this happens
thanks for your hints
thanks! ☝️
awesome the above is the easiest for sure
(clj->js {"a/b" 33})
throws #object[Error Error: No protocol method IAssociative.-assoc defined for type cljs.core/EmptyList: ()]
Anyone ever have an issue with passing atoms into a js/setTimeout loop? I think I've done it many times before. I'm getting strange behavior where after one iteration of a loop, the atom (or whatever object) I'm passing in is not derefable.
Uncaught Error: No protocol method IDeref.-deref defined for type undefined:
at Object.cljs$core$missing_protocol [as missing_protocol] (core.cljs:281)
at Object.cljs$core$_deref [as _deref] (core.cljs:586)
at cljs$core$deref (core.cljs:1364)
at filo_ex$core$update_loop_time (core.cljs?rel=1493679699810:160)
at core.cljs?rel=1493679699810:173
here's the function that is called within a js/setTimeout loop:
(defn update-loop-time [time-atom]
(let [old-time (:time @time-atom)
new-time (.getTime (js/Date.))
diff (apply str (take 4 (str (/ 1000 (- new-time old-time)))))]
(swap! time-atom assoc :time new-time)
(swap! time-atom assoc :text diff)))
not sure if that'd help any. I don't see any obvious issues there.It seems like my swap!
statement must be clobbering the atom, because I'm not mutating the atom anywhere else in the program. But the function looks fine afaict
My problem: how to use qualified keywords with a JSON API (clojurescript + golang)
My first try:
- let's rename backend "keywords". Now json was {"user/name": "souenzzo"}
.
- #(js->clj % :keywordize-keys true)
awesome: {:user/name "souenzzo}
- Now it's just generate JSON from EDN:
-> (clj->js {:user/name "souenzzo"})
=> {"name": "souenzzo"}
-> (with-redefs [name str] (clj->js {:user/name "souenzzo"}))
=> {":user/name": "souenzzo"}
(note extra :
)
Is that hard to make it? I'm missing something?
for folks, my problem with source maps was with node.js
6.10.2
. Everything works ootb with 7.9.0
probably something changed in node-inspect
(which got bundled as well)
Probably @darwin with this new version you don't need to use a webserver but I haven't tried Dirac yet