JavaScript at Scale
eBook - ePub

JavaScript at Scale

Adam Boduch

Condividi libro
  1. 266 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

JavaScript at Scale

Adam Boduch

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
JavaScript at Scale è disponibile online in formato PDF/ePub?
Sì, puoi accedere a JavaScript at Scale di Adam Boduch in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatica e Programmazione in JavaScript. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
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...

Indice dei contenuti