| ES6| Browserify| Web Stater Kit| Jade| LESS| SASS| Mocha |--- |--- |--- |--- |--- |--- |--- |--- |---
-
the runtime's specs minified and specs un-minified
-
angular/di.js have an issue angular/di.js#95 that fails on minified code.
But there is a work around documented on the issue report.Found out where the issue is. Uglify converts
var Foo = function Foo () {}intovar Foo = function () {}. Therefore, Foo.name is undefined and the di framework doesn't detect that given function is a class another work around is:// instead of class Foo {} // do class Foo { get name () { return 'Foo' } }
and improve class detection by
isClassfunction fromsrc/util.js -
if a generator's logic is sync, c0 will behave sync (different from co v3.1.0). The side effect is that if an error is throw within the body of the callback, this exception will be simply ignored tj/co#92
The solution is to simply to wrap the callback in a setImmediate, and use
process.on('uncaughtException', function () {})c0(function * gen () { // do stuff })(setImmediate(function (err) { // gen has finished }))
The down side of this approach, is that you can't really do this on the browser. But what it can be done is to patch the global setImmediate, here is a naive approach, which works with c0 only.
function fakeSetImmediate (fn) { return (err) => { setImmediate(() => { try { fn(err) } catch (e) { // handle error } }) } }
Botton line, error handling in JavaScript is hard, and is beyond the scope of this project to fix it. Take a look at angular/zone.js for more robust patchers.
This repo's purpose is for testing libraries, framework (and their interaction) I intend to use on my personal projects.
npm install --global gulp
This will install Gulp globally. Depending on your user account, you may need to gain elevated permissions using sudo (i.e sudo npm install --global gulp). Next, clone this repo and install the local dependencies runtime requires:
git clone --depth=1 https://github.com/markuz-brasil/runtime.git
cd runtime
npm installThat's it! You should now have everything needed to begin hacking on runtime.
You can now use Gulp with the following commands to stay productive during development:
gulp# minimal dev mode (faster)
gulp watch serve dev
# full build mode (longer)
gulp watch serve buildNow direct your browser to http://localhost:3000/