This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-09
Channels
- # announcements (4)
- # aws (3)
- # babashka (86)
- # babashka-sci-dev (31)
- # beginners (171)
- # biff (15)
- # calva (3)
- # clerk (47)
- # cljdoc (11)
- # clojure (59)
- # clojure-dev (11)
- # clojure-europe (122)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-uk (2)
- # clojurescript (40)
- # cursive (5)
- # data-science (3)
- # datahike (1)
- # datomic (5)
- # fulcro (9)
- # graalvm (8)
- # hyperfiddle (17)
- # introduce-yourself (1)
- # java (28)
- # jobs (1)
- # malli (11)
- # membrane (9)
- # missionary (1)
- # nbb (1)
- # off-topic (5)
- # other-languages (1)
- # pedestal (1)
- # re-frame (4)
- # reagent (16)
- # releases (3)
- # remote-jobs (3)
- # shadow-cljs (83)
- # spacemacs (1)
- # sql (5)
- # tools-deps (28)
- # xtdb (15)
Small regression in the latest version: The inspector doesn’t remember browser/pprint/edn selection for taps.
@U05224H0W So, previously if you switched the inspector to pprint
, for example, it would remain on pprint when using tap>
, until you switched it to something else. It also remained on pprint
between page refreshes.
This does not seem to be the case with the new UI. Now it switches back to browser
for every new tap>
.
When you want to quickly iterate over something, it’s a cumbersome to switch to the appropriate view for each evaluation you do.
It might just be that this has broken/changed: https://github.com/thheller/shadow-cljs/issues/809
Looking at the comment that you want a better way to do it, you could just store the last option used in a cookie or localStorage.
localStorage.setItem('myCat', 'Tom');
const cat = localStorage.getItem('myCat');
So,
(.setItem js/localStorage "shadow-cljs.inspector.view-mode" "browser")
(println (.getItem js/localStorage "shadow-cljs.inspector.view-mode"))
a file anyone can edit. telling something to open the console and setting it that way sucks
especially if you run multiple projects and local storage works on 9630 but then has to be set again at 9631
Yeah, fair enough. If you randomize the host or change it frequently, you’ll run into trouble. That’s true of cookies as well.
To be fair, no one would be asked to edit localStorage/indexeddb/cookies directly. You’d do that via the UI by clicking the option. Additionally, the option not being portable between hosts is a lesser hurdle than the option not being remembered under any circumstance.
Thanks @U05224H0W, that’s really useful!
I am trying to separate a shadow + lein project (with :lein true
). One of the things that it did was reference an app.cljs
in a prod folder for production and a different app.cljs
in a dev folder for development. These configured some key startup differences between release and dev. I see that shadow-cljs frowns upon different source-paths for different build types.
What is current best practice of implementing the different startup logic between release and dev.
There are some decisions that luminus made like:
(extend-protocol IPrintWithWriter
js/Symbol
(-pr-writer [sym writer _]
(-write writer (str "\"" (.toString sym) "\""))))
(set! s/*explain-out* expound/printer)
(enable-console-print!)
(core/init!)
And a minor configuration detail different between dev and prod
;;ignore println statements in prod
(set! *print-fn* (fn [& _]))
(core/init!)
Also avoiding including expound
never call core/init!
yourself, instead in the build config use :init-fn your.app.core/init!
so only
(extend-protocol IPrintWithWriter
js/Symbol
(-pr-writer [sym writer _]
(-write writer (str "\"" (.toString sym) "\""))))
(set! s/*explain-out* expound/printer)
basicallyThat makes a lot of sense. Thank you for the clear overview.
Its a bit of an older codebase at this point not sure what was the whole idea 🙂
At some point I also switched everything to timbre, so I guess this part was actually already handled via that configuration.
thanks again!
Getting this error in the browser console when loading my app locally (shadow-cljs watch) since upgrading from shadow-cljs 2.21.0 -> 2.22.0:
TypeError: Cannot read properties of undefined (reading 'setDecoratorByClassName')
at eval (control.js:106:54)
at eval (<anonymous>)
at goog.globalEval (app.js:430:11)
at env.evalLoad (app.js:1387:12)
at app.js:1656:12
ring any bells?SHADOW_ENV.evalLoad("goog.ui.control.js", true, "goog.provide(\x22goog.ui.Control\x22); ...
I didn't think we were using goog.ui I don't know why we aren't getting proper source maps
well something must be using it. create a build report and check what is importing it
ha! I was thinking exactly the same thing. Turns out to be that. re-frame-10x
is the culprit
too tired to look into that now. guess I might downgrade the closure lib again if its such a prominent lib failing
It's a bit weird.
goog/ui/control.js
has these lines, among others:
[...]
goog.require('goog.ui.registry');
[...]
goog.ui.Control.registerDecorator = goog.ui.registry.setDecoratorByClassName;
[...]
But for some reason, the goog.ui
object doesn't have a registry
key when we get to that line. As if that goog.require
doesn't work.I don't think you should necessarily jump to action here. I believe re-frame-10x has very likely fallen a long way behind, and isn't representative.
I agree. re-frame-10x hasnt seen releases in a long time and has a fairly large backlog of bugs. It's also the first CLJS library I've seen making use of goog.ui 😁
I've tried using re-frisk maybe... 5 years ago? Didn't look like much. Your comment made me look again. And wow, it's definitely something worth checking out now.
Although IMO one should use its "remote" version: https://github.com/flexsurfer/re-frisk/issues/78