Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf

所需积分/C币:24 2019-11-02 22:44:04 8.27MB PDF
0
收藏 收藏
举报

This book will serve as an introduction to both new and well established libraries and frameworks, such as Angular, VueJS, React, Grunt, Yeoman, RequireJS, Browserify, Knockout, Kraken, Async.js, Underscore, and Lodash. It also covers utilities that have gained popular traction and support from seas
Javascript frameworks for Modern Web Development Sufyan bin Uzayr Nicholas cloud Al Manama, United Arab emirates Florissant, MO, uSA Tim Ambler Nashville, TN, usa ISBN-13(pbk):978-1-4842-49949 ISBN-13( electronic):978-1-4842-4995-6 htp:/ doi. org/10.1007/978-1-4842-49956 Copyright o 2019 by Sufyan bin Uzayr, Nicholas Cloud, Tim Ambler This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the ap 5 b Known or hereafter developed Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol wit every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in trademark The use in this publication of trade names trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director, Apress Media LLC: Welmoed Spahi Acquisitions Editor: Louise Corrigan Development Editor: James Markham Coordinating Editor: Nancy Chen Cover designed by eStudio Calamar Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-ny@springer sbm.com,orvisitwww.springeronline.comApressMedia,LlcisaCaliforniaLlcandthesolemember (owner)is Springer Science Business Media Finance Inc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation Forinformationontranslationspleasee-mailrights@apress.comorvisithttp://www.apress.com/ rights- permissions Apress titles may be purchased in bulk for academic, corporate, or promotional use e Book versions and licenses are also available for most titles. For more information reference our Print and eBook bulk sales webpageathttp://www.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readersonGithubviathebooksproductpagelocatedatwww.apress.com/9781484249949.Formore detailedinformationpleasevisithttp://www.apress.com/source-code Printed on acid-free paper For anza -Sufyan bin Uzayr Table of contents About the authors uXO About the technical reviewer xxvii Acknowledgments ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ XIX Introduction xxi Part Development Tools ■■■■■■■口■■■■■ Chapter 1: Grunt maaaa ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■ 3 Installing grunt 4 How grunt works…4 Gruntle js….....………….5 Tasks∴ Pugⅰns.,,,8 Configuration… Adding Grunt to Your Project 889 Maintaining a Sane Grunt Structure Working with Tasks 12 Managing Configurati0n.….,.,.,...,,,…,,…,12 Task Descriptions 13 Asynchronous Tasks ......... 14 Task Dependencies. Multi-Tasks Multi-Task Options Configuration Templates.memmneennmemnnmmnnnnnnnemnmnnonn 19 Command-Line Options 20 Providing Feedback 21 Handling errors…22 TABLE OF CONTENTS Interacting with the File System…,,,,… 22 Source- Destination Mappings…...,…23 Watching for File changes Creating Plugins 31 Getting Started 31 Creating the Task..m....an 32 Publishing to npm.………………………………36 Summary 36 Related resources 37 Chapter 2: Yeoman.at Installing Yeoman 40 Creating Your First Project Subcommands Creating Your First Generator 45 Yeoman generators are Sub- generators.....,.,,...,,,,,,,………………47 Defining Secondary Commands 55 Composability 57 Summary. ■面■ 59 Related resources…59 Chapter 3: PM2 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 61 nstallation,,,…61 Working with Processes 62 Recovering from Errors…… 65 Responding to File Changes. Monitoring Logs. Monitoring Resource Usage Monitoring local resources 70 Monitoring remote Resources TABLE OF CONTENTS Advanced Process Management JSON Application Declarations.ammmaamaaanmnnananmnnnm. 75 oad Balancing Across Multiple Processors Zero downtime Deployments. Summary Related resources ……87 Part lk module loaders ummm 89 Chapter 4: RequireS ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 91 Running the examples .m.....mmmm.m...... 93 Working with RequireS.emaaaenaeaen 94 Installation Configuration 95 Application Modules and Dependencies Paths and aliases… .104 Shims 108 L0 ader p|ugⅰns.,,,,,,,…114 Cache Busting 124 Requires Optimizer. Configuring r js 126 Running the r js command.....,,……,128 Summary Chapter 5: Browserifya mam maemaaIat ug133 TheAMDAPVs.C0mmonJSs…134 Installing Browserify……,, …135 Creating Your First bundle.............mmmm.. 136 Visualizing the Dependency Tree. Creating New Bundles as changes Occur......,,………139 Watching for File Changes with Grunt …139 Watching for File changes with Watchify 140 TABLE OF CONTENTS Using Multiple Bundles. The Node Way.......................,.,…147 Module resolution and the node path environment variable 147 Dependency Management……,…, 152 Defining browser-Specific Modules. Extending browserify with Transforms…,.,.,.,,.,…,…………155 bs…155 folderify 156 bulkily 157 Browserify-Shim 158 Summary 160 Related resources…160 Part lli client-Side frameworks ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 161 Chapter 6: Knockout ■■■■■■■■■■ u163 Views, Models, and view models 164 The recipe list… ■面目 167 Recipe Details. Binding view Models to the DOM .175 View Models and forms Switching to“Edit”Mode….........,…,178 Changing the Recipe Title. Updating Recipe Servings and Cooking Time. 183 Adding and Removing Ingredients. struct0ns………193 Citation, m 195 Custom Components ,196 The Input List view Model The Input list Template 99 Registering the Input List Tag…..,,…201 TABLE OF CONTENTS Subscribable: Cheap Messaging…………204 Summary…,,,,… …208 Resources….08 Chapter 7: Angular aaaasaaanaammaIaaasaiaamIIaIaIii 209 Differences Between Angular and AngularJS 209 Getting Started with Angular 211 Installation 211 Creating a Workspace in Angular 213 Directory Structure. Serving the App…,,,,, 216 Customizing the App. mmnnennnnnnnameeneennonnmnonnnnnnm. 217 Dependency Injection in Angular. Creating and Registering an Injection Service .222 Conclusion 223 Part va server-side frameworks Chapter 8: Kraken mmmamam mmammmnaa mnmmammmmmmn 227 Environment-Aware Configuration 229 Shortstop Handlers .a 234 Configuration- Based Middleware Registration……......,,…239 Event Notifications 243 Structured Route Registration.,……244 Index Configuration. Directory Configuration 247 Routes Configuration 249 Dust Templates 251 Context and references Sections 256 teration…256 Conditionality 258 Partials ,259 TABLE OF CONTENTS Blocks. mmmmmm 261 Filters… 262 Context Helpers Dust helpers.mm. 275 Let's get kraken,…281 Summary. Related resources ,um 306 Part V: Managing database Interaction aaaseamammmmmmmmmmmmmmmmmmmamammassaasaasaannaaaIn 307 Chapter 9: Mongoose mmmm ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■口■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■口■■口■■■ 309 Basic MongoDB concepts . A Simple Mongoose Example meennonnmnnomnnnnnnaennecnnmennmnnmnmonnon 314 Creating a mongoose schema for JsoN Data 314 Importing Data with Mongoose.mmmmammmamnmnonmnaanmnamnmamnmamnnmnmnm 317 Querying Data with Mongoose 320 Working with Schemas…, 323 Data Types….,.,.,.,.,.,,.,,….,…,,…….……323 Nested Schemas 325 Default Property values..........................326 Required Properties. mm. mmmnnmnmnmnmamammmanmnammnnmamamnamnannmnmnn 327 Secondary Indexes...,,,……328 Schema validation 329 Schema references 334 Schema middleware mmm 340 Working with Models and documents 343 Document instance methods Document virtuals………350 Static Model methods 352 Working with Queries ,354 Model findo 355 Model. findByld()….,..,.,,,,,,,,…,,……,357 Model. findByldAndUpdate 360

...展开详情
试读 127P Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
抢沙发
一个资源只可评论一次,评论内容不能少于5个字
  • 分享王者

    成功上传51个资源即可获取
关注 私信 TA的资源
上传资源赚积分or赚钱
    最新推荐
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf 24积分/C币 立即下载
    1/127
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第1页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第2页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第3页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第4页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第5页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第6页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第7页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第8页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第9页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第10页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第11页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第12页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第13页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第14页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第15页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第16页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第17页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第18页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第19页
    Apress.JavaScript.Frameworks.for.Modern.Web.Development.2nd.Edition.pdf第20页

    试读结束, 可继续阅读

    24积分/C币 立即下载 >