JavaScript at Scale
eBook - ePub

JavaScript at Scale

Adam Boduch

Buch teilen
  1. 266 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

JavaScript at Scale

Adam Boduch

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Have you ever come up against an application that felt like it was built on sand? Maybe you've been tasked with creating an application that needs to last longer than a year before a complete re-write? If so, JavaScript at Scale is your missing documentation for maintaining scalable architectures.

There's no prerequisite framework knowledge required for this book, however, most concepts presented throughout are adaptations of components found in frameworks such as Backbone, AngularJS, or Ember.

All code examples are presented using ECMAScript 6 syntax, to make sure your applications are ready for next generation browsers.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist JavaScript at Scale als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu JavaScript at Scale von Adam Boduch im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatica & Programmazione in JavaScript. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2015
ISBN
9781785282157

JavaScript at Scale


Table of Contents

JavaScript at Scale
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Scale from a JavaScript Perspective
Scaling influencers
The need for scale
Growing user base
Building new features
Hiring more developers
Architectural perspectives
The browser is a unique environment
Component design
Component communication
Load time
Responsiveness
Addressability
Configurability
Making architectural trade-offs
Defining your constants
Performance for ease of development
Configurability for performance
Performance for substitutability
Ease of development for addressability
Maintainability for performance
Less features for maintainability
Leveraging frameworks
Frameworks versus libraries
Implementing patterns consistently
Performance is built in
Leverage community wisdom
Frameworks don't scale out-of-the-box
Summary
2. Influencers of Scale
Scaling users
License fees
Subscription fees
Consumption fees
Ad-supported
Open source
Communicating users
Support mechanisms
Feedback mechanisms
Notifying users
User metrics
Scaling users example
Scaling features
Application value
Killer features versus features that kill
Data-driven features
Competing with other products
Modifying existing features
Supporting user groups and roles
Introducing new services
Consuming real-time data
Scaling features example
Scaling development
Finding development resources
Development responsibilities
Too many resources
Scaling development example
Influencer checklist
User checklist
What's the business model of our software?
Does our application have different user roles?
Do our users communicate with each other using our software?
How do we support our application?
How do we collect feedback from users?
How do we notify users with relevant information?
What type of user metrics should we collect?
Feature checklist
What's the core value proposition of our software?
How do we determine the feasibility of a feature?
Can we make informed decisions about our features?
Who's our competition?
How do we make what we have better?
How do we integrate user management into our features?
Are our features tightly coupled to backend services?
How does the frontend stay synchronized with backend data?
Developer checklist
How do we find the right development resources?
How do we allocate development responsibilities?
Can we avoid hiring too many resources?
Summary
3. Component Composition
Generic component types
Modules
Routers
Models/Collections
Controllers/Views
Templates
Application-specific components
Extending generic components
Identifying common data and functionality
Extending router components
Extending models/collections
Extending controllers/views
Mapping features to components
Generic features
Specific features
Decomposing components
Maintaining and debugging components
Re-factoring complex components
Pluggable business logic
Extending versus configuring
Stateless business logic
Organizing component code
Summary
4. Component Communication and Responsibilities
Communication models
Message-passing models
Event models
Communication data schema
Naming conventions
Data format
Common data
Traceable component communication
Subscribing to events
Globally-logging events
Event lifecycle
Communication overhead
Event frequency
Callback execution time
Callback complexity
Areas of communication responsibility
Backend API
Web socket updates
DOM updates
Loosely-coupled communication
Substituting components
Handling unexpected events
Component layers
Event flow direction
Mapping to developer responsibilities
Mentally mapping the code
Summary
5. Addressability and Navigation
Approaches to routing
Hash URIs
Traditional URIs
How routers work
Router responsibilities
Router events
URI parts and patterns
Encoding information
Designing URIs
Mapping resources to URIs
Building URIs manually
Automating resource URIs
Triggering routes
User actions
Redirecting users
Router configuration
Static route declarations
Registration events
Deactivating routes
Troubleshooting routers
Conflicting routes
Logging initial configuration
Logging route events
Handling invalid resource states
Summary
6. User Preferences and Defaults
Preference types
Locales
Behavior
Appearance
Supporting locales
Deciding on locales to support
Maintaining locales
Setting the locale
Choosing locales
Storing locale preferences
Locales in URIs
Generic component configuration
Deciding on configuration values
Stored and hard-coded default values
Backend implications
Loading configuration values
Configuring behavior
Enabling and disabling components
Changing quantities
Changing order
Configuring notifications
Inline options
Changing the look and feel
Theme tools
Selecting a theme
Individual style preferences
Performance implications
Configurable locale performance
Configurable behavior performance
Configurable theme performance
Summary
7. Load Time and Responsiveness
Component artifacts
Component dependencies
Building components
Loading components
Loading modules
Lazy module loading
Module load latency
Communication bottlenecks
Reducing indirection
Profiling code
Component optimization
Components that maintain state
Dealing with side-effects
DOM rendering techniques
API data
Load latency
Working with large data sets
Optimizing components at runtime
Summary
8. Portability and Testing
Decoupling the backend
Mocking the backend API
Frontend entry points
Mocking tools
Generating mock data sets
Performing actions
Feature design process
Designing the API
Implementing the mock
Implementing the feature
Reconciling mock data with API data
Unit testing tools
Tools built into frameworks
Standalone unit testing tools
Toolchains and automation
Testing mock scenarios
Mock APIs and test fixtures
Scenario generation tools
End-to-end tests and continuous integration
Summary
9. Scaling Down
Scaling constraints
JavaScript artifact size
Network bandwidth
Memory consumption
CPU consumption
Backend capabilities
Conflicting features
Overlapping functionality
Irrelevant features
Customer demand
Design failures
Unnecessary components
Inefficient data processing
Excessively creative markup
Application composition
Feature enablement
New feature impact
Essential libraries
Summary
10. Coping with Failure
Failing fast
Using quality constraints
Providing meaningful feedback
When we can't fail fast...
Fault tolerance
Classifying critical behavior
Detecting and containing errant behavior
Disabling defective components
Gracefully degrading functionality
Failure recovery
Retrying failed operations
Restarting components
Manual user intervention
When we can't recover from failures...
Performance and complexity
Exception handling
State checking
Notifying other components
Logging and debugging
Meaningful error logs
Warning about potential failures
Informing and instructing users
Improving the architecture
Documenting failure scenarios
Improving component classification
Complexity promotes failure
Summary
Index

JavaScript at Scale

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2015
Production reference: 1270715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-215-7
www.packtpub.com

Credits

Author
Adam Boduch
Reviewers
August N. Marcello III
Yogesh Singh
Nikolay Sokolov
Serkan Yersen
Commissioning Editor
Edward Gordon
Acquisition Editors
Kevin Colaco
Owen Roberts
Content Development Editor
Divij Kotian
Technical Editor
Ryan Kochery
Copy Editor
Angad Singh
Project Coordinator
Nikhil Nair
Proofreader
Safis Editing
Indexer
Rekha Nair
Graphics
Jason Monteiro
Production Coordinator
Melwyn Dsa
Cover Work
Melwyn Dsa

About the Author

Adam Boduch has been involved with large-scale JavaScript development for nearly 10 years. Before moving to the frontend, he worked on several large-scale cloud computing products using Python and Linux. No stranger to complexity, Adam has practical experience with real-world software systems and the scaling challenges they pose. He is the author of several JavaScript books, including Lo-Dash Essentials, and is passionate about innovative user experiences and high performance.
Adam lives in Toronto and is a senior software engineer at Virtustream.

About the Reviewers

August N. Marcello III is a highly passionate software engineer with nearly 2 decades of experience in the design, implementation, and deployment of modern client-side web application architectures in the enterprise. An exclusive focus on delivering compelling SaaS based user experiences throughout the web ecosystem has proven both personally and professionally rewarding for him. His passion for emerging techno...

Inhaltsverzeichnis