Hales opens the book with a discussion of “modern” client-side architecture, devoting the first four chapters not to specific technologies, but instead to designing loosely coupled “Mobile First” front-ends. As you might have guessed, this means that we spend some time talking about client-side templates;4 about how to approach fluid, “native-feeling” user experiences; and about how to reason about, build, and deploy the front-end piece of your technology stack. Again, as Hales is presenting us with a “Mobile First”5 approach, a lot of attention is given to performance — how to keep components lightweight, how to minimize network overhead, how to design for connectivity interruptions, and how to keep battery consumption down. Overall, it’s a very strong first half — and by itself was worth the price of admission.
The second half of the book is dedicated to the five “HTML5e”6 APIs that Hales calls out as modern, as the place where you can do some real innovation with your app. These five APIs include: WebSockets, Web Storage (e.g.,
sessionStorage), Geolocation, Device Orientation, and Web Workers.7 Without going into detail about each of those APIs here, I will say that Hales introduces each one in an at least serviceable fashion. Each of these chapters describes what that API is; what its target use case is; what the status of its specification is; (approximately) what kind of coverage is out there from the browser vendors; a case study implementation built on top of it; what it takes to shim or polyfill the API (if possible); and what frameworks are out there to support you if you don’t want to “run naked” with that API. Each of these API-centric chapters can stand alone, and you should be able to use any of them as a quick orientation should the need arise. That being said, they vary in their technical depth — e.g., the WebSockets chapter is quite thorough8 while the chapter on Device Orientation seemed to just barely cover the fundamentals.9
All that being said, I did have a couple of quibbles that I need to raise, lest I feel derelict in my duty as a reviewer:
- Citation needed. I believe that this book could have used a reference section with citations. There were numerous times where I found myself raising a skeptical eyebrow about some point being made in the text as if it were an unequivocal fact. Example: “CSS selector performance can cripple older mobile browsers.” OK. Says who? Which browsers? What kind of performance hits are we talking about here? “Stats, or it didn’t happen.” It is not that I do not believe him, but I would be more confident if I had more to support the claims that simple trust.
- Define your terms. There were a couple of places in the text where I found myself wondering “What do you mean by that?” This was especially true when Hales invoked the phrase “user experience”, which he uses liberally throughout the text without ever really stating what he meant by it. I have an idea of what he means, but I also know that so many people have so many different ideas of what certain terms mean (e.g., “user experience”) that it is seldom safe to assume you know what they mean.
As I finished the book, I found myself feeling pretty excited about these new “HTML5e” technologies. Hales does a superb job in introducing them and in illustrating the possibilities latent in each one. Even better than that though was his discussion of how to go about designing and developing these modern front-end architectures to begin with. I would definitely recommend this book to front-end developers that have their fundamentals down and are ready to start looking at these kinds of sophisticated APIs and modern architectures.
Disclosure: I received an electronic copy of this book from the publisher in exchange for writing this review.
- Well, almost all. There was no WebGL action in there, but it seems kind of ridiculous to think that that would be lumped in there with the “HTML5e” technologies. [↩]
- Hales seems to go a step beyond “Mobile First” and (in the Preface) tentatively introduces this notion of “Offline First”. (And/but never really comes back to that little maxim.) [↩]
- Hales says right in the Preface that “if you are convinced that server-side generated markup is the way of the future, then chances are you won’t enjoy this book.” Unfortunately, I think that this statement smells a bit of trolling, and it fails to acknowledge that there’s nuance here. This is a disappointment, because so much of the rest of this book speaks very intelligently about evaluating specific technologies to see how they might solve your problem, and about the choices and trade-offs that you need to make along the way. Where and how your app’s mark-up is generated is another of these considerations, and it was frustrating to see that question cast off so flippantly. (To be totally fair, Hales does later say: “Most of the time, you’ll end up with a hybrid application that does some processing on the server and much more on the client.” Which is a far more sensible thing to say, though considering it’s stated in Chapter 4, it’s almost too-little-too-late.) [↩]
- It was somewhere around Chapter 2 that I started to ask myself: Is “Mobile First” just a euphemism for “Modern First”? After all, who are our polyfills and shims really targeting? [↩]
- ”HTML5e” is Hales’ shorthand for “HTML5 for Enterprise”. I rather took a shine to that. [↩]
- I wrote about Ido Green’s Web Workers book back in July. [↩]
- Though I’d argue that he could have provided a little more background on Comet and long-polling, just for the sake of being thorough. [↩]
- Perhaps I missed the point? Maybe that really was everything there was to say about Device Orientation? [↩]