This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-25
Channels
- # aws (10)
- # babashka (4)
- # beginners (103)
- # calva (19)
- # chlorine-clover (2)
- # cider (10)
- # cljs-dev (23)
- # cljsrn (6)
- # clojure (145)
- # clojure-europe (17)
- # clojure-nl (1)
- # clojure-spec (11)
- # clojure-uk (4)
- # clojurescript (64)
- # conjure (11)
- # core-async (19)
- # cursive (38)
- # datomic (4)
- # duct (2)
- # fulcro (51)
- # helix (11)
- # joker (1)
- # kaocha (7)
- # leiningen (3)
- # malli (5)
- # meander (3)
- # off-topic (12)
- # pathom (17)
- # pedestal (2)
- # re-frame (27)
- # rum (11)
- # shadow-cljs (77)
- # xtdb (9)
- # yada (1)
There's an interesting issue popped out with Closure library that may require a slight change in cljs's codegen.
Story: Closure's Jsonp
takes an instance of Uri
class, which worked fine before, but now (dunno since when) it requires an instance of TrustedResourceUrl
which in turn can be constructed from goog.string.Const
type that takes a string literal or concatenation of string literals. Now Clojure's str
emits [a,b,c].join('')
which is not recognized by Closure Compiler as a static string concatenation.
Here's a repro https://gist.github.com/roman01la/c00bc4c8b7a3f9715e6bea47278cee4f
Somehow Closure doesn't warn about Uri
not matching required TrustedResourceUrl
type
But then at runtime you'll get [AssertionError]: Failure: expected object of type TrustedResourceUrl, got '123456' of type object
but that's another story
@roman01la you just need to construct the TrustedResourceUrl
yourself. it is a bit annoying to construct but nobody is enforcing the closure rules for this so it doesn't matter that you construct it dynamically
nothing will automatically turn Uri
into a TrustedResourceUrl
so it doesn't matter what str
does
goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract
even more fun 😛
goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract