This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-27
Channels
- # ai (4)
- # beginners (102)
- # boot (216)
- # cider (20)
- # cljs-dev (9)
- # clojure (130)
- # clojure-russia (4)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojurescript (59)
- # core-async (2)
- # cursive (10)
- # datomic (51)
- # figwheel (1)
- # flambo (3)
- # hoplon (2)
- # luminus (1)
- # om (17)
- # om-next (4)
- # onyx (2)
- # perun (2)
- # re-frame (79)
- # ring (5)
- # ring-swagger (9)
- # rum (3)
- # schema (3)
- # specter (9)
- # untangled (3)
- # vim (1)
What are good alternatives for hiccupdata->dom node, if I am migrating from an old dommy?
in cljs, how much can I .increment a number before it stops incrementing? (due to everything being a double in js)
@qqq I believe it is 2^53. Reference: See https://en.wikipedia.org/wiki/Double-precision_floating-point_format , in particular the sentence indicating that in the range from 2^52 and 2^53 you can represent integers, and then 2^53 to 2^54 being even integers. In short
(= (inc 9007199254740992) 9007199254740992)
Would it be correct to say that Google Closure compiler won't even try to eliminate dead code from the libraries included via :foreign-libs+:externs?
@metametadata that would be correct, yes.
@metametadata that's kind of what the "foreign" bit is about. Usually foreign libs are written in a different module system or none at all and thus can't be understood/disected by the compiler
If you have something that's in Closure's module format you can use :libs
and get all the benefits (DCE, renaming etc.)
@martinklepsch got it, thanks a lot
@metametadata FWIW Closure won't even see :foreign-libs
, only their externs
i'm trying to test a function that accesses a global JS variable and i'm looking for a way to set/mock that in the test. is there a way to write to global variables or change the access to them?
@fossifoo, e.g. (set! (.-xyz js/window) "xyz")
because js is single-threaded, you can just store the value, run the test, and restore its old value π
This also works and is shorter: (set! js/xyz "xyz")
.
There is also js-delete
, but gobj/remove
will tell you if the key was actually deleted.
js/global
Well I was thinking js/window
, but deleting from window
is apparently illegal in js itself.
it's js/global in node, js/window in browsers I think
js/window
=> #object[Window [object Window]]
(set! js/window.a "foo")
=> "foo"
js/window.a
=> "foo"
(js-delete js/window "a")
=> true
js/window.a
=> nil
I think I am going to make an SPA, for the first time in a while.
but it is not a business app and does not have a backend or a complex app state thing. so I'm afraid of using a full SPA framework
I feel like I mostly just need a good library for handling events and updating the dom
and do everything else the quick & dirty old fashioned way
am I wrong? what libraries are good for the events and dom stuff?
@gfredericks for updating the dom my preference has been reagent for a while
okay so I can use that without having to like have an implementation of datomic in the browser and use datalog or anything like that
I imagine it has event handling as well
haven't looked into that as much. Most event stuff I've done with it I just hook directly into whatever js event I need
should I be figuring out how react works if I'm going to do that or can I pretend react is not there
I don't 100% understand how react works myself. or even like 80%. I mostly pretend it's not there
@gfredericks Iβd recommend reading a little bit on react if you have not tried it ever, I think reagent docs assume that you know react in the first place. Itβs very intuitive after that, though. Recommended