Mikowski, M. S. and Powell, Josh C. (2014) Single Page Web Applications – JavaScript End-To-End, Manning
Download eBook PDF (PDF 13,364KB)
Download Source Code (ZIP 12,456KB)
In Single Page Web Applications you’ll learn to build modern browser-based apps that take advantage of stronger client platforms and more predictable bandwidth. You’ll learn the SPA design approach, and then start exploring new techniques like structured JavaScript and responsive design. And you’ll learn how to capitalize on trends like server-side JavaScript and NoSQL data stores, as well as new frameworks that make JavaScript more manageable and testable as a first-class language.
If your website is a jumpy collection of linked pages, you are behind. Single page web applications are your next step: pushing UI rendering and business logic to the browser and communicating with the server only to synchronize data, they provide a smooth user experience, much like a native application. But, SPAs can be hard to develop, manage, and test.
Single Page Web Applications shows how your team can easily design, test, maintain, and extend sophisticated SPAs using JavaScript end-to-end, without getting locked into a framework. Along the way, you’ll develop advanced HTML5, CSS3, and JavaScript skills, and use JavaScript as the language of the web server and the database.
This book assumes basic knowledge of web development. No experience with SPAs is required.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
What’s Inside
- Design, build, and test a full-stack SPA
- Best-in-class tools like jQuery, TaffyDB, Node.js, and MongoDB
- Real-time web with web sockets and Socket.IO
- Touch controls for tablets and smartphones
- Common SPA design mistakes
Part 1 Introducing SPAs
1. Our first single page application
1.1. Definition, a little history, and some focus
1.2. Build our first SPA
1.3. The user benefits of a well-written SPA
1.4. Summary
2. Reintroducing JavaScript
2.1. Variable scope
2.2. Variable hoisting
2.3. Advanced variable hoisting and the execution context object
2.4. The scope chain
2.5. JavaScript objects and the prototype chain
2.6. Functions—a deeper look
2.7. Summary
Part 2 The SPA client
3. Develop the Shell
3.1. Grok the Shell
3.2. Set up the files and namespaces
3.3. Create the feature containers
3.4. Render the feature containers
3.5. Manage the feature containers
3.6. Manage application state
3.7. Summary
4. Add feature modules
4.1. The feature module strategy
4.2. Set up feature module files
4.3. Design method APIs
4.4. Implement the feature API
4.5. Add frequently needed methods
4.6. Summary
5. Build the Model
5.1. Understand the Model
5.2. Set up the Model and other files
5.3. Design the people object
5.4. Build the people object
5.5. Enable sign-in and sign-out in the Shell
5.6. Summary
6. Finish the Model and Data modules
6.2. Build the chat object
6.3. Add Avatar support to the Model
6.4. Complete the Chat feature module
6.5. Create the Avatar feature module
6.6. Data binding and jQuery
6.8. Summary
Part 3 The SPA server
7. The web server
7.1. The role of the server
7.2. Node.js
7.3. Advanced routing
7.5. Web sockets and Socket.IO
7.6. Summary
8. The server database
8.1. The role of the database
8.2. An introduction to MongoDB
8.3. Use the MongoDB driver
8.4. Validate client data
8.5. Create a separate CRUD module
8.6. Build the Chat module
8.7. Summary
9. Readying our SPA for production
9.1. Optimize our SPA for search engines
9.2. The cloud and third-party services
9.3. Caching and cache busting
9.4. Summary
Appendix A: JavaScript coding standard
Appendix B: Testing an SPA
Today’s web technologies are evolving at near-light speed, bringing the promise of a seamless Internet ever closer to reality. When users can browse the Web on a three-inch phone screen as easily as on a fifty-inch HDTV, what’s a developer to do?
Peter Gasston’s The Modern Web will guide you through the latest and most important tools of device-agnostic web development, including HTML5, CSS3, and JavaScript. His plain-English explanations and practical examples emphasize the techniques, principles, and practices that you’ll need to easily transcend individual browser quirks and stay relevant as these technologies are updated.
Learn how to:
- Plan your content so that it displays fluidly across multiple devices
- Design websites to interact with devices using the most up-to-date APIs, including Geolocation, Orientation, and Web Storage
- Incorporate cross-platform audio and video without using troublesome plug-ins
- Make images and graphics scalable on high-resolution devices with SVG
- Use powerful HTML5 elements to design better forms
Turn outdated websites into flexible, user-friendly ones that take full advantage of the unique capabilities of any device or browser. With the help of The Modern Web, you’ll be ready to navigate the front lines of device-independent development.
Table of Contents
Chapter 1: The Web Platform
Chapter 2: Structure and Semantics
Chapter 3: Media Queries and Responsive Design
Chapter 4: CSS Layouts
Chapter 5: New JavaScript and Libraries
Chapter 6: Device APIs (PDF)
Chapter 7: SVG / Canvas / WebGL
Chapter 8: HTML5 forms
Chapter 9: Media (Audio/Video)
Chapter 10: Packing it All Up
Chapter 11: The Future
Appendix A: Notes on browser support
Appendix B: Resources