Fork me on GitHub
Alan Douglass12:11:57

hi, I'm trying to make a reagent GUI for editing a particular xml file. I've tried and tubax for parsing/writing xml but I'm having trouble either way - has anyone worked on reading/writing xml to edn in clojurescript?

Alan Douglass12:11:16

tubax only does the parsing, but I want to write too 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:

Alan Douglass13:11:33

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

Roman Liutikov15:11:23

@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

Roman Liutikov15:11:46

(js/React.createElement "div" propsset)

Roman Liutikov15:11:40

if you also want to merge existing props object with the one provided by a library use js/Object.assign

Roman Liutikov15:11:55

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

Roman Liutikov15:11:38

@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

Roman Liutikov15:11:49

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)


has anyone used figwheel with lumo?


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


I may just end up using ragtime afterall 🙂


anyone familar with clojure macros being flakey?


100% sure I'm defining them correctly, I've done cljs for a while


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


Post the macro


@vemv I’ve seen alot more of these lately myself and have the same solution


(proprietary source sorry)


@vemv I think it’s some relationship between cider and figwheel that’s not quite as sturdy as it used to be


or do you get these if you launch figwheel from a terminal as well?


I think I exclusively get these when launching from emacs, good call


I could science it later


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.


@vemv Thanks. No failure there.


just in case, this is the kind of verbose output I had in mind:


(note the WARNING in the middle)


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)


babylon and something else


Ah. misspelled pseudo. Yup. It's fs.readFile. Now to figure out my externs.


When I compiled using lein cljsbuild, the misspelling was reported. Running through lein doo did not 😕


And it was a misspelling in my externs file 😕 Looks like I need a spell checker.


Thanks @mfikes and @vemv for the suggestions that pushed me in the right direction.


hi, 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.writes 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.


I do look at the build with :optimizations :advanced


it seems that the only way to render js in server side


hmm :advanced builds don’t usually document.write?


re-frame template, and it does have document.write


must be some library code thats doing that


Is there a way to catch swipe gestures in CLJS?


@sova whatever you would do in JS will work (browser gesture APIs etc.)


@dnolen ah, thank you. I've not tried to catch swipe gestures in js til now. :study time: