Emit warning when compiling macro to function in non-self host environment
Description
I have defined a macro in a .cljc file:
Sometimes (but not always) I would see an error in the browser logs:
Why is a compile time macro ending up as a run time function in the target JS? Quite a surprise. After a discussion on Slack this turned out to be related to self-hosted ClojureScript. The conversation in Slack is recorded in the attachment slack.txt.
I have defined a macro in a .cljc file:
Sometimes (but not always) I would see an error in the browser logs:
Why is a compile time macro ending up as a run time function in the target JS? Quite a surprise. After a discussion on Slack this turned out to be related to self-hosted ClojureScript. The conversation in Slack is recorded in the attachment slack.txt.
The library https://github.com/cgrand/macrovich turned out to have the solution for me.
It would be helpful if the compiler did not generate a run-time function from a macro in non-self hosted mode, or at least emit a warning.