This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-20
Channels
- # beginners (106)
- # boot (25)
- # cider (2)
- # cljs-dev (100)
- # cljsjs (1)
- # cljsrn (8)
- # clojure (90)
- # clojure-brasil (1)
- # clojure-dev (7)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-madison (1)
- # clojure-russia (15)
- # clojure-serbia (15)
- # clojure-spec (13)
- # clojure-uk (32)
- # clojurescript (88)
- # cursive (19)
- # datascript (13)
- # datomic (32)
- # defnpodcast (1)
- # dirac (43)
- # euroclojure (1)
- # graphql (5)
- # hoplon (11)
- # immutant (1)
- # jobs (6)
- # lein-figwheel (2)
- # liberator (2)
- # luminus (14)
- # lumo (22)
- # off-topic (12)
- # om (9)
- # onyx (49)
- # parinfer (45)
- # precept (4)
- # protorepl (2)
- # reagent (14)
- # ring-swagger (3)
- # sql (1)
- # test-check (58)
- # timbre (3)
- # untangled (86)
@dm3 Thanks again for the report that led to https://dev.clojure.org/jira/browse/CLJS-2101 . It was pretty cut-n-dry (laziness in the analyzer). Looks like you were 24 forms away from seeing it occur in regular JVM ClojureScript as well (it just happens sooner in self-host owing to lack of chunked sequences).
I have something like
(defn scaled-img [props]
(let [url (:src props)]
[:img {:src url
:style {:width "400px"
:height "300px"}}]))
(defcard simple-image
"### a simple scaled image with a source"
(let [url ""]
(dc/reagent scaled-img))
{:inspect-data true})
Anyone know of a CLJS framework that allows for custom tags? Hiccup/Sablono CLJS implementations in Re-frame and Om(.next) don’t handle non-standard HTML the last time I checked (which was last December, admittedly) — I’m trying to get A-Frame working in CLJS, which would require something like [:a-scene {custom-properties-too ""} // etc. ]
@acuervo what's a-frame?
http://aframe.io a webvr framework
@acuervo you should be able to use non-standard html tags with React (reagent, om, etc.). One approach would be to use https://facebook.github.io/react/docs/dom-elements.html#dangerouslysetinnerhtml
`'clojure.core
evals to (quote clojure.core)
in clojure, (quote clojure/core)
in clojurescript. Why the difference?Is there something special I have to configure in order to use json-response-fomat
in cljs-ajax? Right now I get Error: No *print-fn* fn set for evaluation environment
.
@zilti are you printing the result somewhere?
that's probably the issue - try js/console.log
instead
@pesterhazy: no, no println
or something anywhere.
timbre may be printing using println
you have to call (enable-console-print!)
somwhere
and it needs to be before the call to print
No, Timbre prints into the console the way it is supposed to. That doesn't cause any errors.
http://blog.leaningtech.com/2017/06/announcing-cheerpj-java-compiler-for-webapps.html ^ how funny would it be to compile the clojure jar to js
@selfsame do it! 🙂
Should I be concerned about this? "WARNING: JSC_INVALID_ES3_PROP_NAME. Keywords and reserved words are not allowed as unquoted property names in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option."
@zilti you're welcome!
@pesterhazy: thanks 🙂
Hm, it looks like there's a difference between uncaught instances of ex-info
and js/Error
. An uncaught js/Error
produces much better stacktrace in Chrome, at least when thrown from core.async
context. And Firefox shows no stacktrace at all on uncaught ex-info
🙂
@metametadata ex-info
isn’t about browser support
adding to my previous question (shameless bump), the inner quote isn't necessary to demonstrate the difference:
`clojure.core -> clojure/core
`~'clojure.core -> clojure.core
@metametadata that said if there’s a way to get ex-info
to provide better traces, submit a patch! Seems like an easy one to do if it’s possible.
@dnolen got it! I'll need to look into it when I have some free time. I suspect there could be some browser-specific properties in js/Error
objects which are not added into ex-info
instances or smt. like that. So maybe it would be possible to create js/Error
and then augment it with ExceptionInfo
protocol instead of creating an instance of ExceptionInfo
and copying data from js/Error
into it. I dunno.
alright, thank you for the reply
@mfikes @moxaj I thought somebody filed a ticket for this recently? My question was whether this problem was at the reader?
How would I go about serving purecss from a webjar through an aleph server? My understanding is yada can support webjars? The only yada example I see is for serving swagger, not a resource.
@bronsa @dnolen CLJS-2109 might be also leading to solving https://dev.clojure.org/jira/browse/CLJS-1982
@richiardiandrea closed as dupe, thanks for finding it
Awesome no problem!
@deadghost use :language-in :es5
in the compiler options
Does anyone know of any supporting specification that shows that
(identical? (goog.json.parse "\"a\"") (goog.json.parse "\"a\""))
(identical? (JSON.parse "\"a\"") (JSON.parse "\"a\""))
(identical? (js/eval "\"a\"") (js/eval "\"a\""))
These are going to always be true (in different js environments)I think it mostly comes down to the behavior of JavaScript eval
specification, but I haven’t found any good references stating what “same object instance” guarantees there are around strings in javascript.
Basically, I worry about the possibility of a parser etc to have this behavior instead (identical? "a" (js/String. "a")) ;= false
This relates back to cljs keywords, since they seem to be reliant on the identity semantics of their underlying string
ie
(let [a1 :a
a2 (keyword "a")
a3 (keyword (js/String. "a"))]
[(= a1 a2)
(= a2 a3)
(= a1 a3)])
;;= [true false false]
In clj on jvm, keywords are assured to be unique and interned as a runtime Keyword constructor time cost, so the same concern didn’t apply
Re: keywords and identical? in cljs: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#data-structures and some background: https://groups.google.com/forum/#!msg/clojurescript/bSFK6CEE3PE/nIoD11yjK_YJ
So my question is targeted at what we can rely on from JS when it comes to string identity.
Good chance this behavior is covered in the ECMA-262 spec? it’s a pretty small document
Yeah. I guess my concern was relying on thing like JSON parsers. If they have me new String() behavior unexpectedly then calling keyword
on them would produce non =
keywords.
I tried finding In spec. I'll have to look closer I guess. Seems to be a hard search topic to. I appreciate your inputs though.
point being I don’t think any of the browser native JSON parsers exhibit this behavior
I was just trying to find any sort of “guarantee” of that because I started to question it in my head.
hi! is there something similar to redux-dev-tools for figwheel? I'm looking for a way to track/debug/timetravel the state of a webapp...
On the JVM side, I actually have been burned by JVM deserialization bringing in boolean values with new Boolean()
, which CLJ doesn’t interact well with (relies on singleton Boolean/TRUE | FALSE). So I guess I am just paranoid of those types of things happening in deserialization layers.
JS is a different world though of course.