This page is not created by, affiliated with, or supported by Slack Technologies, Inc.


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


but besides that the munge function hasn’t changed in forever


@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


@favila @john thankyou