If you are using the TypeScript Skeleton application provided by the Aurelia team, then at the time of writing this, the project is still using TSD (well it has a tsd.d.ts file in the typings folder). The TypeScript Definition Manager as of a few hours ago of writing this post has been deprecated in favour of Typings instead which is a considerably more flexible and easier to use type management tool.
If you are a TypeScript user like me, then you most likely used TSD aka TypeScript Definition manager for DefinitelyTyped. Now that TSD has officially been deprecated, you can either stick with TSD for the moment or upgrade to Typings now.
Firstly, lets uninstall TSD. You might have it installed locally and globally depending on your setup: npm uninstall tsd and npm uninstall tsd -g
Now keep in mind your typings folder will be completely changed to accommodate the new structure that Typings uses in comparison to TSD. If you have any custom typings in your folder either created by you or manually copied/pasted, back them up somewhere.
Recently in my Aurelia application I needed to handle some keypress events when the user hit the enter and escape keys. Fortunately Aurelia doesn’t abstract Javascript too much, so adding in keypress support is easy. You don’t really see things like this documented anywhere, so this is for my reference just as much as it is yours.
export class SomeClass { constructor() { this.myKeypressCallback = this.keypressInput.bind(this); } activate() { window.addEventListener('keypress', this.myKeypressCallback, false); } deactivate() { window.removeEventListener('keypress', this.myKeypressCallback); } // This function is called by the aliased method keypressInput(e) { console.log(e); } } The best practice here is to ensure that the ViewModel has instantiated itself so we can register our event listener, then make sure in our deactivate method we remove the event listener to clean up memory usage.
With the beta release of Angular 2 in mid-December after almost 2 years in development, high hopes have been placed upon the framework who in its absence of release has seen other competitors such as ReactJS mature and Aurelia release into beta.
I have seen and heard some ambitious things being said about Angular 2. It appears as though everyone is making the assumption that because the Angular brand is so well known and people are falsely under the impression it is a first-class Google project (even though Google offers no support).
In the house we are currently renting until we buy next year, we have had a problem with the smoke detectors going off randomly in the early hours of the morning. I do not mean a chirping sound to indicate a flat battery; they actually go off like a fire. Nothing rouses you from bed faster than fearing for your life.
So we called the real estate, and they sent someone out the same day (the 3 times we have called). The first time they thought it was the batteries, so they replaced them. A couple of days go by, and then: BEEP! BEEP! BEEP! Causing the early morning panic to set in.
Firstly, I am not an American. Secondly, I hate armchair experts just as much as you probably do. I don’t claim to be an expert on anything nor do I think I have all of the answers. But, to any outsider who isn’t an American there are some obvious aspects to the gun control debate that Americans cannot see.
America has a gun problem. The guns themselves are not the problem, it is the people who use them incorrectly that have the problem. As is the case with pretty much anything, human beings are always the weakest link in any chain; security, safety, health and common sense.
There was buzz of a massive sale happening at Dick Smith on the weekend. Throughout the week there were rumours from media outlets and supposed store representatives.
Even calling up the stores, the staff seemingly had no idea of a massive clearance sale. They were either told to play dumb or legitimately did not know.
Then people were posting on Oz Bargain claiming to have purchased awesome deals. Someone even claimed to have got an Xbox One for $150. I even saw someone claimed to have gotten a 4k TV for a couple of hundred of dollars.
There is one thing that really irks me in Javascript, everything is passed by reference. Recently in a project I was working on, I had an object of widget options I needed to modify. I also needed to offer the ability to revert the changes made to this object.
The kicker is: this object is complex. It isn’t just properties and values, it has other objects inside of it and arrays. Everyone has an opinion on how you should do it, many ways to skin a cat so-to-speak.
Update Just a few hours after this was posted, the band officially announced a new album. Who knows if the post was just good timing or perhaps they saw it and wanted to make it official.
Something is going on over in the Thrice camp. The band who is notoriously quiet on social media have been quite active the last few months. Not even after they announced they had ended their hiatus did they start being immediately active. The guys have notoriously kept a relatively small profile online.
In the continued week that is Aurelia Week, the team have been drip releasing tasty little morsels of Javascript framework goodness.
The biggest thing to happen to Aurelia thus far is the release of actual documentation. For months many die-hards (myself included) have been using the limited already provided docs, scouring Github source code and pestering the team on their Gitter chat channel (which I encourage you to join).
The team have created an Aurelia powered documentation application that allows for seamless browsing of the many Aurelia dependencies and their code. It also have various examples and info on how to do things with parts of the framework you probably never knew existed.