O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modern JavaScript

Book Description

It's not uncommon these days to see people complaining about just how complex JavaScript development seems to have become. We can have some sympathy with that view when it's coming from someone new to the language. If you're learning JS, it won't take long for you to be exposed to the enormity of the ecosystem and the sheer number of moving pieces you need to understand (at least conceptually) to build a modern web application. Package management, linting, transpilation, module bundling, minification, source maps, frameworks, unit testing, hot reloading... it can't be denied that this is a lot more complex that just including a couple of script tags in your page and FTPing it up to the server.



Included topics:

  • The Anatomy of a Modern JavaScript Application by James Kolce
  • An Introduction to Gulp.js by Craig Buckler
  • The Basics of DOM Manipulation in Vanilla JavaScript (No jQuery) by Sebastian Seitz
  • A Beginner's Guide to Webpack 2 and Module Bundling by Mark Brown
  • React vs Angular: An In-depth Comparison by Pavels Jelisejevs
  • Retrofit Your Website as a Progressive Web App by Craig Buckler
  • 10 Tips to Become a Better Node Developer by Azat Mardan
  • An Introduction to Functional JavaScript by M. David Green
  • An Introduction to Chart.js 2.0 : Six Simple Examples by Jack Rometty
  • Learning JavaScript Test-Driven Development by Example by James Wright


This book is for intermediate level JavaScript developers. Some experience of JavaScript development is assumed.

Table of Contents

  1. Modern JavaScript
  2. Notice of Rights
  3. Notice of Liability
  4. Trademark Notice
  5. About SitePoint
  6. Conventions Used
  7. Chapter 1: The Anatomy of a Modern JavaScript Application
    1. A Note about Node.js
    2. JavaScript ES2015+
    3. Modular Code
    4. Package Management
    5. Build Tools
    6. Application Architecture
    7. Deployment
    8. Conclusion
  8. Chapter 2: An Introduction to Gulp.js
    1. That Sounds Scarily Complicated!
    2. Task Runners: the Options
    3. What About Gulp 4?
    4. Step 1: Install Node.js
    5. Step 2: Install Gulp Globally
    6. Step 3: Configure Your Project
    7. Step 4: Install Gulp Locally
    8. Step 4: Create a Gulp Configuration File
    9. Step 5: Create Gulp Tasks
    10. Step 6: Automate Tasks
    11. Step 7: Profit!
  9. Chapter 3: The Basics of DOM Manipulation in Vanilla JavaScript (No jQuery)
    1. DOM Manipulation: Querying the DOM
    2. Modifying Classes and Attributes
    3. Modifying the DOM
    4. Listening to events
    5. Animation
    6. Writing your own helper methods
    7. Demo
    8. Conclusion
  10. Chapter 4: A Beginner's Guide to Webpack 2 and Module Bundling
    1. Setup
    2. Modules
    3. Loaders
    4. Plugins
    5. Code Splitting
    6. Webpack Dev Server
    7. HTTP/2
    8. Over to You
  11. Chapter 5: React vs Angular: An In-depth Comparison
    1. Where to Start?
    2. Maturity
    3. Features
    4. Languages, Paradigms, and Patterns.
    5. Ecosystem
    6. Adoption, Learning Curve and Development Experience
    7. Putting it Into Context
    8. One Framework to Rule Them All?
  12. Chapter 6: Retrofit Your Website as a Progressive Web App
    1. What Are Progressive Web Apps?
    2. Demonstration Code
    3. Step 1: Enable HTTPS
    4. Step 2: Create a Web App Manifest
    5. Step 3: Create a Service Worker
    6. Bonus Step 4: Create a Useful Offline Page
    7. Development Tools
    8. PWA Gotchas
    9. Useful Links
  13. Chapter 7: 10 Tips to Become a Better Node Developer
    1. Avoid Complexity
    2. Use Asynchronous Code
    3. Avoid Blocking require
    4. Know That require Is Cached
    5. Always Check for Errors
    6. Return Callbacks or Use if ... else
    7. Listen to the error Events
    8. Know Your npm
    9. Conclusion
  14. Chapter 8: An Introduction to Functional JavaScript
    1. Imperative JavaScript
    2. Object-Oriented JavaScript
    3. Functional JavaScript
    4. Start Thinking Functionally
  15. Chapter 9: An Introduction to Chart.js 2.0 — Six Simple Examples
    1. Why Chart.js?
    2. Installing Chart.js
    3. Line Chart
    4. Bar Chart
    5. Radar Charts
    6. Polar Charts
    7. Pie & Doughnut Charts
    8. Configuring Chart.js
    9. Handling Events
    10. A Concrete Example
    11. Chart.js 2.0 vs 1.0
    12. Conclusion
  16. Chapter 10: Learning JavaScript Test-Driven Development by Example
    1. What is TDD?
    2. Benefits of TestDriven Development
    3. TestDriven Development With JavaScript
    4. Refactoring Our Validator
    5. Wrapping Up