Angular 2 AoT compilation with Webpack

In this article I am going to explain how to enable Angular 2 Ahead-of-Time (AoT) template compilation with Webpack 2, using the @ngtools/webpack loader.

Ahead-of-Time (AoT, also called “offline”) template compilation results in smaller application code size and faster initial rendering compared to Just-in-Time (JiT, also called “dynamic”) template compilation. If you’d like more details on those two options have a look a the Angular documentation. Also, Tobias Bosch in this Angular 2 Compiler talk gave a very interesting explanation of why the AoT compiler was introduced.

Continue reading


How to create iOS certificates for Ionic Package on Windows/Linux

With the recent announcement of Ionic Package you can now build your Ionic app for iOS even without a Mac.

However you still need to set up Certificates and Provisioning Profiles in the Apple Developer Member Center, then upload them to your account before you can build anything.

The Ionic Package documentation explains how to set up iOS Credentials using OS X. But what if you don’t have access to a Mac? That’s supposed to be one advantage of Ionic Package: it lets you build iOS apps without a Mac, right?

Luckily it’s entirely possible to set up the certificates using Windows or Linux as well. Here’s how.
Continue reading

Immutable Value Objects in Java with Google AutoValue

Java 8 addressed many of the biggest pain points in the Java language, from lambda expressions and functional-style collection operations to the new Joda-like date and time API.

One notable miss is something like Scala’s case classes or Kotlin’s data classes: a simple way to define immutable value objects. The amount of boilerplate for a class holding just a couple of fields is ridiculous: you need not just a constructor, member variables and setters but most likely also equals, hashCode, and toString implementations, resulting in 50 lines of code in Java versus 1 line in Scala.

Attempts to make things easier range from IDE code generation to the Project Lombok hack. Thankfully, 20 days ago Google released version 1.0 of AutoValue, arguably the best solution to date.

Continue reading