Hi there,
I have a macro for use in cljs that injects code to make a function call to a function in a cljs namespace. Now when I use that macro I have to :require the corresponding cljs namespace or during compilation I am flooded with superfluous: "WARNING: Use of undeclared Var mycljsnamespace/func at line ...." messages.
Is there a way to make the use of the macro in a cljs namespace add the cljs require statement to ensure that these warnings are suppressed?
and when using it, the compilation looks like:
WARNING: Use of undeclared Var infinitelives.pixi.canvas/get-default-canvas at line 15 src/cljs/...
WARNING: Use of undeclared Var infinitelives.pixi.canvas/get-default-canvas at line 15 src/cljs/...
WARNING: Use of undeclared Var infinitelives.pixi.canvas/get-default-canvas at line 11 src/cljs/...
...
at this stage in my present project its at least 50 lines of these.
if I require that name space in the client code that warning disappears but that requires the user of the macro to know that in advance, and be disciplined enough to do it.
How do I *auto require* the namespace, when the macro is used?
In it, Jozef Wagner states: "AFAIK there is no way to do this automatically"
Is this still the case?
I see CLJS has supported since 1.9.293 : CLJS-1346: Support require outside of ns
Can I make the macro inject the require into its output code so the "WARNING: Use of undeclared Var" is not emmitted?
I have experimented with this but have been unable to make it work.
Is this possible to do? If so, how can this be done?
Regards
Crispin