Hacker News new | ask | show | jobs
by tomdale 4148 days ago
I got an alpha version of something we call FastBoot working for Ember apps: https://github.com/tildeio/ember-cli-fastboot

FastBoot allows you to boot up your JavaScript application on the server, gather model data, and send the rendered output as HTML to the client. This allows search crawlers, cURL, and people with very slow JavaScript engines to access apps that were previously unavailable. I've had a fire in my belly to make this work since I had a conversation with Dan Webb at Twitter about all of the reasons they switched away from client-side rendering[1].

1: https://blog.twitter.com/2012/improving-performance-on-twitt...

Most people think this problem has already been solved by being able to render templates on the server, but the problem is much harder than that. For example, I learned on HN yesterday that most server-rendered Flux apps can only handle one request a time, due to the reliance on singletons[2]. You really need an application-wide DI system like Angular/Ember to get this working with multiple requests in parallel.

2: https://news.ycombinator.com/item?id=8989667

I'm really really really excited about this work because I think we can have a single, robust solution for all Ember developers that is dead simple to install and get running. Most importantly, this makes JavaScript apps accessible for everyone, while retaining the UI advantages for those whose devices are capable enough. In other words, I think once this is complete, we can finally put to bed the controversy over whether server-side or client-side rendering is best—we'll have a hybrid that offers the best of both worlds.

1 comments

It's awesome to see you guys embracing server rendering, but it's incorrect to say most server-rendered Flux apps can only render one request at a time. If you're designing an isomorphic architecture, it's certainly a consideration, but I doubt any production apps have this limitation.

A common pattern is to instantiate a new store for every request, to avoid collisions.

The Flux fragmentation makes this hard to talk about. The examples I've seen from Facebook all use global singletons. There are some libraries/implementations that work correctly, but it's hard to know how widely used those are.

I guess the high order bit for me is that developers shouldn't have to worry about stuff like this—picking the "right" implementation of their app architecture. Ideally, everything just works out of the box. The harder it is to do, the less likely people are to do it.