This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-16
Channels
- # aws-lambda (10)
- # beginners (52)
- # boot (42)
- # cider (2)
- # cljs-dev (8)
- # cljsjs (4)
- # cljsrn (10)
- # clojars (3)
- # clojure (48)
- # clojure-conj (4)
- # clojure-dev (19)
- # clojure-italy (7)
- # clojure-norway (4)
- # clojure-russia (44)
- # clojure-spec (70)
- # clojure-uk (34)
- # clojurescript (39)
- # cursive (35)
- # data-science (11)
- # datomic (7)
- # emacs (6)
- # fulcro (2)
- # hoplon (12)
- # jobs (1)
- # juxt (18)
- # lein-figwheel (2)
- # leiningen (4)
- # luminus (9)
- # off-topic (29)
- # om (46)
- # onyx (131)
- # other-languages (24)
- # parinfer (84)
- # pedestal (10)
- # portkey (45)
- # protorepl (1)
- # re-frame (15)
- # reagent (43)
- # ring-swagger (41)
- # schema (6)
- # shadow-cljs (293)
- # slack-help (2)
- # specter (42)
Question
Are the rules around cljs->js name munging fixed/reliable/standardised?
For example: currently, above-threshold?
is munged into above_threshold_QMARK_
. To what extent can I rely on the munging "formula" staying the same into the future?
Background
Onyx allows you to identify functions with keywords. For example, in their information model you can have a (map) entry like this:
:flow-predicate :my.ns/above-threshold?
Which says to use the function above-threshold?
found in the namespace my.ns
. Onyx is Clojure running on the JVM.
This obviously requires the mapping of namespaced keywords to functions at runtime, in a way that matches original compilation.
So, I'm wondering if this is possible in CLJS? Is the method by which ClojureScript names get munged into javascript names reliable/standard/fixed? Or is this all implementation detail, subject to revision and not to be relied upon?@mikethompson the name will not be available at runtime for :advanced
optimized code unless the function uses ^:export
@thheller oh, of course. :advanced
. Hmm. Thanks.
maybe you could create some tooling to deal with that if you have the onyx configuration available at CLJS compile time
Goog.reflect has some interesting named methods that may help @mikethompson but you would have to experiment
@mikethompson If you maintain identical artifacts on both sides of whatever you're doing, you can pull out the munged name off of the .toString of above-threshold?
even in :advanced