RaveJS/rave — pull request #62 by unscriptable (2014-09-17 19:46:02+00:00)
Title: Make rave default to "debug mode".

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
- [ ] override production code eval modules with debuggable versions at run time when in "debug mode"
- [ ] set rave's default mode to "debug mode"
- [ ] load debug modules *after* loading the app's metadata (not before, as is done now)
- [ ] 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
- [ ] remove code to sniff data-debug or other data-* attrs (leaving only data-rave-meta to find the correct metadata file(s))
- [ ] implement per-package config to allow devs to set debug levels and other options per package