This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-22
Channels
- # aleph (20)
- # announcements (4)
- # babashka (72)
- # beginners (64)
- # biff (5)
- # calva (146)
- # cider (5)
- # clj-kondo (18)
- # clj-together (3)
- # cljsrn (28)
- # clojure (95)
- # clojure-berlin (2)
- # clojure-europe (34)
- # clojure-nl (2)
- # clojure-norway (3)
- # clojure-uk (3)
- # community-development (7)
- # conjure (1)
- # cursive (2)
- # data-science (12)
- # datalevin (13)
- # datomic (17)
- # events (2)
- # figwheel-main (5)
- # fulcro (7)
- # helix (8)
- # hyperfiddle (52)
- # jobs (1)
- # malli (14)
- # off-topic (32)
- # polylith (24)
- # remote-jobs (7)
- # scittle (3)
- # shadow-cljs (14)
- # slack-help (3)
- # spacemacs (3)
- # vim (2)
- # xtdb (6)
@dustingetz Electric is awesome from what I've seen! Good job.
I have a problem with the ReagentInterop
demo: from http://localhost:8080/(user.demo-reagent-interop!ReagentInterop)
I get the following π
I've done an npm install
, along with an upgrade of node to the shiniest (v19.7.0) version... any ideas?
you have to uncomment it in i think user-main.cljc, itβs disabled to make the npm install optional
weβre working on making the demos easier to run and find
for now just uncomment the line locally
Pending looks cool, so I can use that to catch a situation where results are not available yet
what if I want to keep the previous DOM and show something in addition when Pending, I probably need a client side atom for the results?
like a content that is updating, you donβt want to replace the old content with a loading indicator
my initial thought would be maybe priority stream pulls from missionary land..? But I'm not sure how to do that yet, and there's probably a better method
exceptions leave the try-body in place and running (so the dom stays, the catch-body is meant to add a loading on top of what is already there)
this is because when the exception "goes away" you need to resume where you were
send me a gist of what you have and a comment of what you want to happen
Iβll try, Iβm not sure what I βwantβ to happen, as Iβm more trying to understand how to use
this is one thing I tried, having a catch block in the UI https://github.com/tatut/electric-examples/blob/55e7537544aefeed268354a97d5fa8d5fc9051e6/src/app/ankka.cljc#L99 this looks like it the βloadingβ block was always showing
Are you running master? I think we might have a regression that matches this report
are you blocked on this?
just doing some examples as Iβm going to show some electric to other clojure programmers at work tomorrow
";; This is showing always after initial showing," i think you are doing it right, this is a bug We refactored how exceptions work this week
I think if you revert to the published version (v2-alpha-68) it will work properly
even after reverting it seems that it doesnβt work properly, not it isnβt showing all the timeβ¦ but the pending element only very briefly flashes in existence and is removed
if I put a println
in the catch block, it is printed twice, once at the start and again at the end of the wait when the element flashes
ah no sorry⦠the element flashes twice when the waiting starts and after the wait is over
ok, we will look into it, thanks for the report
your latest code is on github?
needle in a haystack ... sorry will stop doing that ty for asking
There's an english? Saying for something that is hard to find "It's like finding a needle in a haystack", in programming it's commonly translated to needle is the thing that you are searching for and haystack is the thing being searched
Hi guys! Does electric support release
code with shadow-cljs
?
The builds
of shadow-cljs.edn
config:
:builds {:app {:target :browser
:output-dir "resources/public/js"
:asset-path "/js"
:modules {:main {:init-fn }}
;; For dev
:dev {:devtools {:watch-dir "resources/public" ; live reload CSS
:hud #{:errors :progress}
:ignore-warnings true}}
;; For prod
:release {:compiler-options {:optimizations :simple}}}}
But when I pack the uberjar, the server starts but the js log this error in the console. I miss something?we do support advanced optimizations, let me get back to you
I was playing with the same idea, hit the same error. removing optimizations fixed the error. However now when I run the uberjar I get unable to resolve symbol error related to my backend functions. Am I skipping something?
maybe we broke it, builds are getting reworked wip rn
@dustingetz Do you happen to know any repo that shows how to deploy an electric app with or without a jar? Just to cross check what I have.
:optimization :simple
has been fixed.
:optimization :advanced
has a regression. We will address it.
> when I run the uberjar I get unable to resolve symbol error related to my backend functions
>
We are addressing this too. Weβll get back to you with an example of how to deploy an electric app with a jar.
@UHZPYLPU1 Any chance you can share the repo? I am still struggling with building the uberjar.
I have not repo yet @U5H4U2HEH π
but I can describe how I manage the uberjar.
This is the view of my src
folder:
src
βββ client
β βββ estimaty
β βββ app.cljs
β βββ routes.cljs
β βββ util.cljs
βββ logback.xml
βββ main
β βββ estimaty
β βββ core.cljc
β βββ views
β βββ header.cljc
β βββ room.cljc
β βββ rooms.cljc
β βββ signup.cljc
βββ server
β βββ estimaty
β βββ db.clj
β βββ repository.clj
β βββ server.clj
So src/client
, src/server
and src/main
are source
folder (`estimaty` is the main namespace).
In my deps.edn
, the dev
aliase looks like this:
:dev
{:extra-paths ["dev" "src/client" "src/server" "src/main"]
:extra-deps
{binaryage/devtools {:mvn/version "1.0.6"}
thheller/shadow-cljs {:mvn/version "2.20.1"}}
:jvm-opts
["-Xss2m" ;
"-Dclojure.tools.logging.factory=clojure.tools.logging.impl/slf4j-factory"
"-Dlogback.configurationFile=src/logback.xml"
"-XX:-OmitStackTraceInFastThrow" ;; RCF
"-XX:+UnlockDiagnosticVMOptions"
"-XX:+DebugNonSafepoints"]}
Now this is the build.clj
to build the uberjar:
(ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'io/estimaty)
(def version "0.0.0-alpha0")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
(defn clean [_]
(b/delete {:path "target"}))
(defn uber [_]
(clean nil)
(b/copy-dir {:src-dirs ["src/server" "src/main" "resources"]
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src/server" "src/main"]
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main 'estimaty.server}))
The server should know your server function.
Maybe there is a better solution ^^.@UHZPYLPU1 mine is pretty much same as yours. I do get the uberjar and it loads fine, my problem occurs when I try to execute backend functions with e/server
I get symbol can not be resolved error. Did you had to change anything in front end init code? In my case I split user.clj
in to two, dev still launches user.clj
but jar uses core.clj
that has jetty start logic without shadow-clj stuff. Similarly I moved user.cljs
to core.cljs
and updated shadow edn
accordingly.
When you say backend function, I have a core/-main
that jar executes which starts jetty, or do you mean something else?
In my example, my -main
function is into the server.clj
. In this file, I have required the backend namespaces used by all the views (like db.clj
, repository.clj
)
@UHZPYLPU1 lol, looks like I fixed it without realizing I fixed it. I required db
ns to handle authentication in my jetty
ns. Like you pointed that fixed the issue but at that point last night I already gave up on the jar so never tested again. Thank you.