This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-04
Channels
- # announcements (123)
- # asami (1)
- # babashka (50)
- # beginners (49)
- # biff (21)
- # calva (48)
- # cider (6)
- # clj-yaml (8)
- # cljsrn (2)
- # clojure (9)
- # clojure-conj (1)
- # clojure-indonesia (1)
- # clojure-losangeles (1)
- # clojure-uk (18)
- # clojurescript (21)
- # data-science (19)
- # datahike (13)
- # events (1)
- # fulcro (1)
- # honeysql (4)
- # hyperfiddle (40)
- # improve-getting-started (3)
- # inf-clojure (1)
- # malli (6)
- # off-topic (45)
- # releases (3)
- # rewrite-clj (14)
- # scittle (1)
- # shadow-cljs (57)
- # tools-deps (1)
- # vim (13)
- # xtdb (14)
Hi guys, after following the above instructions to bump to new release. Everything works in dev mode as before however something is broken in my uberjar. I am getting the following, is there a way to debug what is causing it? (I get no errors on the server side.)
Optimization :advanced is the default for a regular release.
You can try building with latest master if you want advanced optimizations, we landed a fix
dont really need advanced optimization for now I can make due with simple. Previously it broke when I added advanced optimization removing it fixed it at the time. Will try with simple optimization.
yeap that did the trick. thanks @U09FL65DK @U2DART3HA
I just updated to master and it broke my multi-player. I was doing this to get a session-id for each visitor to the site into an atom that I'm watching:
(e/server
(e/on-mount #(swap! !players assoc-in [session-id :status] :idle))
(e/on-unmount #(swap! !players dissoc session-id)))
But now e/on-mount seems to be gone. How to assoc the session-id into the watched atom now without e/on-mount?see https://github.com/hyperfiddle/electric/blob/master/docs/CHANGELOG.md its linked in the readme now (also posted up channel)
idea: a multiplayer pinball game like https://thegeez.net/2023/03/01/pinball_scittle.html where each time you lose a ball, your opponent gets an extra ball, and every 30 seconds the speed increases. code is here: view-source:
and i'd probably use SVG; use e/system-time-secs for physics equations
When I do (main)
after running cider-jack-in
I get random errors, works most of the time but say 1 in 5 times I would get a different error. Running in dev
without a repl works all the time. Error changes from time to time but the latest one I got is ,
user> (main)
Starting Electric compiler and server...
Execution error (IllegalAccessError) at clojure.tools.analyzer.passes.jvm.infer-tag/eval13126$loading (infer_tag.clj:9).
annotate-tag does not exist
are shadow and electric-server running the same shared JVM?
(do you understand the question?)
Can you expand a little bit? I am launching via cider-jack-in
which uses /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl
two things can cause unreliable programs when hot code reloading: ā¢ when cljs rebuilds but the server doesn't reload ā to solve this, make sure shadow-cljs and your repl are running from the same JVM, as they are set up in the starter app repo
ā¢ an open tab from a stale frontend version currently will auto-reconnect to the server, and the client/server programs therefore will mismatch. Workaround by reloading the page after every incremental build. And make sure you don't have a bunch of old tabs open, you'll see error spam in the server log due to this
btw this is not happening when its reloading, it happens on launch only once I get it to launch everything works as advertised
the client is sending messages to the server that the server tries to interpret, so a stale client can cause server problems
If it's not that, then i suspect a tooling/workflow issue, one of the emacs users will be able to support you
One thing to try is to just run the entrypoint from the command line, shadow exposes nrepl and you can connect via nrepl
when developing Electric Clojure apps, you don't really eval buffers, you save the file, and the shadow compiler picks up the change and reloads everything
(thus keeping frontend and backend in sync)
but you did say this is not a hot code reloading problem
oh, you're on laatest, right? v2-123
hmm maybe that is the cause I am launching multiple repls one from shadow, one from emacs. > but you did say this is not a hot code reloading problem yes once it starts it keeps working no issues. > oh, you're on laatest, right? v2-123 also yes > (thus keeping frontend and backend in sync) For front end code I let electric do its thing, but it is much faster to try things in repl that support app logic. (testing db functions etc. without filling in all the forms.) I use repl for non electric stuff.
you need to have emacs jack-in to the shadow repl instead of running 2 repls. On calva it will pick up the .shadow-cljs/nrepl.port file and jack-in to the shadow repl. Not sure how to configure that in emacs.
> shadow exposes nrepl and you can connect via nrepl Just chcked this and it works as expected, I missed that it launched. thanks for the help guys.
for the record, ordinary clojure REPL workflows are 100% fine for ordinary clojure parts of your project. it is only changes to e/def and e/defn that need to be synchronized. if you change electric code, you must flush to disk
Hi, so if i want to make an uberjar should i wait for the official instructions? x)
probably yes, coming soon .. we have them already actually but want to test a little more
there is a theoretical possible issue related to automatic websocket reconnection that we want to understand before people do this
yeah definitely do not use this for a landing page
each session has a websocket, it's not free on the server
the above issues are resolved in master now, starter-app is updated with dockerfile and CI/CD to http://fly.io