Building web apps in 2013

A Very Short Post:

I’ve lately come to the opinion that desktop application development is a moribund activity, which suits me quite nicely because I’ve never really liked any of the ways people invented to do it. So I’m getting my JavaScript on and building web applications, and more specifically, Single Page Applications.

To do this, I’m using AngularJS and TypeScript for the client-side development, and Simple.Web for the server side, and I’ve discovered this amazing thing: you don’t need server-side page rendering of any kind. You can serve purely static HTML files, and all the things you might do with Razor on the server can be done with JavaScript MVx frameworks on the client. You can even do Windows Live authentication with a static HTML callback page, and then pass the access token to the server using AJAX.

My favourite thing about this is, I can stick all the HTML, JavaScript, CSS and images that make up my UI into a CDN with a custom domain name, and set up CORS on my service servers so they’ll accept AJAX requests from that domain. Which makes serving the app lightning-fast, and reduces the load on expensive servers which have better things to be doing than shovelling static files.

The only fly in this ointment is that all the AJAX calls can be done to SSL endpoints, but unless the static files are served over SSL, there’s no reassuring padlock symbol to tell the user that their data is being transferred securely. So you end up pointlessly HTTPS-ing your static content just to keep the padlock there. If anyone knows of a solution to that problem, please let me know.

Comments

  1. Do I feel a presentation coming along for SPA? I think I might have a go at using the technology you mentioned on my next greenfield web app… Keep up the good work Mark.

  2. The only thing I’m using Razor for is to switch between bundled and unbundled assets in release or debug mode. That can probably be factored out, but I’m too lazy.

    The advantage of desktop applications (if you were not doing cross-platform stuff) is that the user experience on different machines would be more or less identical. Having to write tons of specific HTML/CSS/JS just to get something working on IE7 or 8 is an absolute pain in the ass, so I hope you’re not targeting those platforms 🙂

  3. Really amazing work, Mark! Lately, I have also tried to work with integrating APIs in the web apps and I would love to work with your Single Page Applications. My main focus these days has been GroupDocs developer APIs to integrate it apps into existing applications. You should also try working with it for the sake of new experience. Check it out here:

    http://groupdocs.com/api

  4. So what you’re saying, then, is that rather than render the HTML on a server in a fast, compiled language, and then download as small a page to the user as possible, you should instead write your code in a buggy, open-source code generator which makes an interpreted script which runs unpredictably and differently in different browsers, then force the user to download that as well, opening yourself up to hackers, and then slow the whole thing down and overload your server by having the users’ machines make loads of callbacks to it. Brilliant! I just wish I knew as much about systems as you: it would make my goal of being unemployable so much more attainable! Thanks for this!

  5. The ownage is strong with this one

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: