Fork me on GitHub
#shadow-cljs
<
2022-10-13
>
borkdude09:10:52

Upgrading shadow makes my advanced #C029PTWD3HR build fail: https://app.circleci.com/pipelines/github/babashka/nbb/927/workflows/6eea853f-8a23-42ef-a52f-1a7674332379/jobs/833 Are there any known issues around this?

borkdude09:10:10

It seems to fail around here:

test/nbb/main_test.cljs
3:   ["module" :refer [createRequire]]
31:(reset! nbb/ctx {:require (createRequire (path/resolve "script.cljs"))})

borkdude09:10:25

2.19.4 still works. I'm going to bisect

borkdude09:10:51

2.19.6 worked

thheller16:10:59

uhm I can't quite tell how the nbb_tests.js is generated?

thheller20:10:12

should be fixed in 2.20.4

borkdude20:10:52

thank you, going to try now

borkdude20:10:13

Confirmed, thanks again

James Pratt11:10:48

I wanted to get a clojurescript library that is set up to work with legacy figwheel and cljsjs to work with shadow-cljs but am running into an issue since the requires in the library are assuming the use of cljsjs:

(ns  aerial.hanami.core
  (:require
   [cljs.core.async
    :as async
    :refer (<! >! put! chan)
    :refer-macros [go go-loop]]

   [clojure.string :as cljstr]

   [com.rpl.specter :as sp]

   [aerial.hanasu.client :as cli]
   [aerial.hanasu.common :as com]

   [aerial.hanami.md2hiccup :as m2h]
   [aerial.hanami.common :as hc]
   [aerial.hanami.templates :as ht]

   ;; Vega & Vega-Lite
   [cljsjs.vega]
   [cljsjs.vega-lite]
   [cljsjs.vega-embed]
   [cljsjs.vega-tooltip] .....
I was wondering is there some recommended way to have the library require the code from the npm dependency instead if it is present? So the last few requires would change to:
[vega]
   [vega-lite]
   [vega-embed]
   [vega-tooltip]
I tried changing everything over to use cljsjs, because I presumed that cljsjs dependencies still work with shadow-cljs: https://github.com/jointprob/hanami-shadow-cljs/commit/ddf3bfe3aa99992ea8305f8a3d8100c2d89a74c0 But now get an error about react-dom being missing thought it is included as as cljsjs dependency: [:hanami] Build failure: The required namespace "react-dom" is not available, it was required by "reagent/dom.cljs".

James Pratt11:10:43

If I fetch the dependencies using both cljsjs and npm: https://github.com/jointprob/hanami-shadow-cljs/commit/c85482079cb596d803531773295f0f04fb7d8244 Then I get the error: react-dom.development.js:22840 Uncaught ReferenceError: vegaLite is not defined Which is getting called from here: https://github.com/jsa-aerial/hanami/blob/master/src/cljs/aerial/hanami/core.cljs#L379

thheller20:10:50

shadow-cljs does not support legacy cljsjs dependencies

thheller20:10:17

for modern cljsjs libs this is not necessary since they also map to their npm counterparts properly