March 16, 2015
NodeJS for Distributed Systems, Webpack, Angular 2 @ JS Meetup
Why use nodejs to build distributed systems? by Gord Tanner
- js was event based from the start – browser vendors didn’t want bad web developer code to stop their browsers from running
- nodejs’ event-loop makes it easier to handle concurrency. Promises, callbacks, and queues force you to keep things simpler than mutexes, semaphores, locking, shared memory
- Always test your distributed app is a distributed environment. How about multiple Vagrant VMS? This is very different from firing up a few nodejs processes in your local machine where processes share RAM and a hard drive
Intro to WebPack with Tasveer Singh
- old build tools merged all JS into a single file and uglified it
- too much js parsing up front for mobile browsers when page loads
- if 1 character of js changes, the entire merged file must be downloaded by users again
- requirejs – importing dependencies is easy to mess up with typos
- so try WebPack! It is big and complicated, but you can use it if you just believe, and the output is great!
- inlining images to reduce HTTP requests
- support for compilation tools for coffee script, babel
- great support for merging lots of js files into a few modules – developers can find the balance between reducing HTTP requests and downloading too much code at once
- watch out for asynchronously loading CSS – as more CSS loads and renders, conflicting rules lead to styles changing in unexpected places
Angular 2 with Matias Niemelä
- Here’s ngtube ported to Angular 2 to learn from
- Here’s an awesome talk on ES7 – which is even more future-y