This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-20
Channels
- # announcements (1)
- # beginners (164)
- # calva (70)
- # cider (26)
- # cljs-dev (6)
- # cljsrn (1)
- # clojars (3)
- # clojure (123)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-ecuador (9)
- # clojure-europe (2)
- # clojure-italy (14)
- # clojure-nl (21)
- # clojure-nlp (5)
- # clojure-portugal (1)
- # clojure-spain (3)
- # clojure-spec (26)
- # clojure-uk (47)
- # clojurescript (17)
- # clr (1)
- # code-reviews (7)
- # core-async (5)
- # cursive (8)
- # data-science (2)
- # datomic (28)
- # emacs (23)
- # events (1)
- # fulcro (43)
- # graalvm (6)
- # graphql (8)
- # immutant (5)
- # jackdaw (17)
- # jobs (1)
- # jobs-discuss (20)
- # joker (3)
- # leiningen (8)
- # luminus (12)
- # off-topic (61)
- # overtone (5)
- # pathom (2)
- # quil (1)
- # re-frame (15)
- # reagent (2)
- # reitit (23)
- # remote-jobs (1)
- # schema (1)
- # shadow-cljs (26)
- # tools-deps (56)
- # vim (4)
just a curiousity for cljs-react devs (almost all). I wonder, as a style guide, why it isn't a common practice to name react elements and react classes with capital letters. I've seen over and over again reagent/create-react-class, and that functions is a lowercase kebab-case function name. Jumping between js/ts and cljs, this lowercase love hurts my eyes a bit. Is there no cljs style guide recommending UpperCase for react-elements and react-classes?
@hlolli I've been thinking about the same thing as well. I believe part of it had to do with the fact that PascalCase is currently used for https://github.com/bbatsov/clojure-style-guide/blob/master/README.adoc#CamelCase-for-protocols-records-structs-and-types
Although I've been starting to think that namespacing components might be a better alternative.
I namespace components often, in react native, I'd do :> rn/FlatList
, but the symbol name stays PascalCase
Ran into something unexpected this morning using [org.clojure/clojurescript "1.10.520"]
, (uuid "not-valid")
produces #uuid "not-valid"
, which makes (uuid? (uuid "not-valid"))
equal true
. Is this a bug?
@tomjkidd this is also the case in older cljs versions, uuid is just a deftype in the cljs code. So any string creates a uuid, and all have the same print method. I guess you need to look for 3rd party library for validation, or regex if possible.
there's no native javascript way of validating uuid (one could create webcrypto instance for it, but it could be an overkill).
Thanks @hlolli, just wanted to know if that was the intent. I will validate it myself with a regex before passing to uuid
esp. since hx creates vanilla React components, it helps to make the naming of in-app and 3rd party components consistent