
Single page apps in depth - jaynate
http://singlepageappbook.com/single-page.html
======
mixu
If you find the book helpful - great! I'm glad. I can definitely see a lot of
faults in my own work but I don't have infinite time to fix them, which is why
the book is on Github ( <https://github.com/mixu/singlepageappbook> ).

There are things that I would definitely discuss differently if I wrote the
book today - since things have developed a quite bit in the past year and
half. I'll probably start working on a second edition late this year to
rewrite the parts that I find most annoying in my book. I need to finish and
ship a bunch of open source stuff before that though.

~~~
akurilin
Any chance you could at least outline what you think the biggest changes in
the past year and a half have been, for those of us who read the book? What
are the things you would have written about differently?

~~~
mixu
I haven't yet fully formulated what I want to say so this is still just
speculation on what the 2nd edition might contain. I can see a lot of room for
improvement, especially in the latter chapters. Overall, the way I would frame
the problem is much crisper now, and I think I have figured out how to better
explain and implement my controller-averse approach, as well as server/client
hybrid rendering and routing.

The community is more sophisticated about packaging these days so I would
spend more time going beyond the basics and it's obvious what the most popular
frameworks are (from ~8 contenders to ~3) so I should bring those in
concretely to illustrate points. When I wrote the book, many of the frameworks
were pre-1.0 and hadn't figured things out.

I also wrote another (to be released) book just on distributed systems which
has helped with my thinking re: backend integration/caching/offline though I'm
not sure how that will be directly reflected in this book.

Finally, I'd like to audit my use of indefinite articles, particularly within
chapter headings.

------
RyanZAG
Nice book, but seems to be very focused on 'this is the one true way'. There
is very rarely ever 'one true way' for all problems, and the reasoning given
for each choice isn't solid enough to consider it a closed problem.

It would have been great if there was a small part of each section given to a
short discussion of other alternative options that could be taken if the first
approach isn't working out for the team. eg, the book's requirement to use
specific libs like CommonJS

~~~
spindritf
> seems to be very focused on 'this is the one true way'.

Good. I hate when the goal (of building something, of answering the question)
is obscured by the author's need to show how knowledgeable or insecure they
are and share 15 different ways to do something. Not every piece of writing is
a philosophical treatise.

Though sure, a short list of alternatives wouldn't hurt. The justifications
for our choices OTOH expand quickly because humans seem to be really good at
those[1].

EDIT: fixed, thanks.

[1] [http://www.overcomingbias.com/2013/04/talkative-sell-
silent-...](http://www.overcomingbias.com/2013/04/talkative-sell-silent-
buy.html)

~~~
pekk
Simply allowing more than one way to do something does not mean that you have
a "need to show how knowledgeable or insecure [you] are".

~~~
markdown
If it's a beginners book, one way is always the best.

~~~
spiffytech
Provided that one way is both achievable for beginners, and a healthy practice
to continue in the absence of further development. You don't want beginners
thinking some terrible practice is how they are supposed to build things, just
because it was the only workable thing you could use to introduce them to the
topic.

------
jere
>1\. Modern web applications: a overview

 _An_ overview, please. Sorry to nitpick grammar, but seeing that in an early
header leaves a bad impression.

~~~
manojlds
Can't believe something like that creates bad impression in tech materials,
but I have always been surprised with myself about how my impression changed
due to grammatical mistakes.

~~~
rhizome
It has to do with attention to detail, and for me it raises the possibility
that I can't trust the technical aspects of the writing. For sure that's a
grammar-bigotry on my part, I'm not proud, but I simply look askance a bit
after seeing that kind of thing.

~~~
dgesang
Don't be ashamed for being right.

------
m2mapps
1\. Are there _any_ popular apps that consist of a single page?

2\. What is the most lucrative single page app out there?

~~~
tzury
Gmail, Facebook, Google+, Twitter

------
dm03514
Mixu, I have recently read your book front to back. I am new to javascript
development and javascript MVC frameworks. I found your book to be both
informative and concise. It shed a lot of light on the major aspects of single
page JS and what the frameworks are trying to address. Thank you for your time

------
Surio
Hmm.. I remember this discussion from before...

Yup. Here's the previous discussion(s).

<http://news.ycombinator.com/item?id=4172837>

<http://news.ycombinator.com/item?id=4677497>

------
onto
[https://www.dropbox.com/s/z4872dg21mvuizs/single_page_apps.p...](https://www.dropbox.com/s/z4872dg21mvuizs/single_page_apps.pdf)

PDF for tree-killers

------
jader201
Does someone know of _any_ sites that implement this pattern, or even better,
_well known_ sites that implement this pattern?

~~~
pbiggar
It's not well known, but <https://circleci.com> is a one-page JS app that
seems to be very similar to the book. The datasource is slightly different (we
use Knockout, and so follow their pattern, with simple jquery for "saving" and
loading), but otherwise it's surprisingly similar.

~~~
aymeric
I use knockout.js too and I had a look at your code: although you seem to
follow a lot of best practices, I noticed your code is not minified. Any
reason why?

~~~
pbiggar
Ah, yes. We use a dieter [1] for our asset pipeline, and it supports
minification using Google closure compiler. Unfortunately, this breaks Twitter
Bootstrap.

I did some measurement and I think we can save 19% through minification using
uglify (once you included gzipping). That means its not currently worth the
few hours of making it work and verifying that it doesn't break anything
(versus other ways we can spend our time). Probably.

[1] <https://github.com/edgecase/dieter>

------
akurilin
Really enjoyed the material, thanks for writing it. Hopefully the community
can keep it fresh and relevant as the tech evolves, since it's on Github. It
seems to have worked really well for Addy Osmani's Backbone Fundamentals, I'm
sure we can do the same for your book as well.

------
shanselman
I love that it's all on a single page.

------
crabasa
I hate to judge a book by its cover, but shouldn't this ebook have been a
single page app itself?

~~~
njharman
Should a book on art be a sculpture. On programming, a program.

~~~
tl
Well the former is an interesting thought experiment, but very much yes to the
latter (at minimum, there would be value in a "book viewer" program that
embeds a code runner).

~~~
lowboy
But to the point, OP's book on single page apps should not be a single page
app itself.

------
michael_scheibe
I highly recommend mixu's talk from HTML Developer Conference last year
covering similar content to his book:
<http://www.youtube.com/watch?v=BqDJqKGfIiE>

------
cnp
This has been the single most important book I've read in my JavaScript
career. It's priceless, and really pushed me towards daily best-practices that
I would have otherwise been unaware of coming from a different language.

Thank you!

------
ninetax
Thank you so much for this book. Your writing is clear an concise. I am
starting out with angular and this is just what I need, not another piece of
angular documentation.

------
brian-frichette
Very opinionated, but very good opinions. Thanks for sharing.

------
aswath87
Coincidentally, I just made a single page app today!
<http://liveconsciously.me/>

------
eladbl
One thing always bothers me with single page application is SEO implications.
Is there a real way to use SPA without killing your SEO?

~~~
cheapsteak
Aside from Airbnb's Rendr (and I've heard DirbyJS does something similar), you
could also build your SPA _on top_ of your server-rendered pages. After
pageload, hijack the click events from your navigation controls and have it
fetch and render content via ajax. It's certainly not "DRY", but it's easier
to implement for existing content-focused sites.

------
mangoman
I haven't gone through much of the content, but I was expecting a site about
single page apps...to be a single page app. I mean, I understand that there is
probably a wealth of information on the site, but it not being a single page
app is kind of a bummer. It feels a little less credible, but more
importantly, it feels like a missed opportunity to show "What You Could Build
If You Read This Site".

~~~
lowboy
MVC is not a good architecture choice for reference material like a book or a
blog. So it wouldn't be that useful, IMO.

------
pkmishra
Thanks for sharing.

