shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Azzurite 2021-04-12T01:08:31.081100Z

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Γ­n 2021-04-12T01:13:59.081300Z

I took your recommendation

Azzurite 2021-04-12T11:24:53.081900Z

❀️ πŸ‘

grounded_sage 2021-04-12T15:09:54.083500Z

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

thheller 2021-04-12T15:14:57.084500Z

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

2021-04-12T15:16:35.084900Z

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

thheller 2021-04-12T15:18:42.085500Z

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

2021-04-12T15:19:34.085900Z

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

thheller 2021-04-12T15:20:05.086100Z

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

thheller 2021-04-12T15:20:39.086300Z

I think its better directly in the build but YMMV

denik 2021-04-12T17:33:06.087Z

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

denik 2021-04-12T17:33:30.087600Z

anyone know how to fix this?

thheller 2021-04-12T17:38:28.088300Z

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

denik 2021-04-12T17:43:06.088800Z

@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 <http://localhost:3601>
shadow-cljs - server version: 2.11.18 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 8877
shadow-cljs - watching build :app
[:app] Configuring build.
-&gt; build target: :browser stage: :configure
&lt;- build target: :browser stage: :configure (4 ms)
[:app] Compiling ...
-&gt; Resolving Module: :main
[:app] Build failure:
The required namespace "goog.result" is not available, it was required by "shadow/xhr.cljs".

denik 2021-04-12T17:44:05.089900Z

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

thheller 2021-04-12T17:44:07.090Z

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

thheller 2021-04-12T17:44:27.090400Z

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

denik 2021-04-12T17:48:34.091100Z

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 "shadow-cljs@2.12.4" with binaries:
      - shadow-cljs
✨  Done in 0.57s.

denik 2021-04-12T17:48:54.091700Z

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

thheller 2021-04-12T17:48:55.091800Z

shadow-cljs - server version: 2.11.18 you are not

1πŸ‘Œ
thheller 2021-04-12T17:49:13.092200Z

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

thheller 2021-04-12T17:49:29.092500Z

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

denik 2021-04-12T17:51:22.093100Z

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

jeff tang 2021-04-12T18:41:47.093500Z

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 tang 2021-04-12T18:43:11.093600Z

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 tang 2021-04-12T19:01:26.093900Z

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

grounded_sage 2021-04-12T19:30:02.096Z

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

thheller 2021-04-12T19:33:35.096200Z

interesting, probably just case insensitive filesystem

1πŸ‘
Michael Rispoli 2021-04-12T20:41:32.097400Z

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?

chrisn 2021-04-12T20:48:31.099300Z

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.

chrisn 2021-04-12T20:49:32.099600Z

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

chrisn 2021-04-12T20:51:51.100100Z

Hot-reloading is working.

chrisn 2021-04-12T20:58:27.100400Z

nm. Misread instructions. Everything works perfectly πŸ™‚.

Michael Rispoli 2021-04-12T21:22:32.100500Z

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

awb99 2021-04-12T23:35:08.105100Z

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.

awb99 2021-04-13T13:10:07.114300Z

sente works with undertow.

awb99 2021-04-13T13:10:10.114500Z

I tested it

awb99 2021-04-13T13:11:01.114700Z

https://github.com/pink-gorilla/webly/tree/sente

awb99 2021-04-13T13:11:39.114900Z

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