Fork me on GitHub

probably OK to ignore. there haven’t been any breaking changes between 16.9 and 16.12


Is it possible to conditionally require a different namespace based on a goog-define variable?


I see but that's for .cljc files and I want to use this from a .cljs file (stub out a mixpanel dependency in dev)


I've just added a scoped JS dep with yarn, but Shadow doesn't appear to find its dependencies. I guess because yarn installs them in node_modules/@my-scope/my-package/node_modules? Anyone have any suggestions on how I could get these deps seen by shadow, aside from adding them all explicitly to my project's package.json?


@orestis conditional requires are not supported. you can however change what JS dependencies resolve to.


so :js-options {:resolve {"mixpanel" false}} would cause (:require ["mixpanel"]) to not do anything


@mel.collins yarn should not be installing the dependencies into a nested node_modules dir? it usually only does this in cases on version conflicts which you'll need to resolve


Aha gotcha, thanks. Got it in the main node_modules after fixing diverged react versions. What confused me was that the package it was complaining about wasn't depended on by anything else, and only existed in the one (nested) node_modules. But it seems that if any of the package's deps conflict, all of its deps go in the nested folder.


could be .. don't know how yarn/npm handle this these days


Okay, so I got my dep installed properly, but my next stumbling block is that when my ns requires ["@my-scope/my-package/feature" :as my-feature] it works perfectly when accessing the page of my :npm-module build, but in the test (`:target :karma`) build I get: "The required JS dependency "@my-scope/my-package/feature" is not available ...". Not sure what I could be missing. 😕


when using :npm-module you are likely using webpack or something as the final bundler that'll provide the JS


for karma shadow-cljs will try to build it


so if you have custom webpack config for the package that won't apply


or if the package is written in typescript shadow-cljs won't recognize it


could be affected by many things ...


Hmm, we do use webpack, but it looks like the released (npm) package works fine, just not the yarn linked version. I guess something, somewhere, isn't getting correctly pointed to the package's dist/ subdir to find the compiled (yup, from TypeScript) JS files.


I'll pick this up again on Monday, with hopefully clearer eyes


hey guys quick question is it possible to generate a test report xml-file that is compatible with circleci when the target for the test is :node-test ?


not built-in no. you could make your own runner that generates it though.