tolitius / mount

managing Clojure and ClojureScript app state since (reset)
Eclipse Public License 1.0
1.23k stars 89 forks source link

cljs: optimize state names in :advance mode #59

Open jiangts opened 8 years ago

jiangts commented 8 years ago

The cljs version of mount only allows states to be named as strings.

For example, on the example cljs app: https://github.com/tolitius/mount/blob/0825ad2ed085b73b7ae989b4382ce4e0376e4be3/dev/cljs/app/example.cljs the app.audit-log/log state is named as a string like this: (js/setTimeout #(mount/stop-except "#'app.audit-log/log") 500)

Since the cljs compiler never munges strings, having a lot of long namespaces will result in a lot of un-optimized references to mount states. It'd be awesome to find a way to optimize the mount state names as well during :advanced compile!

tolitius commented 8 years ago

would be indeed. need to think about the way to make it happen. thanks for bringing it up.