Fork me on GitHub

Must the :output-dir cljs compiler option’s value be the path of :output-to? I’d like my :output-to to be resources/public/.../prod.js, but I don’t want the cljs / JS files from :output-dir in resources b/c they’d get copied to the JAR w/ lein uberjar, which they don’t need to.


Is there any difference b/t putting a dep in the :provided profile vs putting :scope "provided" in the dep vector in the regular dep? Same for test.


Hi, i'm trying to get [re-com/single-dropdown...] work with some z-index lower than a div to its left. I want that when single-dropdown is scrolled to left of that div, it would get under the div. Having a div with a positive z-index, greater than the positive index of re-com's single-dropdown does not work (it still gets shown over the div). Setting the single-dropdown to negative z-index works, but then it becomes not clickeable.


How would I get a unique identifier for an "object" in ClojureScript? Is there some function which gives me a "pointer" that I can then use as a unique representation of the object? I don't need to be able to map back from the identifier to the object, but just be able to check whether the objects in a list (or their order) have changed. (This is for Reagent's :key property.)


@urzds goog/getUid


Hiya. Wondering if it'd be advisable to code an om.core/build wrapper which does a try/catch. The effect would be similar to React 16 error boundaries


(we stick to R15 for now)


also, an existing library / code could be inspiring. At its core the idea seems simple, but maybe there's some gotcha?


@burke: I assume hash is not as slow as it sounds?


@urzds Depends on your types. What are your objects?


Note hash will eventually fallback to goog/getUid


Anyone know if boot-cljs-test should print amount of tests when using node as backend? Fancy examples are showing numbers but my environment is not.


I have minor fears that it is not testing anything at all. Did that earlier with async code.


I loaded up my app under the re-natal for the first time this weekend, and some of my macros failed to expand. the same code works fine under lein + figwheel + browser. are there any known differences related to macro expansion between those environments? I'm on 1.9.946 in both cases


I am mostly doing macro things that used to not work in clojurescript like using plain require to include the macros


@jikuja you might be able to add some side-effecting lines to a test (print to console) just to make sure the tests are running, that would eliminate some possibilities. if the printer won't work, a long-running loop can at least verify the running part


@rauh: Also, with (hash my-map), I would get the same value for different objects, if their content is the same, right? I.e. in (map hash [{:a 1} {:a 1}]) => (N N), for some number N? At least that's what testing this with planck suggests.


The proper way to do this IMO is to give the map a unqiue ID when you create it.


Following up on @gseyffert's question about resolving multi-specs in clojurescript -- we'd like to be able to take a multi-spec definition (as returned by (s/form), e.g., (cljs.spec.alpha/multi-spec some-ns/multi-method-name ::spec-name)), resolve its associated multimethod and call methods on that. The goal is to get all the underlying spec defs so we can call s/form on those. This can be done in regular Clojure via (methods (var-get (resolve namespaced-multimethod-symbol))). Something similar works in the cljs repl, but does not work from within compiled cljs code. Does anyone have any ideas as to how to do this correctly?


I am trying to write a browser extension to run on Firefox following the advice at I would like to use clojurescript, but would need to “export” the browser (FF) API for my clojurescript to compile…is this possible? Ideally I would like to have the browser API as a library JS file which I can reference to develop my UI as a standalone client app. Any ideas? Thx…


if you make an externs file describing the things you use from the browser api it should work


oh - that's just for compilation to work


@noisesmith OK thx…but how would I access the libs? They seem to be available only from within the FF environment, no?


@kingcode right so for interactive development you could use figwheel connected to firefox


for things like unit testing or running parts of the code in a standalone or another browser, you'd need to abstract the FF specific things and make them an optional implementation but you might not even need that if FF is your only target


the cljs compiler as I recall is happy to make output that refers to things that it can't find when compiling


it's just a runtime error if they are not present when you launch the actual js code


the cljs compiler (the canonical one at least) is a java program, it doesn't even run js


Indeed FF is my only target - I am experimenting now with a bookmarking app. Oh really? I didn’t realize cljs doesn’t need to have the extern libs to compile…cool, will look into it - Thank you!


it needs something called an "externs file" for advanced compilation


that is a lot like a .h file for c code - it describes the things you will use at runtime that are not in your code


for normal development, and regular compilation, you don't need the externs file


there are three standard optimizations settings - advanced, whitespace, and none - externs files are only needed for advanced


@noisesmith I am happy “blind-coding” then running the compiled JS inside the browser for starters. However it would be really cool to be able to use figwheel to live-code against the API: then I would need to export the browser API to a file/module somehow…


no - all you need is to run figwheel and then connect firefox to it for that to work


figwheel is incompatible with advanced optimization anyway


really? Just like a regular webapp?


right - unless firefox would refuse to load things using this api over a websocket


or otherwise rejects how figwheel does things...


@noisesmith Are you familiar with the extension dev setup?


if so, you would need to use cljs.jar or cljsbuild, and then point the browser at your js file


@kingcode only minimally, sorry


@noisesmith Thanks again for your advice! Much appreciated, will look into your suggestions 🙂


but anyway, the problem wouldn't be on the cljs side - it's happy to call js that it doesn't know about


or - more accurately - happy to create code that calls js that it can't prove works, haha