This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-11
Channels
- # announcements (16)
- # aws (17)
- # babashka (25)
- # beginners (60)
- # calva (40)
- # cider (3)
- # clara (4)
- # clj-kondo (24)
- # clojure (16)
- # clojure-austin (3)
- # clojure-dev (23)
- # clojure-europe (33)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-uk (4)
- # clojurescript (39)
- # clr (108)
- # conjure (10)
- # cursive (12)
- # datalevin (7)
- # editors (2)
- # events (1)
- # fulcro (24)
- # graalvm (3)
- # introduce-yourself (8)
- # london-clojurians (2)
- # malli (18)
- # meander (6)
- # missionary (10)
- # nbb (16)
- # off-topic (19)
- # polylith (1)
- # portal (4)
- # rdf (1)
- # reitit (4)
- # remote-jobs (3)
- # shadow-cljs (10)
- # xtdb (12)
Greetings! I just tried setting up Tempura for a new re-frame project I'm working on. All seemed well, until I rendered the page in question:
> "Runtime resource loading not possible for cljs dictionaries. See tempura/load-resource-at-compile-time
as an alternative."
I found nothing on Tempura's site about how to load the resource at compile time---and nothing online. Does anyone have any experience with this, and can shed any light on how I can load the dictionary at compile time?
i recommend opening an Issue directly on the github project @U01AM3FERS6 - Peter is most responsive there!
Hi, can anyone help me figure out how to pass max and initial heap size to clojurescript builds? we use figwheel main our builds on Jenkins seem to be getting OOMs occasionally and we have plenty of memory on the machine
Looks like there is an env variable https://groups.google.com/g/clojure/c/h3M-LSlE4dw?pli=1.
export LEIN_JVM_OPTS=-Xms4G -Xmx4G
I suspect that by the time lein has read the project.clj
file - the Leinn JVM has already started so the options can't be put in project.clj
.
I think the OOM failure being discussed is during the build inside the lein process itself. @U05224H0W, you are saying that lein process 1
starts another lein process 2
for doing the build task?
I thought JVM-opts
was only for running the app that is started up (e.g. lein run
, lein repl
, cider-jack-in
etc). Not for all the tasks that lein can do internally within it's own JVM e.g. deps
, do
, shell
, check
, install
, uberjar
etc.
Hi. I have a luminus project with a re-frame front-end. I want to pass some data directly to the front-end as a javascript object or a json string saved in a var inside a script tag, but when i use the selmer 'safe' tag, the 'window' object no longer has this property. More concretely, I am defining a var user and setting it to a json string. When I do not use the safe tag, I can access this with
(.-user js/window)
But when I do use the safe tag, trying to access it gives me back 'nil'. Why in the world is this? And what can I do about it? Thanks in advanceHave you tried inspecting the HTML?
Also, I wouldn't use a script tag for this or JSON. In such cases, I usually serialize data with Transit, put it in a <script>
tag with some ID and a custom type that browsers don't interpret, and deserialize it on the client myself.
when i inspect the html, i find that it is there
can you please show me an example of how you would do it?
when i view source
if the safe tag is not present, then all quotation marks are replaced with ", but the data is available on 'window'
when i use safe and view source, it looks good, but the data is not available
> can you please show me an example of how you would do it?
I'm not sure what to show. There's just Transit serialization/deserialization code, along with (-> js/document (.getElementById "my-transit-data-or-whatever") .-text)
.
you said you don't put it in a script tag, but then you said you do put it in a script tag. i'm not sure exactly what you mean
Ah, right. I meant that I wouldn't use a <script>
tag with the default type. I use <script type="text/transit+json">
, but that type
can be anything that a browser won't interpret.
> when i use safe and view source, it looks good, but the data is not available There must be something in there. Try with an empty JSON and compare. If you don't see any difference apart from the quotes, upload screenshots of both w/ "safe" and w/o "safe" - maybe I'll notice something or at least will become as surprised as you are. :)
lol ok
without safe
with safe
Well, there's your problem - "{"id":1,"...}"
is not a valid string. It's a string "{"
followed by a symbol id
followed by a string ":1,"
, and so on.
safe
embeds your string as is, without any escaping. If your string must be a, well, string, then there must be some escaping. By default, Selmer escapes using HTML entities, but those aren't readable by a JSON parser.
No idea what the best solution for this would be. Selmer has a json
filter, but it also will be escaped. You can try combining it with safe
as in {{user|json|safe}}
(of course, here user
is the raw data and not a serialized one), but judging by the documentation it'll lead to the same issue. But maybe not, no clue.
Alternatively, you can serialize the data to a JSON string yourself, wrap it in single quotes, and use with safe
.
But as I mentioned, I would just use Transit with a script tag with a custom type. Storing data in js/window
is evil.
even when it renders like this
it still comes up as nil when i try to access it