This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-14
Channels
- # aleph (1)
- # aws-lambda (10)
- # beginners (161)
- # bitcoin (2)
- # boot (20)
- # cider (3)
- # clara (46)
- # cljs-dev (35)
- # cljsrn (9)
- # clojure (123)
- # clojure-boston (1)
- # clojure-colombia (1)
- # clojure-dusseldorf (3)
- # clojure-gamedev (2)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-losangeles (3)
- # clojure-nl (2)
- # clojure-russia (15)
- # clojure-spec (1)
- # clojure-uk (7)
- # clojurescript (75)
- # community-development (5)
- # cursive (5)
- # datomic (25)
- # docs (3)
- # emacs (1)
- # fulcro (11)
- # graphql (131)
- # heroku (1)
- # jobs (1)
- # juxt (55)
- # lein-figwheel (2)
- # luminus (1)
- # off-topic (4)
- # om (8)
- # onyx (32)
- # pedestal (19)
- # re-frame (53)
- # reagent (11)
- # remote-jobs (1)
- # rum (12)
- # shadow-cljs (12)
- # spacemacs (53)
- # testing (2)
- # unrepl (18)
Good morning. In a production build that compiles without errors I'm getting an uncaught error when accessing the page: Uncaught Error: Assert failed: c
.
This causes the main export variable that is called in the html shell <script type="text/javascript">main.system.go();</script>
to be undefined.
Can someone give me a pointer how to pinpoint what is causing the issue?
What other info can I provide that might be helpful?
hi, i'm getting this error Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sass/util
when running lein sass watch
in my windows. Anyone had similar issue?
@tomaas You could try https://github.com/Deraen/sass4clj instead, I have Windows CI running the tests so it should work
Wasn't there some symbol metadata that prevents minification as an alternative to using externs? Is that documented somewhere?
or was that just when property names begin with two underscores, like in the impl of om
(which is also not documented)
@leongrapenthin you might want to use string names to prevent minification
btw. I wrote a library[1] which makes it pretty convenient: https://github.com/binaryage/cljs-oops
I notice the compiler is setting NODE_ENV to "production" when the optimizations are not set to :none
https://github.com/clojure/clojurescript/blob/79041d10ce11e9e2f15c261a9a4174c6a7066834/src/main/clojure/cljs/closure.clj#L2062
I have a request for macchiato, where the users is trying to run it on heroku, and the application needs access to host/port environment variables
possibly, when I log (-> js/process .-env js/console.log)
with :simple
optimizations I see { NODE_ENV: 'production' }
ah good news, the template was on 1.9.854
and 1.9.908
fixes it, I'm guessing shim-process?
was added there?
When using Reagent, is there any use for placing a reaction
around every query? Or only around the db
?
E.g.,
(defonce app-db
(let [ratom (r/atom (d/db conn))]
(add-watch conn :watch-conn (fn [_ _ _ new-db] (reset! ratom new-db)))
ratom))
And then:
(let [screen-state (reaction (d/q '[:find (pull ?e [*]) .
:where [?e :ui/screen-element :ui/page]]
@app-db))] ...)
When the reaction
around the query in screen-state
is removed the behaviour does not seem to change.Does the reaction
in screen-state
do anything useful?
can i use javascript unary operators in clojurescript? i want to convery string to number
@erwinrooijakkers you probably want to ask in #reagent
Thanks
@hugh.jf.chen you can use js/parseInt
Parseint is not safe
Parseint('44jpg') will return 44
That is not what I want
@hugh.jf.chen then use something else
cljs.reader/read-string
and checking if the return is a number?
is another alternative
Check goog.string and found toNumber
Is it possible to get var metadata from JavaScript? var
is a special form, so I can't do normal interop stuff. Is there some kind of var registry I can look at at runtime from JS?
are vars even reified in a useful way? they don’t appear to be form my experimentation but something could have changed
Oh, right, what he said ^
@peeja AFAIK you can use macros to “export” some metadata into your generated js code and use it at runtime from cljs code
if they were reified, you could use ns-publics
to get the vars of an ns, without needing macros of any sort
the closest we have I guess in cljs is (goog.object/getKeys js/some.ns)
ev:cljs.user=> (gob/getKeys js/cljs.core)
#js ["_STAR_clojurescript_version_STAR_" "_STAR_unchecked_if_STAR_" "_STAR_warn_on_infer_STAR_" "PROTOCOL_SENTINEL" "_STAR_target_STAR_" "_STAR_ns_STAR_" "_STAR
_out_STAR_" "_STAR_assert_STAR_" "_STAR_print_fn_STAR_" ...
What is the canonical way to turn clojurescript code into html (with syntax highlight etc) to show to coworkers ?
Hadn't heard of one. There are various highlighters online that can do clojure, like this one: http://hilite.me/
If you want to build a tool though, there's things like this: https://github.com/venantius/glow
I like the code formatting on https://clojurescript.org/tools/repls
I just tried this https://github.com/google/code-prettify
bit google-lazy, what was again the name of the math operator that returnes decimals from float, what I want is to split for ex. 1.666
to 1
(int or parseInt of course) and 0.666
or 666
.