I have been working with Aurelia and Node for a while now and recently I took the time to properly create an Aurelia Node.js starter skeleton and put it up on Github here.
While getting Node.js to work with Aurelia is not exactly difficult, this is more of a time saving convenience. I have seen other solutions, but they feel a little hacky and structurally confusing. I adopted a Meteor approach in that all client logic is handled in the client folder and Node.js server logic is in the server folder.
When inside of an Aurelia ViewModel there are situations where you might want to know what the current route is within a ViewModel.
One such scenario I encountered recently where I had one View and ViewModel pair being accessed by 5 different routes. I needed to know what route was accessing my ViewModel to load different data.
This is what the second parameter of the activate method for.
activate(params, navigationInstruction) { console.log(navigationInstruction); } The navigationInstruction parameter gives you the information about the route currently accessing the ViewModel. This allows you to access everything about the route, including the navModel
In-case you hadn’t heard, the FBI is trying to compel Apple to assist them in cracking open an iPhone 5c used by one of the shooters in the San Bernardino shooting that took placed back on December 2, 2015.
While on the surface the demands to some might sound reasonable, “Please help us unlock this shooters phone, Apple, so that we can see if they had any other accomplices and try and find out what happened” – make no mistake, there is more than meets the eye here.
Update: December 12th, 2016
A lot has changed since this article was published. The bundling situation is a lot better and things have changed. While some of this article might still be applicable, please do your research and assume that parts of this article are no longer relevant.
When it comes to Aurelia, one aspect that seems to trip up and confuse first timers and even seasoned developers is bundling.
In Npm version 3 we finally got what we had been asking for the last few years: a flattened module structure for Node modules. Unfortunately as a result Npm has slowed to a crawl when installing or updating Node modules, well mostly just installing.
Recently it was circulating that disabling the progress bar resulted in at least a three times speed increase. I first saw it on Twitter and dismissed it initially.
At the time of writing this, the preferred approach to client side dependencies and loading is Jspm which is one part package manager and one part SystemJS loader polyfill.
Although, we will be seeing other loader options in the near future such as Webpack and even a potential custom loader from the Aurelia team. But for now we have Jspm and System.js.
Install the JSON loader for System.js
We can use the JSON loader for System.js to load JSON files in our app in a bulletproof way. You can view the plugin here and see that it is really quite simple under the hood.
When it comes to GIT clients, you can’t really fault Sourcetree by Atlassian. It handles the basics of Git, allows you to visually merge/rebase your repositories, handle conflicts like a boss and more.
But we need to talk about the redesign they just launched across both Windows and Mac OS platforms in version 1.8.1.
Given the previous design of Sourcetree was not exactly the prettiest application out there or modern looking, usability wise it definitely ticked all of the boxes for me personally. What happened?
When it comes to the browser, queues are very important. The concept of a macrotask and microtask exist within the browser which allows standard tasks and micro tasks to be queued up.
The Aurelia Task Queue dependency is not specific functionality to Aurelia itself, but rather wraps native browser methods and provides a fallback if you are not using a supported browser.
The browser itself does not provide direct access to the microtask queue, but leveraging DOM Mutation Observers which use the microtask queue, you can tap into that powerful queue with relative ease (which is what this class does).
One of my favourite features of Aurelia is the ability to bind element styles. If you ever worked with Angular 1, then you would know you could bind not only classes but inline styles on an element as well.
Please note:
In all of these examples except String Interpolation, you can use the style attribute, but it is recommended that you use css for Internet Explorer compatibility if you want to use interpolation. I personally just use css for all style binding use-cases, which is an alias for style anyway.
If you are a Netflix subscriber you have probably heard that Netflix recently announced they are going to be cracking down on customers using a VPN to access content outside of their own country.
You could almost hear the collective sigh of all the Australian Netflix subscribers. Instant anxiety set in, people were worried: could Netflix really block VPN users?
Had Netflix’s engineering department done a deal with the devil to block VPN’s, proxies and DNS providers using techniques never before seen in tech so far?