This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-20
Channels
- # beginners (17)
- # boot (19)
- # chestnut (1)
- # cider (25)
- # clara (1)
- # cljs-dev (15)
- # cljsrn (10)
- # clojars (9)
- # clojure (182)
- # clojure-brasil (27)
- # clojure-dusseldorf (2)
- # clojure-gamedev (5)
- # clojure-germany (1)
- # clojure-greece (2)
- # clojure-italy (18)
- # clojure-poland (5)
- # clojure-romania (3)
- # clojure-russia (29)
- # clojure-serbia (6)
- # clojure-spec (9)
- # clojure-uk (77)
- # clojure-ukraine (1)
- # clojurescript (61)
- # cursive (5)
- # datomic (20)
- # defnpodcast (1)
- # emacs (10)
- # fulcro (2)
- # graphql (2)
- # hoplon (11)
- # lumo (4)
- # off-topic (50)
- # om (3)
- # onyx (26)
- # other-languages (39)
- # parinfer (2)
- # pedestal (5)
- # re-frame (32)
- # reagent (48)
- # rum (7)
- # shadow-cljs (10)
- # spacemacs (29)
- # sql (10)
- # unrepl (58)
- # vim (3)
hi, I'm trying to make a reagent GUI for editing a particular xml file. I've tried clojure.data.xml and tubax for parsing/writing xml but I'm having trouble either way - has anyone worked on reading/writing xml to edn in clojurescript?
tubax only does the parsing, but I want to write too clojure.data.xml only has experimental clojurescript support, and gives the following cryptic error for a string "\n ": #object[Error Error: No protocol method IPrintWithWriter.-pr-writer defined for type string:
@ajdouglass I used it only for very rudimentary functions, so I can't really advise it, but maybe it'll help you: https://google.github.io/closure-library/api/goog.dom.xml.html
thanks! I'll check it out
is there an idiomatic way to translate the js ...
operator into clojurescript code? I’m using a react library that hands the lib consumer a set of props containing arbitrary key-value pairs, and their samples show them being consumed via ...propset
@olivermooney if you are referring to a JS object of React props that is being spreaded onto React component with JS’s spread operator, then just pass props as an object into that component
(js/React.createElement "div" propsset)
if you also want to merge existing props object with the one provided by a library use js/Object.assign
or goog.object/extend
@roman01la perfect thanks! - I am merging it with my own set first and was getting tied up between merging js & cljs maps
@olivermooney in that case you have to have both objects in same format (JS or cljs)
@roman01la yeah I’m using #js
on a shallow cljs map and I’ll use Object.assign
to combine the two
nice! that should work 🙂
@roman01la sweet success, cheers!
hey, does anyone have a recommendation for a sql migrations tool targeting clojurescript that works with node and mysql?
why does it have to be written in those languages?
I'd just use whatever you're familiar with - flywheel or something written in python or whatever
(sorry if that's not a helpful answer)
there's juxt/joplin @j0ni - but that's clj only - i don't know of anything for cljs
thanks @pesterhazy @mccraigmccraig I hadn't considered that it doesn't need to be in cljs, that's a good point
it's more of an issue of {cider, cljs, figwheel} having poor error handling in some specific point
^ that's what I see 1 in 10 times, with no other solution than restarting the whole jvm process
@vemv I think it’s some relationship between cider and figwheel that’s not quite as sturdy as it used to be
Yeah, I haven’t had the time to dig in yet myself. Don’t even know what to put in an issue yet
Under nodejs and :advanced compilation, I'm getting an error like #object[TypeError TypeError: wt.Fe is not a function]
. It's not happening under :simple or :none compilation. I suspect it's because of references to nodejs modules being compiled away (I'm using fs.readFile
). I have an externs file. What are ways to determine if the externs file is getting picked up during the compilation? I've purposefully misspelled it to see if that would cause an error, and sadly, I don't see one.
I can confirm that readFile
does not appear in the compiled file, so I'm pretty sure that's what's causing the issue.
> What are ways to determine if the externs file is getting picked up during the compilation?
@grzm in a given externs file, copy all the contents and paste them at the bottom
then compile with the most verbose logging level. you should see a SEVERE
goog error about the extern duplication
@grzm Try :pseudo-names
; it will still fail, but with a human-readable name that should facilitate zeroing in on the problematic symbol. https://clojurescript.org/reference/compiler-options#pseudo-names
If you are right in that it is indeed fs.readFile
, then yes, it will be down to figuring out why your extern is not being honored.
@mfikes Yeah, I already have :psuedo-names
and :pretty-print
set to true. At least running it through cljs.test, I'm not seeing that error. Let me try with just a normal *main-cli-fn*
@vemv By the way, if you are using a Clojure 1.9 beta, you can use ClojureScript 1.9.946 in order to avoid issues with NaN
(the bottom of your secreenshot)
@mfikes I know! but I'm scared of that update because in order to make it work, I had to npm install
a couple packages (otherwise I'd get certain stacktraces)
When I compiled using lein cljsbuild
, the misspelling was reported. Running through lein doo
did not 😕
hi, https://developers.google.com/speed/pagespeed/insights/ testing a re-frame o reagent project build here, I've noticed that an Eliminate render-blocking JavaScript
issue causes to loose many points. However if I try to fetch app.js
file using async
option in the script tag it complains because of document.write
s in app.js. Is there some good way to achieve this?
@tomaas don’t benchmark any :optmizations :none
build. always try to use :optimizations :advanced
before testing, those won’t have this problem.
Is there a way to catch swipe gestures in CLJS?
@dnolen ah, thank you. I've not tried to catch swipe gestures in js til now. :study time: