We've been having a hell of a time debugging rave-based projects. The problems have been primarily due to bugs in browsers and browser debuggers when using the most efficient method for evaluating source code: new Function(source). There are few tickets for these bugs, but they have been neglected, some for years. I implemented some alternative versions of code evaluation functions using script injection and these are much, much more debuggable. Script injection isn't nearly as efficient, so we don't want to use this in production (ignoring CSP environments for now).
Obviously, decent debugging should be the default regardless of CPU, memory, and code bulk during development.
This got me thinking. After a quick convo with @briancavalier, I'm thinking that rave should be in "debug mode" by default. Debugging should be "off" only when building for production or when explicitly specified by the developer.
[X] implement code eval modules that use script injection
[x] override production code eval modules with debuggable versions at run time when in "debug mode"
[x] set rave's default mode to "debug mode"
[x] load debug modules instead of production modules in rave/rave and rave/auto
[x] remove code to sniff data-debug or other data-* attrs (leaving only data-rave-meta to find the correct metadata file(s))
[x] add the rave global object (the "REPL") automatically. don't force the dev to type rave()
[x] only load addSourceUrl module when in debug mode
I decided to defer these until later:
[ ] implement rave metadata-based config (which will allow devs to set "debug":false)
[ ] configure rave using a "config" property under the "rave" property in the app's package.json or bower.json
[ ] implement per-package config to allow devs to set debug levels and other options per package
We've been having a hell of a time debugging rave-based projects. The problems have been primarily due to bugs in browsers and browser debuggers when using the most efficient method for evaluating source code:
new Function(source)
. There are few tickets for these bugs, but they have been neglected, some for years. I implemented some alternative versions of code evaluation functions using script injection and these are much, much more debuggable. Script injection isn't nearly as efficient, so we don't want to use this in production (ignoring CSP environments for now).Obviously, decent debugging should be the default regardless of CPU, memory, and code bulk during development.
This got me thinking. After a quick convo with @briancavalier, I'm thinking that rave should be in "debug mode" by default. Debugging should be "off" only when building for production or when explicitly specified by the developer.
rave()
I decided to defer these until later:
"debug":false
)