Fork me on GitHub
#clojurescript
<
2018-10-15
>
bhauman12:10:53

@idiomancy you can disable hot reloading in figwheel

idiomancy12:10:11

yeah, I was trying to figure out how to enable manual hot reloading

idiomancy12:10:30

like, I want it to swap out the JS, I just want to have control over when it happens

mfikes12:10:32

That's what I tend to do, especially for "library-ish" parts of the codebase (turn off Figwheel hot loading and then use (require ... :reload) or even just send forms to the REPL.)

mfikes12:10:46

This is useful when you are working with Spec, and have an alias set up in the REPL via

(require '[clojure.spec.test.alpha :as st])
By temporarily turning off Figwheel, this alias won't be removed on each save.

kwladyka14:10:06

How would you prefer to validate forms with spec? 1)

(s/def ::form (s/and (s/keys :req-un [::email ::password]
                             :opt-un [::password-repeat])
                     ::spec-password-repeat))
+: you can simple provide ::form to library vlidator -: to validate form library have to validate whole form each time, even during typing in 1 input 2)
{:email [::email]
 :password [::password]
 :password-repeat [::password-repeat ?password-repeat]}
+: validate only input which changed, don’t have to validate whole ::form each time -: duplicate spec but in different form to let library recognise what check for what form Why this issue?
(s/def ::form (s/and (s/keys :req-un [::email ::password]
                             :opt-un [::password-repeat])
                     ::spec-password-repeat))
There is no way to read from spec keys and assign them to specific inputs. At least I don’t see such way.

kwladyka14:10:08

But it is still an issue with ::spec-password-repeat and similar things. It will be buggy probably.

kwladyka14:10:43

What do you think guys, How would you like to use library to validate form?

grav15:10:25

How come cljs-main does not like a reg-ex with \/ in it, when Lumo does?

$ clj -Sdeps '{:deps {org.clojurescript {:git/url "" :sha "6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd"}}}' -m cljs.main -re node -e '(re-matches #"^.+\/.+" "foo/bar")'
Exception in thread "main" clojure.lang.ExceptionInfo: repl:1
cljs.core.pr_str.call(null,cljs.core.re_matches.call(null,/^.+\\/.+/,"foo/bar"));
                                                                  ^

SyntaxError: Unexpected token +
    at createScript (vm.js:80:10)
vs
$ lumo -e '(re-matches #"^.+\/.+" "foo/bar")' 
"foo/bar"

dnolen15:10:17

probably the reader, Java Regex in one case, JS in the other

👍 4
rnagpal18:10:51

What is most used lein template for nodejs

rnagpal18:10:21

This has max stars but says its deprecated

dnolen18:10:53

you don’t really need the mies templates anymore

dnolen18:10:26

clj + cljs.main is all you need to get started

dnolen18:10:00

the Quick Start covers what you need to know

rnagpal18:10:19

Is there an example of a minimal project with this configuration