Fork me on GitHub
#shadow-cljs
<
2021-07-18
>
kennytilton10:07:03

Looking in shadow-cljs.edn here https://github.com/PEZ/rn-rf-shadow we see the comment: "; In a real app consider using deps.edn instead." Is there something we should know, @pez? Some deficit in shadow-cljs? Performance, build quality, app size? Thx! 🙏

pez10:07:25

Iirc, that comment originates from @U05224H0W

pez11:07:49

I don't think it is either of those reasons, though. Rather functionality. deps.edn is a purpose built dependency management tool. Shadow can take care of some of that for you, but I think it is a non-goal to make that pay full featured.

pez11:07:56

It's easy enough to just move it out to deps.edn if you outgrow what shadow offers.

thheller13:07:00

that comment definitely did not come from me 😛

thheller13:07:56

if you ever need git dependencies or the :local/root stuff then it makes sense to use deps.edn

thheller14:07:47

otherwise they are pretty similar. you definitely don't gain any performance, build quality or app size advantages from using deps.edn. none of the is affected by which tool you use to build the classpath

pez15:07:21

Note to self: I should remove that file.

kennytilton15:07:26

:rolling_on_the_floor_laughing: I definitely checked if that comment was from you or @U05224H0W!

Drew Verlee16:07:15

greetings, i'm asking this question the problem with the library might be understood best through the differences between shadow and figwheel. the expression (shadow.cljs.devtools.api/compile :docs {:verbose true) with the shadow build :modules {:main {:entries [doc] and that entrie/ns being

(ns docs
  (:require [ :as app]
            ;; must require dynadoc.core so dynadoc's frontend can be built
            dynadoc.core
            [rum.core :as rum])
  (:require-macros [dynadoc.example :refer [defexample]]))
Return's the error The required namespace "cljsjs.rangy-core" is not available, it was required by "paren_soup/core.cljs". If i look at the namespace paren_soup/core.cljs it does require it right here https://github.com/oakes/paren-soup/blob/15f55ebb40ee30f75ca960d381ddebd094a76f3d/src/paren_soup/core.cljs#L6 but i'm unsure why it would "not available". Any advice on how to troubleshoot this would be appreciated. Things to i have noticed: • the author's minimal example of how to use the overall functionality used figwheel here: https://github.com/oakes/dynadoc-examples/tree/master/basic-deps-cljs uses fighwheel with compiler optimizations set to :simple, which i have also enabled. • if i remove the require on the dynadoc.core library in the cljs ns (e.g https://github.com/oakes/dynadoc-examples/blob/b23ef1003365d238847d1f1ea3f6d73149ae0bac/basic-deps-cljs/src/basic_deps_cljs/docs.cljs#L4) then it will compile, but the examples don't properly eval (e.g (defexample conj (conj [] 1)) doest show the expression result [1]. So i assume the comment on the code for the dyadoc.core require is still relevent. "must require dynadoc.core so dynadocs frontend can be built". My intuition is that maybe shadow is pruning out cljsjs.rangy-core because it's never directly used? but overall, I'm really unsure where to look.

👍 3
thheller17:07:50

short version: shadow-cljs does not support CLJSJS packages so it won't work with anything using those

zendevil.eth19:07:49

I’m seeing a dependency shadow watch says wasn’t installed:

[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
The required JS dependency "querystring" is not available, it was required by "node_modules/url/url.js".
even after installing with npm

Drew Verlee23:07:30

@U01F1TM2FD5 i'm not sure, but this looks very similar to my problem in essence. It's possible the issue is because shadow-cljs does not support CLJSJS packages so it won't work with anything using those. but usually its  pretty easy fix https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs You can read about it here: https://code.thheller.com/blog/shadow-cljs/2017/09/15/js-dependencies-the-problem.html I'm not sure that's the heart of the issue but worth checking

thheller05:07:50

@U0DJ4T5U1 this is a npm package, not a CLJSJS package

thheller05:07:08

@U01F1TM2FD5 you need to have shadow-cljs installed in the project, so npm install shadow-cljs

thheller05:07:05

that'll install the node-libs-browser polyfills package which polyfills node built-in packages for the browser