Fork me on GitHub
#shadow-cljs
<
2019-04-30
>
talgiat00:04:11

yeah why it installs in the first place?

talgiat00:04:28

also it installs an older version of hightlight.js

talgiat00:04:56

I thought that if the package is installed it should not complain

thheller07:04:39

@talgiat there seems to be a misunderstanding here? it installs exactly the versions that it should https://github.com/Day8/re-frame-10x/blob/master/src/deps.cljs

thheller07:04:57

it does NOT install the dependencies you already had listed

thheller07:04:08

it only complains ...

thheller07:04:32

I can remove the warnings since I guess they are annoying but everything is working as intended here

thheller07:04:56

if you have any different behaviour and see an actual running: npm install --save [email protected] [email protected] [email protected] + react etc then that is a bug

sundbp13:04:29

It seems if I put proxy info in the HOME/.shadow-cljs/config.edn file it isn't picked up. Does that seem plausible? Same info in the shadow-cljs.edn file and all is ok

sundbp14:04:20

@thheller are the proxy settings supposed to be read from that file?

sundbp14:04:41

Ah. Needed to be under :maven, found it by searching source.

Heikki Hämäläinen14:04:45

Does any one know a working example for minimal AWS Clojurescript shadowcljs Lambda which makes https requests? I have unfortunately problems to get different http clients to work when deploying lambdas. I have tried cljs-https where I am getting “errorMessage”: “Cannot find module ‘xmlhttprequest’” when running in AWS. Running local Node works just fine. Also aws-sdk works quite well. The problems start in AWS after adding cljs-http client. If anyone is interested to help me, I have pushed minimal cljs-app to github which contains the code which I have tried. https://github.com/hjhamala/shadow-cljs-lambda-test/blob/master/create-job/src/core.cljs

thheller15:04:02

@heikki.hamalainen what is the problem? I don't have any of the serverless stuff installed so I can't run your example. maybe I can help if you tell me the errors?

thheller15:04:42

“errorMessage”: “Cannot find module ‘xmlhttprequest’” did you try npm install xmlhttprequest?

thheller15:04:19

"Cannot find module 'xhr2'" this is the message node gives if node_modules/xhr2 doesn't exist

thheller15:04:26

same for xmlhttprequest

Heikki Hämäläinen15:04:59

@thheller You are a life saver 🙂 Now I understand. shadow-cljs release app does not add node_modules to target directory. I just zipped the target and didn understand the need to add node_modules also. AWS-SDK is most likely included in Lambda runtime so it worked without it. I am beginner in clojurescript so I assumed that target contains full software package like lein uberjar.

thheller15:04:16

there is currently experimental support for creating completely standalone .js files but that wouldn't work with cljs-http since it does a "dynamic" (js/require "xmlhttprequest") which this wouldn't cover

thheller15:04:12

but just including node_modules is the more reliable option for now

Heikki Hämäläinen15:04:51

Ok, thank for your quick response. Problem solved and development can continue 🙂

talgiat21:04:34

@thheller adding highlight.js fixed that. I think the warning printing is a bit confusing, so removing it will be nice

damien21:04:55

Hi all, quick question wrt shadow-cljs on React Native. I understand how JS interop works via npm from the docs, but is there also anything that would prevent me from using Reagent's :> syntax for importing and wrapping existing React components? Our UI team has a nice set of elements that I would like to reuse.

thheller21:04:09

@damienstanton you can use them just fine there is just one issue currently in that importing them might be tricky

thheller21:04:54

depends on how the components are written. plain JS would be easy, JSX/flow/ts etc make things harder

damien21:04:33

Sounds good then - they are plain JS, with no external jsx templates or cross-compilation with TS/etc.

thheller21:04:36

things are really easy if you just put the JS modules into node_modules though

thheller21:04:03

since then metro can deal with the importing and you aren't limited by what shadow-cljs may not support

damien21:04:13

perfect, I think this is exactly what I need. Thanks @thheller!

caleb.macdonaldblack23:04:51

Hi I'm having issues getting karma to detect additional tests. With my current configuration I have shadow watching and karma running. If I change or delete tests, they're detected by karma and it logs them fine. However when I add a new test karma does not detect or log the new test. I have to delete .shadow-cljs to get it to detect it. Here is a bare bones repo of my configuration where I can replicate the issue on my machine: https://github.com/CalebMacdonaldBlack/shadow-karma-example

caleb.macdonaldblack23:04:52

browser tests refresh fine, however I prefer karma because I don't need to use the browser console to see my log statements and I get nice diffs