A Build First Approach
Fell out of the skies and would like to learn more about the book?
You could visit its landing page to learn all about it!
Book buying frenzy? Say no more, stranger!
You'll need GraphicsMagick, and also
phantomjs, to run some of the examples. PhantomJS comes in a module that you can conveniently install as a global.
npm install -g phantomjs
GraphicsMagick comes in different distributions for OSX, Linux, and Windows, so please refer to their site to download the appropriate distribution. If you're on Ubuntu, I'd recommend installing it through
apt-get. If you're on OSX, you can use
brew to install it. These kinds of tooling download automation present the most benefits when you automate all of your development environment provisioning, enhancing consistency across fresh installs in your systems. As an example, you can take a look at my dotfiles project, for reference.
Once you have Node and the other tools you'll need, use the command below to clone this repository and install all of the dependencies:
curl https://raw.githubusercontent.com/buildfirst/buildfirst/master/install.sh | sh
If you're on Windows use
That's it! You are now free to roam the sample directories and follow the instructions in each of them!
Manual installation instructions can be found here, but you shouldn't need any of that.
To run an example, read its README.md and follow the instructions I've placed there. I tried to make them as straightforward as possible, but sometimes they might not match the examples in the book to the letter.
There are some examples here that you won't find on the book, those will generally be a bit longer: exactly the reason why I didn't include them in the book. Although the code itself might not be present in the book, most of the explaining will definitely be there, rather than here.
Table of Contents
Here is a complete list of the code samples found in this repository.
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Single Reponsibility Principle
- Information Hiding
- Context Scoping
- Prototypal Modularity
- Common.JS Modules
- Dependency Graphs
- Using RequireJS
- Compiling RequireJS during builds
- Browserify + Common.JS
- Angular.js Dependencies
- Leveraging Bower Packages
- Adopting Component
- Automated Component Build Step
- Circular Dependencies
- Harmony through Traceur, using Grunt
- Chapter 6
- Callback Hell
- Requests Upon Requests
- Error Handling
- Functional Tasks
- Promise Basics
- Promise Flows
- Error Handling Promises
- Event Emitters
- Generator Basics
- Asynchronicity and Generators
- Chapter 7
- Chapter 8
- Your First
tapeIn The Browser
- Arrange Act Assert: Testing An Event Emitter
- Spying on Function Calls
- Proxying Your Dependencies
- DOM Interaction Testing
- Testability Boulevard
- Visual Testing
- Google PageSpeed Insights
- Yahoo YSlow
- Your First
- Chapter 9
- Appendix B: Introduction to Grunt
- Appendix C: Picking Your Build Tool
This is the list of releases to date. You can feel free to simply clone
master, to get the most up-to-date version.
You can find the repository up on GitHub, which contains the latest updates to the samples, and interactively renders the Markdown code in this text, displaying images, making code prettier, styling the text, and letting you follow links.
If you run into any problems, please create an issue here. Maybe it's something that needs fixing. If you feel like contributing, that's awesome! Just fork this repo and create a pull request with your fixes or improvements.
Feedback about the book itself should be posted on the Manning Online Author Forum. You can drop me a line at email@example.com if you want to leave me a more personal note, just say hi, or grunt at me about my failure to amuse you. I'd love to hear from you!
Let the #buildfirst revolution commence!