Future JS @ Wu

List of JS Problems


  • Dependencies / Modularity
  • Organize modules / Framework
  • Testing
  • building

Modularity




Put your code in small boxes, so you don't 
have to see it all the time / also great for testing


(Schnappi-responsive <==> Schnappi-simulator)

Solution: requirejs

(or almond, etc)

Pros
  • lazy loading available
  • nice syntax
  • coffeescript support

Cons
  • Added filesize: 16kb
  • too much configuration needed
  • if lazyloading on reversioning of files
  • you have to maintain the main.js file

Solution: ES6


Pros
  • the future
  • lots of async stuff and syntactic sugar on the top
  • 0 kb added to production app


Cons

  • Build process needed or traceur-compiler

Solution: use framework

(in our case angular.js)


Pros
  • adds nice way to structure your code
  • adds cool stuff like two-way binding


Cons

  • adds 100kb to your code
  • sometimes more than needed

Organization





Solution: Framework


Pros

  • Lots of features
  • well documented
  • not application specific


Cons

  • Adds some unused features / code

Solution: own controller



Pro

  • Just as much code as you need
  • Only the features you need

Con

  • more work, more mistakes to be made

Testing

Future JS @ Wu

By Daniel Schmidt