Single page web applications: JavaScript end-to-end
Gespeichert in:
Beteiligte Personen: | , |
---|---|
Format: | Buch |
Sprache: | Englisch |
Veröffentlicht: |
Shelter Island , NY
Manning
2014
|
Schlagwörter: | |
Links: | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026794049&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
Umfang: | XXII, 407 s. |
ISBN: | 9781617290756 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV041345356 | ||
003 | DE-604 | ||
005 | 20131118 | ||
007 | t| | ||
008 | 131007s2014 xx |||| 00||| eng d | ||
020 | |a 9781617290756 |9 978-1-617290-75-6 | ||
020 | |z 1617290750 |9 1-617290-75-0 | ||
035 | |a (OCoLC)862985020 | ||
035 | |a (DE-599)BVBBV041345356 | ||
040 | |a DE-604 |b ger |e rakwb | ||
041 | 0 | |a eng | |
049 | |a DE-Aug4 |a DE-573 | ||
082 | 0 | |a 005.365 | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
100 | 1 | |a Mikowski, Michael S. |e Verfasser |4 aut | |
245 | 1 | 0 | |a Single page web applications |b JavaScript end-to-end |c Michael S. Mikowski ; Josh C. Powell |
264 | 1 | |a Shelter Island , NY |b Manning |c 2014 | |
300 | |a XXII, 407 s. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a Web-Seite |0 (DE-588)4356308-9 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a JavaScript |0 (DE-588)4420180-1 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a JavaScript |0 (DE-588)4420180-1 |D s |
689 | 0 | 1 | |a Web-Seite |0 (DE-588)4356308-9 |D s |
689 | 0 | |5 DE-604 | |
700 | 1 | |a Powell, Josh C. |e Verfasser |4 aut | |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026794049&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-026794049 |
Datensatz im Suchindex
_version_ | 1819294516896595968 |
---|---|
adam_text | Titel: Single page web applications
Autor: Mikowski, Michael S
Jahr: 2014
contents
foreword xv
preface xvii
ark 11 owledgments xviii
about this hook xx
about the cover ¡.Illustration xxiv
*jthoihtc:ing SPAs .......fr..........................
Our first single page application 3
1.1 Definition, a little history, and some focus 4
A Hille history 4 ¦ What took JavaScript SPAs so longf 5
Our focus 8
1.2 Build our first SPA 9
Define the goal 9m Start the file structure 10 Set up Chrome
Developer Tools 10 ¦ Develop the HTML and CSS 11 • Add
the JavaScript 12 ¦ Inspect our application using Chrome
Developer Tools 17
1.3 The user benefits of a well-written SPA 20
1.4 Summary 21
ix
CONTENTS
ReintroducingJavaScript 23
2.1 Variable scope 25
2.2 Variable hoisting 28
2.3 Advanced variable hoisting and the execution context
object 29
Hoisting 29 ¦ Execution context and the execution context object 31
2.4 The scope chain 34
2.5 JavaScript objects and the prototype chain 37
The prototype chain 40
2.6 Functions—a deeper look 45
Functions and anonymous functions 45 • Self-executing anonymous
functions 46 ¦ The module pattern—bringing private variables to
JavaScript 49vClosures 54
2.7 Summary 57
The SPA client,.,..,»..,»....,,.,,.,,..,.,...,..........--.-- 1
Develop the Shell 61
3.1 Grok the Shell 62
3.2 Set up the files and namespaces 63
Create, the file structure 63 ¦ Write the application HTML 64
Create the root CSS namespace 65 ¦ Create the root JavaScript
namespace 67
3.3 Create die feature containers 68
Pick a strategy 69 - Write the Shell HTML 69 ¦ Write the Shell
CSS 70
3.4 Render the feature containers 72
Convert the HTML to JavaScript 72 ¦ Add an HI ML template to
our JavaScript 74 Write the Shell stylesheet 75 ¦ Direct the
application to use the Shell 77
3.5 Manage the feature containers 78
Write a method to extend or retract the chat slider 78 ¦ Add the t hat
slider click ment handler Si
3.6 Manage application state 85
Understand the behavior browser users expect S5 ¦ Pick a stialeg)
to manage history contrais V5 ¦ Change the anchor when a ¡ustan ^
event occurs 86 ¦ Use the anchor to drive the application slate SS
3.7 Summary 94
Contents
xi
Add feature modules 95
4.1 The feature module strategy 96
A comparison wilh third-party modules 97 ¦ Feature modules and
fractal MVC pattern 99
4.2 Set up feature module files 101
Plan the file structure 101 ¦ Populate the files 102 ¦ What
we ve wrought ¡07
4.3 Design method APIs 108
The anchor interface pattern 109 ¦ Chat configuration
APIs 109 ¦ The Chat initialization API 111 ¦ The Chat
setSliderPosition API 112 • Configuration and. initialization
cascade 112
4.4 Implement the feature API 114
The stylesheets 114 • Modify Chat 119 ¦ Clean up the
Shell 125 ¦ Walk through the execution 130
4.5 Add frequently needed methods 132
The removeSlider method 132 • The handleResize method 134
4.6 Summary 137
Build the Model 139
5.1 Understand the Model 140
What, we re going to build 141 ¦ What the Model does 142
What the Model does not do 142
5.2 Set up the Model and other files 143
Plan, the file structure 143 ¦ Populate the files 145
Use the unified touch-mouse library 1.50
5.3 Design the people object 150
Design the person objects 151 ¦ Design the people object API 153
Document the people object API 156
5.4 Build the people object 157
Create a fake people list 157 ¦ Start the people object 159
Finish the people object 163* Test the people object API 170
5.5 Enable sign-in and sign-out in the Shell 172
Design the user sign-in experience 173 ñ Update the Shell
JavaScript 173 » Update the Shell stylesheet 17.5 ¦ Test sign-in
and sign-out using the UI 176
5.6 Summarv 177
xii
CONTENTS
Finish the Model and Data modules 178
6.1 Design the chat object 179
Design-methods and events 179 ¦ Document the chat object API IH2
6.2 Build the chat object 183
Start the chat object loith the join method 183 ¦ Update Pake to
respond to chat join 185¦ Test the chat join method ¡87 ¦ Add
messaging to the chat object 188 • Update Fake to emulate
messaging 193 a Test chat messaging 195
6.3 Add Avatar support to the Model 196
Add Avatar support to the chat object 196 ¦ Modify Pake to
emulate avatars 198 ¦ Test avatar support 199 ¦ Pest-driven
development 199
6.4 Complete the Chat feature module 201
Update the Chat JavaScript 202 Update the stylesheets 209
Test the Chat UI 213
6.5 Create the Avatar feature module 214
Create the Avatar JavaScript 215 ¦ Create the Avatar stylesheet 219
Update the Shell and the browser document 220 ¦ lest the Avatar
feature module 221
6.6 Data binding and jQuery 222
6.7 Create the Data module 223
6.8 Summary 226
ïT«r8 The SPAskrm-r ¦ -
The web server 229
7.1 The role of the server 229
Authentication and authorization 230 Validation 230
Presentation and synchronization of data 231
7.2 Node.js 231
Why Node, js ? 231 • Create TletloWorhT using Sode js 2 2
Install and use Connect 236 ¦ Add Connect middleieare 2 /
Install and use Express 237 ¦ Add Express middleware 21
Use environments with Express 241 ¦ Sewing static files with
Express 242
7.3 Advanced routing 243
User CHI ID routes 243 - (ienerir CRUl) routing 249 ¦ Place
routing in a separate Node.js module 251
CONTENTS
xiii
7.4 Adding authentication and authorization 255
Basic Authentication 256
7.5 Web sockets and Socket.IO 257
Simple Socket.IO 257* Sockel. 10 and messaging servers 260
Updating JavaScript with Sockel.IO 261
7.6 Summary 264
The server database 265
8.1 The role of the database 266
Select the data store 266 • Eliminate dala transformations 266
Move the logic where you need it 267
8.2 An introduction to MongoDB 268
Document-oriented storage 268 * Dynamic document
structure 269 • Gel started with MongoDB 270
8.3 Use the MongoDB driver 271
Prepare the project files 271 * Install and connect to MongoDB 272
Use MongoDB CRUl) methods 274 • Add CRUD to the sewer
application 277
8.4 Validate client data 281
Validate the. object type 281 ¦ Validate the object 283
8.5 Create a separate CRUD module 290
Prepare the file structure 291 * Move CRUD into its own module 293
8.6 Build the Chat module 299
Start the chat module 299 * Create the adduser message handler 302
Create the updatechat message handler 306 » Create disconnect message
handlers 308 * Create the updateavatar message, handler 309
8.7 Summary 312
Readying our SPA for production 313
9.1 Optimize our SPA for search engines 314
How Google crawls an SPA 314
9.2 The cloud and third-party sendees 317
Site analytics 317 • Logging client-side errors 319 * Content
delivery networks 321
9.3 Caching and cache busting 322
Caching oppominities 322 * Web storage 323 ¦ HTIP
caching 324 ¦ Sewer caching 327 * Database query caching 333
9.4 Summary 334
xiv
CONTENTS
appendix A JavaScript coding standard 335
A.l Why we need a coding standard 335
A.2 Code layout and comments 336
Lay out your code for readability 336 • Comment to explain and
document 343
A. 3 Variable names 345
Reduce and improve comments with a naming convention 346
Use naming guidelines 347 ¦ Put the guidelines to use 354
A.4 Variable declaration and assignment 354
A.5 Functions 356
A.6 Namespaces 358
A. 7 File names and layout 359
A. 8 Syntax 360
Labels 360 * Statements 360 ¦ Other syntax 363
A.9 Validating code 363
InstallJSLint 364 ¦ ConfigureJSLint 364 ¦ UseJSIJnt 365
A. 10 A template for modules 366
A. 11 Summary 368
appendix B Testing an SPA 369
B.l Set up test modes 370
B.2 Select a test framework 373
B.3 Set up nodeunit 374
B.4 Create the test suite 375
Get Node.fs to load our modules 375 ¦ Set up a single nodeunit
test 378 Create our fast real test 379 Map the ei ents and
tests 380 ¦ Create the test suite 382
B.5 Adjust SPA modules for tests 392
B.6 Summary 395
index 397
|
any_adam_object | 1 |
author | Mikowski, Michael S. Powell, Josh C. |
author_facet | Mikowski, Michael S. Powell, Josh C. |
author_role | aut aut |
author_sort | Mikowski, Michael S. |
author_variant | m s m ms msm j c p jc jcp |
building | Verbundindex |
bvnumber | BV041345356 |
classification_rvk | ST 250 |
ctrlnum | (OCoLC)862985020 (DE-599)BVBBV041345356 |
dewey-full | 005.365 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.365 |
dewey-search | 005.365 |
dewey-sort | 15.365 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01402nam a2200373 c 4500</leader><controlfield tag="001">BV041345356</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20131118 </controlfield><controlfield tag="007">t|</controlfield><controlfield tag="008">131007s2014 xx |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781617290756</subfield><subfield code="9">978-1-617290-75-6</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="z">1617290750</subfield><subfield code="9">1-617290-75-0</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)862985020</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV041345356</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakwb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-Aug4</subfield><subfield code="a">DE-573</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.365</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Mikowski, Michael S.</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Single page web applications</subfield><subfield code="b">JavaScript end-to-end</subfield><subfield code="c">Michael S. Mikowski ; Josh C. Powell</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Shelter Island , NY</subfield><subfield code="b">Manning</subfield><subfield code="c">2014</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXII, 407 s.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Web-Seite</subfield><subfield code="0">(DE-588)4356308-9</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Web-Seite</subfield><subfield code="0">(DE-588)4356308-9</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Powell, Josh C.</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026794049&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-026794049</subfield></datafield></record></collection> |
id | DE-604.BV041345356 |
illustrated | Not Illustrated |
indexdate | 2024-12-20T16:45:18Z |
institution | BVB |
isbn | 9781617290756 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-026794049 |
oclc_num | 862985020 |
open_access_boolean | |
owner | DE-Aug4 DE-573 |
owner_facet | DE-Aug4 DE-573 |
physical | XXII, 407 s. |
publishDate | 2014 |
publishDateSearch | 2014 |
publishDateSort | 2014 |
publisher | Manning |
record_format | marc |
spellingShingle | Mikowski, Michael S. Powell, Josh C. Single page web applications JavaScript end-to-end Web-Seite (DE-588)4356308-9 gnd JavaScript (DE-588)4420180-1 gnd |
subject_GND | (DE-588)4356308-9 (DE-588)4420180-1 |
title | Single page web applications JavaScript end-to-end |
title_auth | Single page web applications JavaScript end-to-end |
title_exact_search | Single page web applications JavaScript end-to-end |
title_full | Single page web applications JavaScript end-to-end Michael S. Mikowski ; Josh C. Powell |
title_fullStr | Single page web applications JavaScript end-to-end Michael S. Mikowski ; Josh C. Powell |
title_full_unstemmed | Single page web applications JavaScript end-to-end Michael S. Mikowski ; Josh C. Powell |
title_short | Single page web applications |
title_sort | single page web applications javascript end to end |
title_sub | JavaScript end-to-end |
topic | Web-Seite (DE-588)4356308-9 gnd JavaScript (DE-588)4420180-1 gnd |
topic_facet | Web-Seite JavaScript |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026794049&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT mikowskimichaels singlepagewebapplicationsjavascriptendtoend AT powelljoshc singlepagewebapplicationsjavascriptendtoend |