This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (11)
- # aws (1)
- # beginners (57)
- # calva (14)
- # cider (22)
- # clara (23)
- # cljdoc (21)
- # cljs-dev (14)
- # clojure (76)
- # clojure-austin (3)
- # clojure-europe (32)
- # clojure-finland (1)
- # clojure-gamedev (5)
- # clojure-italy (3)
- # clojure-nl (17)
- # clojure-poland (4)
- # clojure-spec (23)
- # clojure-uk (29)
- # clojurescript (72)
- # cursive (6)
- # data-science (4)
- # datomic (2)
- # dirac (10)
- # duct (3)
- # emacs (1)
- # figwheel-main (10)
- # fulcro (86)
- # jackdaw (5)
- # juxt (2)
- # kaocha (2)
- # leiningen (16)
- # off-topic (47)
- # pathom (46)
- # protorepl (2)
- # reagent (4)
- # reitit (14)
- # ring-swagger (5)
- # shadow-cljs (43)
- # spacemacs (13)
- # sql (13)
- # tools-deps (6)
The idea is to have large text files written in md over having them in cljs or html directly
Make a macro that reads the file. Take note of caching issues. I recall shadow-CLJS has something like that already...
@tomaas Have you tried using https://cljs.github.io/api/cljs.core/this-as in the
what are your suggestions about using kafka with clojure with reagent, for example we could assume counter example, inc per click, so i should use web sockets or rest api?
I'm splitting up my app, and currently have
app/src, and now I want to build a single artifact from these two
(cljs.build.api/build (cljs.build.api/inputs "ui/src" "app/src") compiler-ops) worked, thanks!
Hi everyone. What is the best library to use for working with urls these days (e.g. for iterating over query parameters, etc.)? I was thinking of using https://github.com/cemerick/url but not sure if this is a good idea due to the read-only notice at the top of that page. I'm guessing this is because it is essentially feature complete, but wanted to check with the wider ClojureScript community before making a final decision.
@yogidevbear For manipulating URLs I’ve used cemerick/url and found it useful. It’s a very small lib (141 loc) that uses
goog.Uri so you could look at those libs as well. In my client apps I typically leverage routing libs (bidi, etc…) to parse route state.
Any opinions on doing internationalization/localization? Ideally I’d like to use a widely-used and stable JS framework for the nitty gritty, e.g. https://formatjs.io or https://www.i18next.com — if anyone has experience with those it’d be cool to share thoughts! I looked at Google Closure stuff but their method relies on making a separate js bundle per locale, which is not my cup of tea at the moment.
Hello ClojureScriptians! I am in the midst of bringing rewrite-cljs up to par with rewrite-clj. Rewrite-clj makes use of an internal version potemkin’s
import-vars macro allows you to collect fns (and defs and macros) from disparate namespaces into an api namespace. With the goal of a single code base, I thought I’d experiment with making a cljs version of
import-vars - at least for fns. It is mostly working, with one known problem: I see
:line returned by
cljs.analyzer.api/resolve on my disparate fns, but have not figured out a way to apply
:line as metadata to the fns in my api namespace. The goal is for it to behave like the clj
import-vars so that when requesting source (for example via cljdoc) on fns in the api namespace you are taken to the source of the fns in the disparate namespaces. Any tips?
but in general I don't see how this will be useful since a lot of tooling relies on source mapping
instead ClojureScript has compiler state which has a mapping of all namespaces and their defs
and every def has a map with things you would normally find in var metadata along w/ other useful compiler related stuff
Thanks very much @dnolen, that helps me to understand. Do you have a general opinion on potemkin’s
import-vars? From my (admittedly naive) position it seems like an elegant way to expose an api.
Thanks again, that helps. I am not new to software dev, but am relatively new to Clojure/ClojureScript.
you'll definitely learn a thing or two about ClojureSript internals if you try to get this to work - not a bad thing
cljs.analyer.api ns should give you an idea of what accessing the compiler state looks like
Hmmm… I like a good puzzle, but maybe that’s all this is. I could be done pretty quickly and very reliably with some boilerplate.
(import-var x) should expand to whatever makes sense, but also side-effect (inside the macro fn, not the returned source) the new def in the compiler state to give it the desired
while you are here… and if you are willing… when you guys ported Clojure to ClojureScript did you run into many cljs namespace clashes? I’ve hit some in rewrite-clj and am weighing my options.
actually, ironically, they are all due to collecting fns into an api namespace which is a pattern that is probably not in the Clojure codespace?
that is you have an existing Clojure namespace you don't want to change, and a ClojureScript namespace w/ the same name but that needs macros
I was thinking of clashes due to Google Closure namespaces https://clojurescript.org/about/differences#_namespaces
Yes, that’s the stuff I am running into… things like
i.e. do you rename the var or the ns ... but maybe you won't see them in the same order because of incremental compilation, require changes etc.
it could probably be made to work - but it's annoying enough that no one has given it a go
since ns munging is pretty straightforward, it's easy to debug even in limited JS environments
so if you don't get a warning about detected clashes that's what I would consider the bug