Fork me on GitHub

Howdy. I'm an ex-Lisper considering refactoring a javascript SPA into clojurescript but I'm having a heck of a time getting a working dev environment off the ground. Can anyone give me some insight into what's going on here?


`kz@XPS-15-9570:~/dev/git/fertile$ lein new reagent wtf +cider Generating fresh 'lein new' Reagent project. kz@XPS-15-9570:~/dev/git/fertile$ cd wtf kz@XPS-15-9570:~/dev/git/fertile/wtf$ ls env Procfile src LICENSE project.clj resources kz@XPS-15-9570:~/dev/git/fertile/wtf$ lein compile Warning: implicit middleware found: cider-nrepl.plugin/middleware Please declare all middleware in :middleware as implicit loading is deprecated. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval2158$fn__2159 to method WARNING: Please consider reporting this to the maintainers of mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval2158$fn__2159 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Warning: implicit middleware found: refactor-nrepl.plugin/middleware Please declare all middleware in :middleware as implicit loading is deprecated. Warning: implicit hook found: lein-environ.plugin/hooks Hooks are deprecated and will be removed in a future version.`


I tried the reagent-tutorial instead but now I'm getting the following error on build... 😬


Compiling "app.js" from ["src-cljs"]...
Compiling "app.js" failed.
java.lang.IllegalAccessException: class clojure.lang.Reflector cannot access class jdk.internal.loader.BuiltinClassLoader (in module java.base) because module java.base does not export jdk.internal.loader to unnamed module @3c07e830


ran clean here


I'm on mac though


Hey, I am little bit confused, I am using cljsbuild to deploy SPA and in my index.html where I am loading js there is path /js/compiled/app.js, but my question is does it client get updated js when I make deploy and he has app.js in cache? I always had to modify path into something like app.js?version=XXX but I did not found any resource where this issue were pointed out.


how do you determine what namespace to import when consuming libraries from npm? For instance i'm (trying to) use oauthjs. so yarn install oauthjs and then crank up shadow. How do i determine the import statement from that?


it will be something like: ["npm-package-name" ...]


the tricky bit is that, depending on how the NPM module is packaged, you might use: ["npm-package-name" :as some-alias] OR ["npm-package-name" :default some-alias] :default is a shadow-cljs thing that helps with packages that only export a default object/function/etc.


i was hoping i could stumble my way through it but i am chastised. I'll read those docs. thanks @lilactown

👍 5

based on the README for that NPM package, you’ll probably write:

;; docs say: `import {OAuth2, OAuth2Configuration, OAuth2GrantTypes} from 'oauthjs'`
 (:require ["oauthjs" :as oathjs]))

(oauthjs/Oauth2 ...)


but it can depend on how the package is actually provided, so you might have to futz a bit. if you get stuck, doing the above and logging what oauthjs looks like can help troubleshoot


interesting. i did yarn install oauthjs and when i (require '["oauthjs" :as oauth]) I'm told by shadow that not all of its deps were installed > The required JS dependency "querystring" is not available, it was required by "node_modules/oauthjs/dist/oauth2.js".


i'll start higher up in the docs 🙂


thanks for your help


that is strange.


I honestly haven’t tried dynamic require of an npm package before so I wonder if there’s a bug


do you see querystring in your node_modules?


I'll have to look when I get back home. Have to run an errand. Thanks for your help so far though


interesting. querystring just seems to not be seen by shadow? My package.json file only specifies "querystring": "^0.2.0", npm install brings querystring into node_modules. and then

(ns beta.main
  (:require ["querystring" :as qs]))
in the rpel
The required JS dependency "querystring" is not available, it was required by "beta/main.cljs".

Searched in:/home/dan/projects/clojure/beta/node_modules


try restarting your process?


otherwise I’d bring it up in #shadow-cljs


i'll do that. thanks


Hi All. Can anyone direct me to a current book or complete guide to mobile development with ClojureScript? 🙂


@michael401 Not aware of anything like that. I’d suggest the resources at for a React Native-centric approach.


@mfikes ok, thank you. I'll start there. I suspect everyone is too busy actually doing work to write books (and/or the landscape changes so quickly that it's not worth the effort to write a book that will be outdated when it goes to print).