This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-18
Channels
- # ai (1)
- # beginners (71)
- # boot (15)
- # cider (26)
- # clara (4)
- # cljs-dev (81)
- # cljsrn (26)
- # clojure (393)
- # clojure-berlin (2)
- # clojure-dev (5)
- # clojure-dusseldorf (1)
- # clojure-greece (5)
- # clojure-italy (6)
- # clojure-russia (97)
- # clojure-serbia (11)
- # clojure-sg (2)
- # clojure-spec (14)
- # clojure-uk (66)
- # clojurescript (58)
- # core-async (19)
- # cursive (18)
- # data-science (2)
- # datomic (75)
- # emacs (20)
- # events (5)
- # figwheel (1)
- # graphql (2)
- # hoplon (29)
- # jobs-discuss (3)
- # juxt (6)
- # lein-figwheel (1)
- # london-clojurians (2)
- # lumo (29)
- # mount (9)
- # off-topic (4)
- # om (16)
- # onyx (25)
- # other-languages (2)
- # pedestal (38)
- # protorepl (2)
- # re-frame (20)
- # reagent (9)
- # ring-swagger (6)
- # sql (10)
- # unrepl (3)
- # untangled (19)
- # utah-clojurians (1)
- # videos (2)
- # vim (20)
zipf was the word I was looking for. https://en.wikipedia.org/wiki/Zipf%27s_law You get a zipf distribution on all projects on github to build your dictionary.
the first base64 char can refer to the top 60 or so top programming words, with some of the last chars reserved to extend the table.
Are there any tips against :advanced optimization removing one of your side effectful steps?
In simple mode it compiles to
document.getElementById("some-id-string").innerText=a
Is there a library for figuring out critical CSS? Not sure how it would work. Booting up PhantomJS or something?
Hi, has anyone trie :input-type :password
with re-com input-text
component? I don't see the input box at all when using that?
@grounded_sage some of the css-in-js libs do that http://fela.js.org/docs/introduction/Benefits.html
dvingo: thanks these will be good to look at. I am using Garden and doing it both as a stylesheet using Clojure and also having it match up in my client side rum components.
Fela only adds styles to the markup that have actively been rendered. Unused style declarations are left out by default.
There is also this. https://github.com/filamentgroup/criticalCSS
Most seem to use PhantomJS under the hood.
Hi, how can I send a request using cljs-ajax
with Content-Type
of application:x-www-form-urlencoded
?
I've tried to set the :header
but it failed. It seems the content-type should be set in the :format
field but it seems I need to write a :write
function and I do not know how to write the :write
function.
Thanks!
@cmal, have you tried :content-type
? https://github.com/JulianBirch/cljs-ajax/blob/master/docs/formats.md
hello. Question about secretary/dispatch!
. I have (re-frame/reg-event-db ... [... (re-frame/after go-home)] ...)
and (defn go-home [_] (println "hello") (secretary/dispatch! "/")))
. The function gets called, prints hello, [:set-active-panel home-panel]
gets sent, but the url in address bar doesn’t get changed. Shouldn’t secretary/dispatch!
do this? Btw, I use pushy
for urls without octothorp
@negaduck I tried to write the :format
field like this:
:format {:content-type "application/x-www-form-urlencoded"
:write .toString}
but the browser gives me a 400 bad request xhrio.js:620 POST 400 (Bad Request)
. And this exception happens at the function this.xhr_.send()
. Does this mean my request not been send correctly?Yes. I am trying to add a proxy in figwheel's http server and try to access to a remote URL. I am debug in the figwheel-sidecar project, but it seems the server does not receive the request. I think the request was not send correctly.
@cmal, what about (POST "/send-form-modern" {:body (js/FormData. form-element)})
? Or (POST "/send-form-modern" {:content-type ...})
?
for the record, I found that if I use pushy, I have to use pushy/set-token!
instead of secretary/dispatch!
Hi everyone! I'm still here, thanks for the patience. I decided to write my clojurescript, async test manually, setting each symbol's value to a new value, storing the old value with a new symbol. After test I would go back with old symbol and old value. I thought to use "use-fixture" as specified here "https://clojurescript.org/tools/testing" but if I store the old values in symbols defined in the ":before" function how can I get them in the ":after" function??
@giovaferra I doubt it's possible unless you create some global registry var which is visible in both functions. As alternative to fixture you can create a helper function and use in every test explicitly.
also consider rewriting the code under test so that you can directly inject the dependency which you try to stub/mock
With something like this: (defn do-apply [x] (apply (first x) (rest x)))
, when I do (do-apply '(+ 1 2 3 4))
complains with Error: Invalid arity: 5
whereas (do-apply [+ 1 2 3 4])
works. Why does it appear to be unquote splicing?
@john you’re trying to apply arguments to a symbol, not a function
cljs.user=> '(+ 1 2 3)
(+ 1 2 3)
cljs.user=> [+ 1 2 3]
[#object[Function "function (a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;switch(b.length){case 0:return cljs.core._PLUS_.cljs$core$IFn$_invoke$arity$0();case 1:return cljs.core._PLUS_.cljs$core$IFn$_invoke$arity$1(arguments[0]);case 2:return cljs.core._PLUS_.cljs$core$IFn$_invoke$arity$2(arguments[0],arguments[1]);default:return b=new cljs.core.IndexedSeq(b.slice(2),0,null),cljs.core._PLUS_.cljs$core$IFn$_invoke$arity$variadic(arguments[0],arguments[1],b)}}"]
1
2
3]
I'd like to be able to take a clojure source form and execute it in non-self-hosted mode, when the compiled artifacts of that form are already available in the target environment. So, I'm supposing I need to walk the form, expand all the names to fully namespaced names, macroexpand where necessary, etc. Is that possible or not?
so, rather than compiling, something that just interprets/translates CLJS forms into callable js, when the compiled functions are already available.
in cljc files, is there a way to require a macro without using #?(:cljs ... :clj .... ) ?