This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-25
Channels
- # beginners (33)
- # cider (40)
- # clara (28)
- # cljs-dev (38)
- # cljsrn (5)
- # clojure (197)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-spec (32)
- # clojure-uk (154)
- # clojurescript (48)
- # core-async (33)
- # cursive (32)
- # datomic (19)
- # duct (1)
- # fulcro (10)
- # graphql (6)
- # jobs (1)
- # lumo (1)
- # mount (6)
- # off-topic (48)
- # onyx (12)
- # other-languages (2)
- # re-frame (77)
- # reagent (19)
- # reitit (4)
- # ring (5)
- # ring-swagger (18)
- # rum (4)
- # shadow-cljs (52)
- # specter (12)
- # tools-deps (47)
Preparing a talk where I present the most popular frontend frameworks (popular as defined by how many project.clj or build.boot files I find on github). I’ve found the following so far:
reagent 4250
re-frame 2251
om/om.next 1600
hoplon 486
rum 477
Missing any with more than ~500 usages?
I used the following query: https://github.com/search?q=re-frame+filename%3Aproject.clj+filename%3Abuild.boot&type=CodeI think reagent and re-frame are complementary, but those statistics wouldn’t surprise me, seem realistic
om/om next could (should?) be split
is there a way to conditionally require
a namespace based on a goog-define
?
@richiardiandrea I don't think so. This is because all requires are processed up front (in order to define the compilation partial order, for example)
so maybe I am approaching the problem in the wrong way 😉
all requires are static. you can do conditional requires via the reader in shadow-cljs. https://shadow-cljs.github.io/docs/UsersGuide.html#_conditional_reading.
yep I am aware of reader conditionals but my use case is kind of different - I want to require either the AWS sdk if a goog-define
says aws
or the Azure sdk otherwise
not possible purely in code, going to need help from the build tool. either via reader conditionals or :js-options :resolve
you can have two different classpaths
yeah shadow does not like 😉
two folders, with the same file andrea/backend.cljs
which has different requires
two project.clj builds can then have two different classpaths
yeah I can do that I think still feel that it could be improved with conditional condionals reader 🙂
you could also do it via different entries. one build with your.app.aws
and the other with your.app.azure
, both setting up the proper env and passing a protocol impl to your actual main
this latter is the idea i had in mind
If you are employing :advanced
then perhaps you could just require both namespaces, and let goog-define
result in DCE. (If that is even important for your use case.)
I think this latest one is the one I had in mind, wondering if I need a macro there though for the goog-define
if. I am trying that right now
they have a thing in npm /js world where packages start with "@". can we require this already?
ah we can with string syntax nvmd
PSA: If you get a NoSuchMethodError
regarding Transit when using the recently-released ClojureScript 1.10.339, it is solvable by updating transit-clj
to 0.8.309 (or by letting ClojureScript transitively define the version)
Can anyone recommend any publicly available CLJS applications (not libraries)? So far I have maria, vimsical and status-react
@pesterhazy there’s also https://github.com/circleci/frontend and https://github.com/PrecursorApp/precursor
@mkvlr perfect!
can't believe I missed those two
ClojureScript REPLs now auto-load user.cljs
or user.cljc
, which is useful for setting up dev-time facilities. See more at https://clojurescript.org/reference/repl#auto-loaded-user-code
Hi! This is really great! I'm trying to do this with cljs 1.10.339 in figwheel 0.5.16 running in cursive. Getting a warning about user being a single segment namespace. Also not able to call a demo function I made in that namespace from the REPL. I'm assuming this is something that needs a fix in figwheel, @bhauman?
Anyone else with a working example of the new user.cljs feature? Did I just misunderstand this?
@U21QNFC5C is the warning from figwheel or is it from the compiler? OR can you show me the warning that you are getting?
@U21QNFC5C By default it will assume cljs.user
is the namespace. But, you can put (ns cljs.user)
(or whatever you like in there). Perhaps you put (ns user)
, which is less useful for ClojureScript (because your REPL starts in cljs.user
)
I was about to answer @bhauman, but I see that you are right, @U04VDQDDY. Using cljs.user works, also with figwheel reload
I did put (ns user), which is the thing that makes the cursive editor happy. Get a red marker now, but I guess I can live with that 🙂
Thanks guys, this feature is the most significant clojure infrastructure improvement for me and my team in a long time
When introducing new developers to the CLJS REPL, it's a huge benefit to get a REPL that is preset with convenience features for our app.
Also, omitting the (ns cljs.user) didn't work for me. If you're interested, I could investigate further and give more details.
That’s huge!
I’ve wanted that for years
Hah! Probably one line per year you wanted it: https://github.com/clojure/clojurescript/commit/9100030be16b4cb792b3b2c124fd41a5f5a67c63
awesome!