https://github.com/Deraen/clojurescript/commit/bb94e566a8827d0356740491e2506fba02faa109
- Load all
js_transform.clj
files in classpath - Problems:
- files are not real namespaces (no
ns
) load-reader
will eval the code in file each timeload-js-transforms!
is called, which is each timecljs.closure/build
is called- a
js_transform.clj
file is loaded even ifjs-transforms
method from it is not needed- for example, if any lib in classpath has dep on
cljsjs/babel-standalone
- for example, if any lib in classpath has dep on
- files are not real namespaces (no
https://github.com/Deraen/clojurescript/commit/9866a33c78ebf882e5e01d07316d00c7794e8edc
- If
js-transforms
method is not found, but the value is namespaced keyword, try to load namespace pointed by the namespace part of the keyword and runjs-transforms
again in hopes that the namespace provided the method - If namespace doesn't provide the method, there will be a warning about unsupported preprocess value
- Benefits vs. Option 1:
- Real namespaces
- Works with current
cljsjs/babel-standalone
- Minimal change
:preprocess
value should be a symboljs-transforms
multimethod is removed- symbol will point directly at a function, the namespace is required if needed
- Benefits:
- Using a symbol to refer to a function is better than refering to a multimethod using namespaced keyword
:preprocess
should be allowed to be vector of transformations to run?- Would be handled at
process-js-modules
, will work with options 2 and 3
- Would be handled at
Option 3 sounds good to me. I don't think we need to remove
js-transforms
immediately to proceed though. Supporting vectors sounds OK but it seems like an easy thing to add after the main work is done. @thheller I'm not seeing the value of the interceptor model here, since that was done for asynchrony. Is there something you have in mind?