This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-18
Channels
- # announcements (6)
- # babashka (16)
- # beginners (194)
- # calva (20)
- # cider (34)
- # clj-kondo (38)
- # clojure (89)
- # clojure-europe (10)
- # clojure-finland (15)
- # clojure-italy (2)
- # clojure-nl (15)
- # clojure-sg (7)
- # clojure-spec (15)
- # clojure-uk (86)
- # clojurebridge (1)
- # clojurescript (60)
- # community-development (11)
- # conjure (13)
- # core-async (48)
- # core-typed (3)
- # cursive (22)
- # datascript (8)
- # datomic (40)
- # duct (11)
- # emacs (3)
- # figwheel-main (22)
- # fulcro (45)
- # graphql (1)
- # helix (9)
- # hoplon (15)
- # hugsql (7)
- # jobs-discuss (47)
- # juxt (7)
- # kaocha (21)
- # luminus (1)
- # malli (13)
- # meander (2)
- # off-topic (52)
- # parinfer (19)
- # re-frame (66)
- # reagent (1)
- # reitit (3)
- # ring-swagger (1)
- # rum (2)
- # shadow-cljs (72)
- # spacemacs (5)
- # sql (4)
- # timbre (5)
- # tools-deps (15)
- # vim (5)
- # vrac (7)
Hello all, I´m thinking about how to deal with shadow-cljs
and server with pedestal
serving the index.html
? Is shadow detect server and let it serve index or do I have to use index just for shadow and other index for app? Do you have any reference to using both in the same project?
@fabrao shadow-cljs doesn't care how you serve your index.html. Just use your server like you would in production. Just load the .js
files via your pedestal server directly. They are just static files.
Hi is it possible to turn off hot reloading? Thought I read it could be turned off at the namespace level
Just ran a build report and noticed something peculiar:
| jar | re_frame/loggers.cljc | -717.0 B | -0.17 % | 2.9 KB | 2.2 KB |
Negative size, heh.Why are ESM useful?
@fabrao hot-reload and REPL are done over the websocket. it is handled separately and your server doesn't need to do anything
@p-himik yeah I saw that before. I'm just using source-maps and sometimes they aren't entirely accurate or I'm maybe counting backwards or something
@neo2551 if you cannot answer that its not useful to you basically. It is useful if you want to integrate with other tools, eg. interfacing with a codebase written in typescript or whatever.
it doesn't offer anything new and isn't useful if you don't care about interfacing with other code basically
It would allow me to expose my libraries to Ts/JS users?
Good, now I know my CLJS code will not be thrown away if anyone refactor my apps with JS xD
I have to admit that I am missing your blogpost. I always learned something knew when I read them :).
yeah I didn't make it very clear that this is mostly about intergrating into the greater JS ecosystem
After upgrading to the latest version of shadow-cljs and building a release build, I’m getting this error in the js console:
breadcrumbs.ts:117 shadow-cljs - failed to load 367
(anonymous) @ bundle.min.js:2
13:03:33.676 js.js:75 Uncaught TypeError: $jscomp.initSymbol is not a function
at Object.shadow$provide.<computed> (index.js:178)
at Object.shadow.js.jsRequire (js.js:66)
at Object.shadow.js.require (js.js:113)
at index.js:2
at append.js:2
I remember reading about something related to $jscomp
in one of the releases, so I figured this might be a known (familiar?) issue. Last version of shadow-cljs I built against was 2.8.90@steedman87 which version is this?
I’ll see what I can do. I also had trouble getting source maps working right in Sentry, although they seemed fine in the browser. In Sentry the stack trace seemed to consist of unrelated files / line numbers. Earlier versions of shadow mostly worked, but the line numbers were somewhat off.
Hey! I tried compiling my project a week ago and ran into the foreign-libs issue. Here https://code.thheller.com/blog/shadow-cljs/2017/09/15/js-dependencies-going-forward.html this is mentioned I'm happy to provide an interim solution to make the transition easier if someone has a good idea how to do so.
Wondering if there any other examples or more docs explaining this transition? I have a few JS libs I'm including in my compiled JS and I'm not using NPM for anything. Would love to give shadow-cljs a try!
what kind of files? I mean how did you include them previously and how did you access them?
@thheller Just normal foreign libs stuff, for example:
{:file "resources/foreign-libs/hammer.min.js"
:provides ["hammerjs"]}
then requiring it [hammerjs]
in a file and (js/Hammer. (.getElementById js/document "selected-photo") nil)
not sure. you want the source cljs file or the hammer js file? hammerjs for example just here: https://github.com/hammerjs/hammer.js
well the easiest way is npm install --save hammerjs
and (:require ["hammerjs" :as hammer])
and using (hammer. (.getElementById ....))
but you can also do (:require ["/foreign-libs/hammer.min.js" :as hammer])
and use hammer
not js/Hammer
I don't understand the question. it will load the file from your classpath (so the resources
folder) and include it in your build
@thheller how would I include something like this? https://github.com/blueimp/JavaScript-Canvas-to-Blob I've saved it
npm install --save blueimp-canvas-to-blob
and importing
["toBlob" :as to-blob]
but getting The required JS dependency "toBlob" is not available, it was required by "common/file_upload.cljs".
calling it with either (.toBlob canvas ...
or (to-blob/toBlob canvas ...)
@thheller Got everything working, thanks so much! Just last thing -- has anyone complained about cider completion errors in the repl?
@thheller is the change that broke CIDER's completion an accidental change you are going to restore or one that CIDER needs to adjust to the new way in shadow?
me either. @naomarik can you check if completions work with (setq cider-enhanced-cljs-completion-p nil)
i think the suitable stuff is cool in a few situations and breaks more often than not unfortunately. and cljs tooling is crazy hard
the only thing I cannot get working now is CSS reloading
:devtools {:watch-dir "resources/public/css"
:watch-path "/static"}
this is in my build but doesn't seem to do anything when css is changed, no headsup display notification eitherassuming resources/public/css/site/app.css
exists and is the file served when you load
been changing my build tools all day going from a hobbled combo of lein and boot to deps.edn and now shadow-cljs
how to find the line number of the re-frame code that throws the error:
[Error] Error: ["unrecognized request format: " nil]
(anonymous function) (re_frame.router.js:6)
(anonymous function) (re_frame.router.js:359)
(anonymous function) (re_frame.router.js:425:110)
(anonymous function) (re_frame.router.js:552)
(anonymous function) (re_frame.router.js:291)
(anonymous function) (re_frame.router.js:383)
(anonymous function) (re_frame.router.js:425:110)
G__67540 (re_frame.router.js:336)
(anonymous function) (goog.async.nexttick.js:98)