Start simple, keep simple.
- CommonJS modules
- Browserify
- npm run scripts
- Makefile
- simple build script
Remove all state from modules.
- DI
- Schedulers for timers etc.
- Use an explicit messaging in view hierarchy
Create independent component views.
- React
- structure assets (js, css/scss, images) by component
Include a proper Promise library and use it everywhere in async functions.
- Q, native Promises + prollyfill, etc.
- Always resolve with a single value
- Always reject with an instance of Error
- Always either end the chain (like Q's done()) or return a promise
- Be careful with nesting in promise chains, keep the chain shallow
Use custom Error types.
- Extend Error object properly
- Do custom error checking in Promise chains
- Bubble errors in the defined messaging hierarchy
Use JsDoc (?).
-
Generate documentation
-
Help tern.js etc. in autocompletion
-
Google Closure compiler + type annotations?
- Override e.g. DEBUG mode from command line to remove logging?
- Use with JsDoc for type checking
- Lint everything (JSHint, ESLint, JSCS)
- Use null instead of undefined as an explicit missing value, undefined for something that is not yet defined