Fork me on GitHub
#shadow-cljs
<
2020-09-14
>
tony.kay00:09:22

I can鈥檛 seem to get it to work

tony.kay00:09:28

for cljs namespaces, that is

jpmonettas10:09:24

hi everybody! is there a way to specify general :exclusions in shadow-cljs.edn like there is in lein?

thheller12:09:22

@jpmonettas exactly like in lein, :dependencies [[some-dep "version" :exclusions [foo]]

thheller12:09:10

that is not supported. what are you trying to exclude? I mean its rather uncommon to get an unwanted dep from multiple sources?

jpmonettas12:09:23

I'm working on a project where a bunch of our libraries depend on mount. For one of the projects that uses all those, I want to work with a fork of mount I made, so I want to exclude all mount dependencies everywhere since I want to provide the one to use. Does it make sense?

jpmonettas12:09:44

I'm in the process of migrating this project to shadow-cljs, and the current project is using that lein functionality

pithyless13:09:22

@jpmonettas are you using deps.edn? Because you can create an alias with :override-deps to point to your fork; and then pull in the deps via alias in shadow.

robert-stuttaford13:09:53

help 馃檪 how do i express this: import Select, { components } from 'react-select'; in this:

(ns yep
  (:require ["react-select" :default react-select]
            ["react-select/async" :default react-select-async]))
I also need to import Option from "react-select" somehow

jpmonettas13:09:14

@pithyless I don't think :override-deps works since they are different artifacts, not different versions, I'm including district0x/mount and want to exclude mount since the both contains the same namespaces

pithyless13:09:41

This would work if you reference the git repo:

{mount {:git/url "" :sha ...}}
(But you would need to add a deps.edn to your forked repo)

pithyless13:09:20

I wonder if you can specify an alternative mvn root... {:mvn/version "..." :mvn/artifact ...}

pithyless13:09:24

Looks like the groupId/artifactId stuff is hardcoded for :mvn; but that forked git repo would work.

jpmonettas14:09:45

yeah not sure what to do, I think I'll just add exclusions per dependency, but is kind of error prone, if I miss one then I'll have some hard to track bugs

jpmonettas14:09:36

thanks for your ideas !!

Mark Gerard14:09:44

Hiya, I am getting this error when I try to run my tests:

Resource: com/cognitect/transit.js:649:8
 variable module is undeclared
--------------------------------------------------------------------------------
nil
========= Running Tests =======================
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module 'xmlhttprequest'

Mark Gerard14:09:51

Any pointers on how to fix this?

thheller14:09:37

npm install xmlhttprequest? Guess you are using :node-test and a library that does a require("xmlhttprequest") somewhere?

Mark Gerard14:09:28

I am using shadow-cljs compile test. I added a dependency to use cljs-ajax

thheller14:09:36

so yeah npm install xmlhttprequest should fix it

thheller16:09:57

@robert-stuttaford see the translation table at https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages (:require ["react-select" :as react-select :default Select :refer (Option)]) or so