Don't use Aurelia
At chilon.net we’ve been building kchomp.co with Aurelia for the last year and a bit.
To start with my conclusion: we’ll be using Angular 2 (and React) at chilon.net for any future projects we might have previously considered Aurelia for. We still like it a lot and hope to work with it again when contracting for clients but the advantages it offers don’t make up for its weaknesses yet. We just don’t see it moving in a direction where we feel like our concerns are being addressed. Now the details:
Code written with Aurelia is very readable
Aurelia offers more of a “convention over configuration” approach than angular leading to terser and more understandable code. In Angular 2 event hough your component’s template might always be the name of the javascript module with .js
replaced by .html
you’ll have to specify it every time, in Aurelia it’s a default.
The Aurelia team are helpful but you’ll need to fix a lot yourself
The first big issue we had with Aurelia was with something as simple as showing a list of items in the correct order. We have an list of 50 posts on each page which can fade in and out as they are reordered and removed according to scores that change over time. Often the combination of repeat.for
and animations would lead to duplicate bits of HTML and sometimes, bits would go missing. This bug remained open for several months and eventually I found a way to fix Aurelia and submitted the patch. The code for the animator was full of cut-and-paste coding so we had to place the fix in four different places. While my patch made things much better it introduced another similar issue which was eventually fixed by another Aurelia team member a few months later. During this time our website seemed a bit stupid, we had a list of things supposedly ordered by decreasing score and yet often the order would be: ‘Item A: 300 points, Item B: 900 points, Item A (again): 300 points’. Try showing that to potential investors with a straight face.
Extremely grave bugs go unsolved for a very long time
After an update to our code that improved caching at the cost of updating the array of posts a lot more frequently, we found that Aurelia was unable to synchronise our list of posts with the array properly. The previous two fixes just made it less likely but still very possible. I’m sure the reader has their own opinions about the feasability of a framework where something as basic and essential as the ng-repeat
equivalent still contains fundamental issues that that have existed for more than a year and continue to exist several months past the 1.0
release.
Some of the documentation is non-existent and things change a lot
Updating dependencies would lead to breakages a lot. Even though we might be going from SystemJS 0.19.2 to 0.19.9 we couldn’t be lulled into a false sense of security by the minor-only version change. Our build broke, a lot. We spent a lot of time hunting for stuff ourselves when google revealed we were the only team to have hit a problem (or we could only find a few other lost developers waiting for a fix). Mostly we fixed things by reading the code because often the error messages we received were very unhelpful.
Sometimes things were promoted as “good” that ended up being a waste of time
Aurelia were using SystemJS exclusively as their build system at first, eventually they proclaimed that they’d written a good bundling system via systemjs/builder. Unfortunately this was not good enough on mobiles with an average 5 second delay after each reload. After a few Aurelia package upgrades this delay changed from an average of 5 seconds to 15 seconds. This was extremely painful.
Strength of the community
It took a lot of back and forth and experimentation to find out the cause of the long delay on mobiles, eventually discovering it from the Angular 2 mailing list at a time when Aurelia team members were claiming there is no issue. Discovering problems in Aurelia from Angular 2 user forums that the Aurelia team members were unaware of was an eye-opener. The community of Angular 2 is so much more sizeable that mining it for information is a less painful than with Aurelia.
You hit bugs a lot, give up, and start hacking
To fix the delay on mobile we had to port our entire application to a new build system. Luckily Aurelia had introduced support for webpack, unluckily there was not a shred of documentation on this support. After many hours, reading a lot of code and trying to decipher completely misleading error messages we had managed to peg all of our software libraries to just the right versions (the latest versions being no good) and put in enough hacks that the webpack build finally worked. Now mobile browsers only had to wait a second after each reload. Some of the things I had to do to get this working make me feel a little ashamed. Thankfully the code is not open source and you’ll never see it.
Quibbles
- aurelia-cli: seems to reinvent many wheels. It provides a custom implementation of
require
when something like almond could have been used. Angular 2’s cli uses webpack 2 to build, and the angular 2 team have distributed all of their code in such a way that webpack 2 can perform tree-shaking to reduce the size of the built code through analysis and removal of unused code. The custom solution aurelia-cli offers cannot match this, which is kinda ironic when the Aurelia team lead has frequently criticised the size of angular 2.angular-cli
bundles are much smaller than those created withaurelia-cli
. - @easy-webpack: A collection of utilities that are supposed to make webpack easier to use, the lack of any documentation renders them nothing but an unnecessary layer of obfuscation.
- Am a little worried that the Aurelia teams are still releasing new ambitious projects (Aurelia UX?) without solidifying the foundations. When fundamental bugs still exist in the framework past the beta mark it isn’t encouraging to see the team making bold new advances, you want to see the foundations being solidified at all costs.
The final straw
When I realised Aurelia hadn’t been able to do something as simple as synchronise my array with my view for over a year, and that I still can’t, even though 1.0
has been out for months, that was it for me.