Skip to content

markuz-brasil/runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

| ES6| Browserify| Web Stater Kit| Jade| LESS| SASS| Mocha |--- |--- |--- |--- |--- |--- |--- |--- |---

Cavets

  • 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 () {} into var 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 isClass function from src/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.

Goal

This repo's purpose is for testing libraries, framework (and their interaction) I intend to use on my personal projects.

Quickstart

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 install

That's it! You should now have everything needed to begin hacking on runtime.

Gulp Commands

You can now use Gulp with the following commands to stay productive during development:

Build & Optimize
gulp
Watch For Changes & Automatically Refresh Across Devices
# minimal dev mode (faster)
gulp watch serve dev

# full build mode (longer)
gulp watch serve build

Now direct your browser to http://localhost:3000/

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published