This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-26
Channels
- # announcements (2)
- # beginners (46)
- # calva (16)
- # cider (5)
- # clj-kondo (1)
- # cljdoc (11)
- # cljsrn (4)
- # clojure (42)
- # clojure-dev (2)
- # clojure-spec (6)
- # clojure-uk (1)
- # clojurescript (18)
- # cursive (7)
- # datomic (18)
- # duct (1)
- # fulcro (11)
- # graalvm (1)
- # hoplon (9)
- # leiningen (1)
- # off-topic (8)
- # shadow-cljs (16)
- # spacemacs (9)
- # specter (3)
- # sql (33)
- # vim (3)
- # xtdb (8)
Can I use “static image loading” (https://facebook.github.io/react-native/docs/images.html) also from ClojureScript when using shadow-cljs? That would be including the automatically loading of @2x and @3x variants… Second question: How could I have found the answer to the first question myself? I couldn’t find the answer by web searching and searching in ClojureVerse and Zulip… 😞
Not uncommon for people not to talk about stuff like that - so you’re not doing anything wrong! Asking here or on ClojureVerse (or reddit, or indeed everywhere) is usually a good idea.
Since you’re talking about react native I’d look around for the relevant channels too. It’s a smaller community that does react native with ClojureScript...
@stefan.van.den.oord like this? https://github.com/thheller/reagent-expo/blob/master/src/main/test/app.cljs#L14
Thanks guys! I was told that this community is very supportive, but it still amazes me how much that is true! @thheller That worked. The relative path starting with ‘..’ was the missing part, didn’t occur to me to try it that way.
I’m having some trouble with a bootstrapped web worker. I’ve made a minimal reproducible case. Here it is hosted (check the console). https://shadow-bug.jimmyhmiller.now.sh/ and here is the source https://github.com/jimmyhmiller/PlayGround/tree/529f7276139574a7b34066c501f9b17dd8f5efca/shadow-debug The worker is getting a document not defined error. It appears that this is the culprit. https://github.com/thheller/shadow-cljs/blob/d93af50a6b5e54553762ab273102a3cd16139b6d/src/main/shadow/cljs/bootstrap/browser.cljs#L37-L43 If I change this to use js/eval everything works. Do I have some configuration wrong or is this a bug when trying to do bootstrapped web workers?
@jimmy that code assumes it is running in a normal browser context. webworkers should probably have their own version but if it works I'd be fine to change that
@thheller The doc string says it is for optimization purposes. I’m happy to make a PR changing it to js/goog.globalEval, but want to make sure it isn’t going to cause any performance regressions. Any benchmarks I need to run as part of the PR?
(js/eval ...)
never gets JIT optimized so it runs substantially slower. js/goog.globalEval
should be ok
and actually run it since I have no setup to verify that it actually works as intended in a webworker after that
Not sure I will get around to it today. But I will definitely make sure things are working in the browser and in the web worker before submitting.
Thanks for the quick help and great project