mfikes/ambly

Eliminate embedded bootstrap JS

mfikes opened this issue · 0 comments

-[ABYContextManager bootstrapWithDepsFilePath:googBasePath:] imitates the bootstrapping code in ambly.core/setup, but contains a vulgar copy of the JS code generated for this bit of logic:

(do
  (set! *loaded-libs* #{"cljs.core"})
  (set! (.-require js/goog)
    (fn [name reload]
      (when (or (not (contains? *loaded-libs* name)) reload)
        (set! *loaded-libs* (conj (or *loaded-libs* #{}) name))
        (js/CLOSURE_IMPORT_SCRIPT
          (aget (.. js/goog -dependencies_ -nameToPath) name)))))))

This is messy, and can probably be re-written directly in Objective-C.