Fork me on GitHub

hello is it possible to use npm modules from clojurescript and have autocomplete ?


like we have when we use clojure with java libraries (for example cursive does that for java but not for npm i think),is there some ide/plugin that does that?


Hi. This is a noob question but how can I compile CLJS to JS but ask the cli command to use options from my deps.edn file? The ClojureScript official documentation does not mention using deps.end in the compiler help doc and only gives examples of CLI commands where we have to provide all options inline?


one answer suggests using -co <path to deps.edn> so I'll try that in a bit.


deps.edn is not meant for this, you should create your own edn files


inline opts are fine in deps.edn, other build config is not


@chandru89new you can use tools-deps aliases for this, pretty standard practice - like a :repl alias a :release alias etc. and these gather up the :main-opts


we don't get into it in the docs because those are generic details about tools-deps


Thank you, David. I will explore this.


@takis_ Cursive does it for Google Closure libs - I don't see why it couldn't work for NPM deps too


The main problem is that the Closure code is written in a Java-y style that’s easy to statically analyse. I’ve made various attempts to do the same for random NPM libs and it’s much harder. I’m considering basing the analysis off TypeScript types, so users would just install the @types/react or whatever and get support from those.


thank you, it will be very nice to have this, autocomplete helps alot.


i am using MongoDB nodejs driver,and it shows them as un-resolved symbols and no autocomplete for now.


I have a public solidity contract variable: uint public bidEnd, and I’m getting its value using web3js like so:

83  (go                           
 84    (.call                           
 85     (.bidEnd                          
 86      (.-methods                
 87       (web3.eth.Contract. (:contract-json db)
 88                 (-> db :creation :creation/contract-address))))                    
 89     (clj->js {:from (->                     
 90              (<p!          
 91               (.request          
 92               (:ethereum db) (clj->js {:method "eth_request  Accounts"})))    
 93              (get 0))})
 94     (fn [err result]   
 95      (js/console.log "error- " err)   
 96      (js/console.log "result- " result))))
And it’s printing the following in the console:
err is  Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    at require.decodeParametersWith (index.js:299)
    at require.decodeParameters (index.js:286)
    at (index.js:471)
    at Method.outputFormatter (index.js:761)
    at Method.formatOutput (index.js:148)
    at sendTxCallback (index.js:524)
    at cb (util.js:703)
    at (browser.js:154)
    at drainQueue (browser.js:124)
What am I doing wrong and how to fix this?


since it’s a call function which doesn’t use gas, it’s weird that it’s asking if I ran out of gas. I’m not sure about the other reasons for the error that it lists


What are the inputs and what are the outputs supposed to look like?


Hi! How to express this syntax in reagent:

    root: classes.root, // class name, e.g. `classes-nesting-root-x`
    label: classes.label, // class name, e.g. `classes-nesting-label-x`
  classes nesting
What are these double curly braces? (taken from, is it just
[button {:classes {:root     (-> classes :root)
                   :label (-> classes :label)}]


@fbielejec the first tells JSX that the classes attribute expects an object (ie. not converted to a string). so your translation is correct assuming whatever wrapper you use translates that to a JS object

🙌 3

@ps looks like possibly a bad JS method invoke due to using .call ? Would you use .call from JS?