This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-12
Channels
- # beginners (63)
- # boot (3)
- # braveandtrue (153)
- # cider (19)
- # cljdoc (2)
- # clojure (80)
- # clojure-dev (25)
- # clojure-italy (73)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (67)
- # clojure-sweden (1)
- # clojure-uk (83)
- # clojurescript (56)
- # clojutre (11)
- # core-logic (37)
- # cursive (18)
- # datomic (14)
- # editors (10)
- # emacs (13)
- # figwheel-main (11)
- # fulcro (62)
- # graphql (11)
- # jobs (3)
- # klipse (1)
- # leiningen (6)
- # off-topic (91)
- # onyx (7)
- # pedestal (3)
- # portkey (5)
- # re-frame (14)
- # reagent (13)
- # remote-jobs (1)
- # shadow-cljs (111)
- # tools-deps (4)
- # yada (10)
i'm trying to figure out what's making appendo
terminate, from the looks of it, it seems like it should just be infinite like anyo
tools.cli
has supported ClojureScript for quite a while but it has done so through a separate .cljs
codebase. I'm considering moving to .cljc
and dropping support for Clojure 1.6 and earlier -- which doesn't seem controversial. I have a question about *assert*
tho' -- in the cljs version of the codebase, tools.cli
unconditionally performs some debug-level checks on argument spec formats. In the clj version of the codebase, it has (when *assert* ...)
around those checks. Having read the differences between cljs and clj, I'm not clear whether that form -- (when *assert* ...)
-- is appropriate or not. Input?
The other difference in the tools.cli
codebase is that clojure.pprint
seems to be replaced by goog.string.format
in the cljs version -- is that still a fair assumption?
Also, since it's been a long time since I last used cljs, what's the current best practice around catch
with js/Error
vs Throwable
? It it still to use reader conditionals or is there something simpler?
hmm tried to use aws-amplify for some logins and ran into this https://dev.clojure.org/jira/browse/CLJS-2738 problem with :npm-deps
@seancorfield Uaing *assert*
should be OK. When set to false
in ClojureScript, (when *assert* ...)
should expand to nil
which should be further completely elided when it is a "statement" (as inside a do
). Probably worth checking.
There is a cljs.pprint
in ClojureScript now. But, it causes some code size issues. So does goog.string.format
. But perhaps this is not so much an issue for CLI programs?
With respect to catching, typically code does something like #?(:clj Throwable :cljs :default)
(At least until https://dev.clojure.org/jira/browse/CLJ-1293 is done and widely deployed.)
hi guys
is there anybody using "collapse" option of bootstrap ?
within clojurescript
@mfikes Much appreciated! I'll look at cljs.pprint
to see if I can have a single code base with almost no conditionals 🙂
Hi. I'm trying to add a script element in my cljs file. The element is getting in there; I can see it in my inspector, but the script is not running. How can I get the script to run?
[:script {:type "text/javascript"} "jQuery(document).ready(function($) {\"alert('hello')\"})"]
<script type="text/javascript">jQuery(document).ready(function($) {"alert('hello')"})</script>
When I had done just the alert without the surrounding jQuery.ready, the alert never alerted.
But I'm passed that now. I've got some bizarre error that: Objects are not valid as a React child
I have [:div {:id "myGrid" :style {:height "1000px"}}] (let [the-head js/document.head the-script (.createElement js/document "script" ) the-script-value "alert(\"The script was run\");" ] ; if you need to load a js file (set! (.-type the-script) "text/javascript") (set! (.-src the-script) "js/my-grid.js") (set! (.-innerHTML the-script) the-script-value) (.appendChild the-head the-script) ) And my error is: SlickGrid requires a valid container, #myGrid does not exist in the DOM.
Try this:
(defn load [aname url]
(let [tag (.createElement js/document "script")]
(set! (.-id tag) (str aname))
(set! (.-src tag) url)
(let [first-script-tag (first (array-seq (.querySelectorAll js/document "script")))]
(.insertBefore (.-parentNode first-script-tag) tag first-script-tag))))
Is there any performance benefit when using transdusers in cljs. I know that in clj one avoids creating intermidiate objects.
@its.ramzi oh, my bad. It looks like your script is running. But maybe it's running before react has a chance to populate the dom
@heefoo yup! https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624
@john It's amazing, calling one line causing my whole page to crash. Without calling your load function, my whole page loads except the table. Calling the load function, only the table loads and none of the page does
Don't pass in the myGrid
as the aname
parameter. Just give it a unique name that won't collide with anything else in the dom.
I am thinking to make a basic replica of this project to put on github for you to take a look at
hmm, maybe the function I provided doesn't play nice in a react lifecycle? React is a complex beast.
You'll probably want to stick your grid lib loading logic in a "componentDidMount" handler somewhere, depending on what react lib your using. It's a non-trivial topic and takes some study to understand.
@clojurians-slack this seemed to actually be the issue with the UIkit components as well last time
resolved via componentDidMount (allegedly idiomatic) or emitting events in react
@john I stripped my program down to the bare bones. I have the app rendering server side. Can you get it rendering client side?
If you can get a minimal repro up on github, there's a good chance you'll be able to get some feedback on here
The way my POST were structured was like
(POST "/exec"
{:format :json
:params {:body (js/JSON.stringify (cljs->js params))}
:error-handler (error)
:handler (fn [r] (put! ch r))
})
In the previous version we were using, 0.1.3
I noticed that the payload was being sent as Form Data
Would folks be interested in a mini static cljs blog that could update itself from a self hosted repl in the browser?
I've got one half way built, able to push commits. But why aren't self updating static blog sites more popular? Are people worried about security or something?
i would love to see what you’ve got