Fork me on GitHub
#shadow-cljs
<
2021-04-12
>
Valentín00:04:53

I'm asking this question here, because my app built is controlled by shadow-cljs

Azzurite01:04:31

by this logic, you can ask any question you want... your question really has nothing to do with shadow-cljs, shadow-cljs just creates some javascript files for you, what you do with those js files is completely your problem you should ask this in a general or beginner channel or somewhere that has to do with heroku

Valentín01:04:59

I took your recommendation

Azzurite11:04:53

❤️ 👍

grounded_sage15:04:54

Has anyone got a repl workflow working with developing chrome extensions?

thheller15:04:57

depends on which "target" you are talking about? there are many different runtimes when it comes to extensions, background scripts, page injects, page actions etc

grounded_sage19:04:02

Yea I am still wrapping my head around it all. I’ll poke around a bit more and report back when I can more clearly express what I am looking for. I was basically wondering if there was any off the shelf demo repo’s that hooked up a repl for the extension runtimes where it works etc

pinkfrog15:04:35

Which is more standard, put :dev-tools section under build-id, or put :dev-tools under :dev (which itself is under build-id) ?

thheller15:04:42

don't need to put devtools in dev, that is implicit and will not apply to release builds anyways

pinkfrog15:04:34

But putting dev-tools under dev seems to make it more structured.

thheller15:04:05

you can put it there if you want, just don't need to

thheller15:04:39

I think its better directly in the build but YMMV

denik17:04:06

[:app] Build failure:
The required namespace "goog.result" is not available, it was required by "shadow/xhr.cljs".

denik17:04:30

anyone know how to fix this?

thheller17:04:28

not use shadow.xhr? 😛 goog.result was removed from closure-library with no replacement. where do you get this?

denik17:04:06

@thheller initial build

ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
Warning: Nashorn engine is planned to be removed from a future JDK release
NPM dependency "@js-joda/core" has installed version "1.12.0"
"3.2.0" was required by jar:file:/Users/den/.m2/repository/cljs/java-time/cljs.java-time/0.1.18/cljs.java-time-0.1.18.jar!/deps.cljs
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.11.18 running at 
shadow-cljs - nREPL server started on port 8877
shadow-cljs - watching build :app
[:app] Configuring build.
-> build target: :browser stage: :configure
<- build target: :browser stage: :configure (4 ms)
[:app] Compiling ...
-> Resolving Module: :main
[:app] Build failure:
The required namespace "goog.result" is not available, it was required by "shadow/xhr.cljs".

denik17:04:05

and not using shadow/xhr.cljs as far as I know (maybe libraries do)

thheller17:04:07

looks like you are trying to use an older shadow-cljs version with the new cljs release?

thheller17:04:27

need to bump shadow-cljs if you want to use cljs 1.10.844, which will also fix this problem

denik17:04:34

I think I’m on the newest version

✨  Done in 0.35s.
➜  z1 git:(simple) ✗ yarn global add shadow-cljs
yarn global v1.22.5
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "[email protected]" with binaries:
      - shadow-cljs
✨  Done in 0.57s.

denik17:04:54

that said, looks like shadow-cljs does not print its version at the beginning of the build process

thheller17:04:55

shadow-cljs - server version: 2.11.18 you are not

👌 3
thheller17:04:13

probably using deps.edn or project.clj and didn't update there?

thheller17:04:29

the yarn/npm install is just the command line, not the actual tool

denik17:04:22

ah yes, had an alias that overwrote it. vielen dank!

jeff tang18:04:47

Getting the error

The required JS dependency "@material-ui/core/SnackBar" is not available, it was required by "athens/views.cljs".
when building on Linux but not Mac

jeff tang18:04:11

Also not having a problem importing other core components like

["@material-ui/core/ExpansionPanel" :as ExpansionPanel]
    ["@material-ui/core/ExpansionPanelDetails" :as ExpansionPanelDetails]
    ["@material-ui/core/ExpansionPanelSummary" :as ExpansionPanelSummary]
    ["@material-ui/core/Slider" :as Slider]
    ["@material-ui/core/Switch" :as Switch]

jeff tang19:04:26

hmm, I think i figured it out. was importing SnackBar instead of Snackbar. interesting that this works on Mac but not Linux though!

thheller19:04:35

interesting, probably just case insensitive filesystem

👍 3
Michael Rispoli20:04:32

Is it possible to have the out directory be the same as the directory the cljs files is in? So instead of a dist directory just compile a js file right next to the cljs file and keep the directory structure as is?

Michael Rispoli21:04:32

My end goal here is to introduce clojurescript to an existing node codebase gradually by compiling similar to how rescript (formerly reasonml) recommends right alongside each file. I was thinking it might help with adoption / testing if we were able to gradually compile certain features in clojurescript etc

chrisn20:04:31

Can shadow-cljs's repl integration work if the index.html is dynamically generated server-side? I have a deps.edn-based project that I am playing with and we typically generate our home page server-side. I can get everything to work correctly aside from any cljs-repl functionality.

chrisn20:04:32

Trying this out with emacs/cider if that changes the answer.

chrisn20:04:51

Hot-reloading is working.

chrisn20:04:27

nm. Misread instructions. Everything works perfectly 🙂.

awb9923:04:08

hi thomas! Is it somehow possible to add a ring undertow websocket handler to the shadow-cljs dev server? We use sente for websockets in our app, and we tested sente with undertow, and this works. but somehow I seem not to be able to get it to work on the shadow http dev server.

thheller06:04:48

I do recommend using your own server if you do this. :dev-http is meant as a STATIC webserver and using a custom handler is not recommended

thheller06:04:07

that being said it does support websockets just fine, just probably not the ring variant or sente

awb9913:04:07

sente works with undertow.

awb9913:04:10

I tested it

awb9913:04:39

but it seems the websockets of undertow ring handler are different than the ones used in shadow cljs