This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-30
Channels
- # announcements (2)
- # babashka (37)
- # beginners (64)
- # biff (27)
- # cherry (7)
- # cider (19)
- # clj-kondo (10)
- # clojure-austin (4)
- # clojure-doc (18)
- # clojure-europe (72)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (5)
- # clojurescript (18)
- # data-science (28)
- # events (5)
- # graalvm (32)
- # hyperfiddle (6)
- # introduce-yourself (1)
- # jobs (4)
- # joyride (16)
- # juxt (6)
- # malli (7)
- # missionary (3)
- # off-topic (18)
- # pathom (15)
- # portal (14)
- # re-frame (14)
- # reitit (5)
- # releases (1)
- # rum (2)
- # sci (1)
- # shadow-cljs (102)
- # spacemacs (3)
- # sql (6)
- # web-security (2)
- # xtdb (10)
Anyone hit issue with tailwind ? I run this command which works and does the recompile on changes, how ever I find after a lot of reloads I get a js memory exhausted type error, curious if this is just me or if other's experrience it ?
npx tailwindcss -i ./development/resources/public/css/tailwind-styles.css -o ./development/resources/public/css/styles.css --watch
I have this for my watch regex
content: ['./development/resources/public/**/*.{html,js}'],
It seems to be a memory leak in the tool but I did not find much online so thinking it perhaps related to the type of code output by the clojurescript compiler ?i’m working on a project with this exact config and haven’t had any issues like this, running the tailwind watch for days. doing a find public -type f \( -name "*.html" -o -name "*.js" \) -exec du -ch {} +
i have roughly 200 js files and 1 html file, using 12M of diskspace.
that's good to know I have seen this on different projects which makes me wonder if its version or platform or something like that causing the issue,
I am on version 3.3.5 I find I get about an hour when rapidly making changes, just noticed my node is version v18.18.0 which seems a bit behind
yeah, i’m on v3.3.5 and v21.1.0.
I've always had memory issues on that too. If you search tailwind
here you might find some older convos about it. I just pull in the big ole cdn now for development (and save the compiled optimizations for prod) and it's solved my issues so far. Here is an example of how I do that using shadow-cljs
: https://github.com/chase-lambert/clojure-app-template/blob/main/src/client/core.cljs (if anyone has a better way of doing this, please let me know)
any suggestions for parsing XML in cljs? Hickory and Tubax are both break under advanced optimization (both work fine when running dev build)
This gives me an xml document. (also possible using js/DOMParser
) How can I go from this to edn or something else more friendly for manipulation in cljs?
what about clojure data.xml, it uses js/DOMParser under the hood
And if you need something quite simple, I would recommend just using that document. Much simpler and faster than doing it via some intermediary.
@U2FRKM4TW - yep good advice this worked out better in the end. @U0739PUFQ - I tried with data.xml but was having trouble to get the dependency to load in cljs. Thanks all 🙏
to tell apart javascript objects like #js {:a 1} ?
Ah, thanks. I tested it like this, and couldn’t make much sense of it:
(object? (new js/Object)) ;=> true
I guess it is just me always tripping on the terminology here.yeah, it is pretty weird since sounds like it will return true on many things, but it just returns true on #js {...}
If you take a look at the source https://cljs.github.io/api/cljs.core/objectQMARK, the predicate checks if a value is a plain object. This is useful since many things in JS inherit from Object.