This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-15
Channels
- # announcements (71)
- # architecture (2)
- # aws (41)
- # babashka (23)
- # beginners (80)
- # calva (26)
- # chlorine-clover (11)
- # cljfx (4)
- # cljs-dev (12)
- # clojure (78)
- # clojure-berlin (5)
- # clojure-czech (3)
- # clojure-dev (9)
- # clojure-europe (45)
- # clojure-france (16)
- # clojure-gamedev (2)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojure-uk (37)
- # clojurescript (18)
- # community-development (15)
- # conjure (30)
- # cursive (51)
- # datomic (16)
- # duct (19)
- # figwheel-main (3)
- # fulcro (23)
- # java (7)
- # jobs (2)
- # joker (10)
- # off-topic (7)
- # parinfer (1)
- # pathom (6)
- # reagent (5)
- # reitit (1)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (55)
- # slack-help (3)
- # specter (4)
- # sql (21)
- # tools-deps (11)
- # vim (5)
- # xtdb (14)
When I have a local npm dep and make changes to it, can I get reloading for that, or do I have to npm install + restart my build process every time?
@borkdude shadow-cljs no longer watches individual files in node_modules
(there were just tooooo many). you can touch node_modules/that-package/package.json
though to trigger a recompile
or in case you are writing the whole thing yourself anyways just go with direct includes via https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js
First project using shadow (inherited from @plexus) https://babashka.org/xterm-sci/
it was plexus's idea, I thought I'd take a stab at it, since he was using implementation details of sci, I forced myself into making those things public
well the shadow-cljs UI is at least my attempt to do better ... not yet sure if it actually is 😉
maybe a codemirror input (or any editor) and outputting some kind of DOM is better than xterm
that wasn't the point of this exercise from my angle, I'm sure there are lots of nice things you can do visually
yes, I already have that here: https://borkdude.github.io/sci.web/ (this is an older version of sci, I should update it)
I played with xterm too in the UI a while ago. it is definitely a decent way to get a functional terminal-ish interface going quickly
@thheller I used local-echo but it had issues with quoting. Made an issue + fix for it
there is also a linefeed issue. (dotimes [x 1000] (prn x))
(might be because I'm on windows?)
81
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
nil
user=> ^C
user=>
@borkdude @thheller > (might be because I'm on windows?) FYI same behaviour on Linux.
yeah, I know what the issue is actually. I'm only replacing the last \n with \r\n (which the terminal needs), not the intermediate ones
I think I should support *print-fn*
in sci instead of only *out*
which works better for CLJS
In this REPL I'm flushing everything first to a buffer and print it at the end which is kind of sub-optimal
hi, I'm trying to figure out why a simple access works in development mode and not with release.
(re-frame/reg-event-db
::check-web3
(fn-traced [db [_ js-window]]
(let [web3-enabled (exists? (.-ethereum js-window))]
(js/console.log (str "Browser is web3? " web3-enabled " " (.-ethereum js-window) " " js-window))
(assoc db :web3-enabled? web3-enabled))))
I'm trying to check for window.ethereum which is a proxy object added by http://MetaMask.io extension .the code woeks with lein watch but fails to work when I do lein release
and load the app via static server
@eugen.stan I think your best bet with property access in CLJS in general may be goog.object/get
thanks @borkdude. I am a bit surprised because the use case seems simple. I just started a build with disabled optimisations
another good library for this is https://github.com/applied-science/js-interop
Adding the ^js
type hint fixes the issue with advanced compilation (fn-traced [db [_ ^js js-window]]
.
Thanks again.
For some reason, I had to add com.google.guava/guava {:mvn/version "23.0"}
manually to my deps today, because of:
[2020-09-15 12:49:30.646 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:type :start-autobuild}}
NoClassDefFoundError com/google/common/collect/Streams
com.google.javascript.jscomp.deps.DependencyInfo$Require.asSymbolList (DependencyInfo.java:60)
com.google.javascript.jscomp.deps.DependencyInfo$Base.getRequiredSymbols (DependencyInfo.java:163)
com.google.javascript.jscomp.Compiler.findModulesFromInput (Compiler.java:1914)
com.google.javascript.jscomp.Compiler.findModulesFromEntryPoints (Compiler.java:1870)
com.google.javascript.jscomp.Compiler.parseInputs (Compiler.java:1679)
com.google.javascript.jscomp.Compiler.parseForCompilationInternal (Compiler.java:954)
com.google.javascript.jscomp.Compiler.lambda$parseForCompilation$4 (Compiler.java:937)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:129)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:843)
com.google.javascript.jscomp.Compiler.parseForCompilation (Compiler.java:935)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:693)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
Caused by:
ClassNotFoundException com.google.common.collect.Streams
jdk.internal.loader.BuiltinClassLoader.loadClass (BuiltinClassLoader.java:581)
jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass (ClassLoaders.java:178)
java.lang.ClassLoader.loadClass (ClassLoader.java:522)
com.google.javascript.jscomp.deps.DependencyInfo$Require.asSymbolList (DependencyInfo.java:60)
com.google.javascript.jscomp.deps.DependencyInfo$Base.getRequiredSymbols (DependencyInfo.java:163)
@henrik typical dependency conflict. you may want to investigate where this conflict is from, otherwise the other code depending on the other version may have issues.
Gotcha @thheller. Only mention of Guava seems to be from dev-local, maybe that’s the culprit.
com.datomic/dev-local 0.9.195
com.google.errorprone/error_prone_annotations 2.3.4
com.datomic/client-api 0.8.54
com.cognitect/anomalies 0.1.12
com.google.guava/listenablefuture 9999.0-empty-to-avoid-conflict-with-guava
ah right. the check is still running but you can ignore it. you may want to consider keeping your CLJ deps out of your CLJS alias
Didn’t know that goods practice. I’m on a pretty cljc-heavy codebase, might be a bit finicky?
don't know. I keep my stuff usually completely separate. CLJS managed by shadow-cljs.edn only and CLJ by project.clj
just to avoid conflicts like these .. you won't be using REBL or dev-local in your CLJS builds anyways
@thheller printing issue should be fixed:
(run! prn (range 500))
https://babashka.org/xterm-sci/