This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-24
Channels
- # aleph (13)
- # announcements (3)
- # beginners (134)
- # calva (9)
- # clojure (33)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (42)
- # clojure-uk (7)
- # clojurescript (43)
- # core-async (7)
- # core-typed (2)
- # cursive (32)
- # datomic (19)
- # fulcro (5)
- # gratitude (4)
- # hyperfiddle (26)
- # introduce-yourself (1)
- # jobs-discuss (15)
- # lsp (3)
- # malli (20)
- # off-topic (18)
- # overtone (3)
- # polylith (24)
- # squint (22)
- # xtdb (21)
i noticed in the demo that the changes weren’t character-by-character, is that dependent on how you set it up?
The reason it isn’t character by character is because I roundtrip to Rama between. Automerge can be used peer-to-peer as well, or just against an in-memory document that you keep server-side. However, I 1) didn’t want to send out changes that to peers unless I know they have been durably recorded, and 2) If you go for the in-memory document approach, you get scalability problems. Rama takes care of scalability. So for my approach, I went for a microbatch topology, meaning that Rama will collect 200-400ms worth of changes coming in, aggregate and save them, and only then will those changes be pushed to peers. You could set it up for quick turnaround times, but I went for scalability and consistency instead.
has anyone seen shadow OOM errors like this? seems to happen to me every few compilations. I've tried giving the shadow more memory (`-Xmx5G`) to no avail. I do have a 500+ line cljc file, but I've seen shadow work with larger files. I'm on the IC branch. wondering how to further troubleshoot this.
[2024-01-23 23:41:50.852 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:namespaces #{app.scopes4}, :deleted #{}, :updated #{app.scopes4}, :added #{}, :macros #{}, :shadow.cljs.model/topic :shadow.cljs.model/resource-update}}
OutOfMemoryError Java heap space
java.util.Arrays.copyOf (Arrays.java:3537)
java.lang.AbstractStringBuilder.ensureCapacityInternal (AbstractStringBuilder.java:228)
java.lang.AbstractStringBuilder.append (AbstractStringBuilder.java:582)
java.lang.StringBuilder.append (StringBuilder.java:179)
clojure.string/join (string.clj:191)
clojure.string/join (string.clj:180)
shadow.build.targets.browser/flush-unoptimized-module-eval (browser.clj:522)
shadow.build.targets.browser/flush-unoptimized-module-eval (browser.clj:506)
shadow.build.targets.browser/flush-unoptimized-module (browser.clj:661)
shadow.build.targets.browser/flush-unoptimized-module (browser.clj:656)
shadow.build.targets.browser/flush-unoptimized/fn--56013/fn--56015 (browser.clj:683)
clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
update: found the culprit but not sure what's wrong with it. the OOM goes away when I comment this out. https://gist.github.com/yayitswei/364f7106d606de27d57fb27c63cc80f2
Not clear what’s happening. But I have an intuition.
Could you please try adding :loader-mode :default
under shadow-cljs.edn
-> :builds
-> :your-build-id
-> :devtools
. Like this:
{:builds
{:dev
{:target :browser
:devtools {...
:loader-mode :default
...}
...}}}
@U2DART3HA that fixed it, thanks! i see now that electric-fiddle
has that line, but i'm migrating an older electric-starter-app
project. so :loader-mode :default
is not the default? 😅
what does it do? I don't see it in the shadow docs https://shadow-cljs.github.io/docs/UsersGuide.html
It's not documented.
Shadow can perform hot code reload in two ways:
• :eval
(the default) will send compiled js code to the browser through the shadow websocket and call js/eval on it. So it sends all the code as a single string. It's fast for small programs.
• :default
(not the default) is the legacy method. It loads one js script per compiled namespaces. It is slower for small programs because it performs a network request per compiled namespace. It is faster for larger programs because it doesn't concatenate tons of code into a single string.
we depend on this? we should talk to thomas
@U066TMAKS please upgrade to the maven release and let us know if the issue persists, I spoke with Geoffrey and we don't think the :loader-mode :default
flag is needed after IC, though we are not absolutely certain
will report back when i upgrade, been putting it off due to the breaking websocket change
Will tomorrow’s talk be recorded or have a livestream for remote viewers? I want to attend remotely, but don’t see any mention on the event: https://www.meetup.com/clojure-nyc/events/298312289/
physical event in NYC, no stream
content will be streamed in upcoming months, this is just a dress rehearsal basically
Hi everyone, I decided to switch to datomic and I am wondering about clj -A:dev:datomic-browser
do I need to run the datomic agent for this to work and is there a specific one?
We’ve added a readme for https://github.com/hyperfiddle/electric-fiddle/tree/main/src/datomic_browser It explains how to set datomic up and how to run it for the demo.