Front-End

Refactoring React ES6 Class Components with Property Initialisers

“Proprty initialisers” is an experimental ES6 JavaScript feature that allows you to write React class components without constructor and bind this. It creates cleaner React class component. The use of this syntax is so wide-spread and calling it experimental (because it is not yet ratified) feels almost misleading. Before getting …

Front-End

Clarifying Which Babel to Use for Compiling React Today

Babel is a toolchain to transpile new JavaScript syntax (e.g. ES6) down to older versions that is supported by browser or node.js execution environments. The latest major version at the moment is Babel 7. To transpile JavaScript React, we normally use bable. The problem is that babel is evolving so …

Front-End

My Gulp Job Example

Gulp is a build tool that automate application builds. It is usually used for front end build, but you can also use it for backend application build (e.g. automating .NET application build with gulp-msbuild). When it comes to front end build automation, gulp is the most flexible and powerful build …

Node.js

AWS Lamda Function TypeScript Boilerplate

I have created a boilerplate for TypeScript lambda function. If you are into JavaScript, I have the boilerplate here. TypeScript is really JavaScript that scales as the official tag line suggests. It is type-safe and the TypeScript specific intellisense provided by Visual Code Studio is amazing. Compared to writing in …

Sitecore

Configuring Multiple Sites with Sitecore

Sitecore has the out-of-box capability to host multiple sites from a single installation. Enabling multi sites is relatively straight forward. Sitecore decides the site context based on the incoming URL and three site attributes, hostName, virtualFolder and physicalFolder. A unique site in Sitecore is defined by hostName and those folder …

Front-End

Customising Cognito SignIn UI for aws-amplify-react with TypeScript

Let’s assume you are having trouble with customising Cognito Sign In UI for aws-amplify-react with TypeScript and have already know what AWS Cognito, aws-amplify and aws-amplify-react. Customising Cogito Signin UI is easy with JavaScript React. All you need to do is to extend the SignIn class in aws-amplify-react with a …

Node.js

How to Auto Fix Lint on Save with VS Code TSLint Extension

Wouldn’t you rather spend time coding than fixing pesky lint errors? The best time saver for developing TypeScript apps is auto-fixing lint on save. This is a quick instruction to endow this magical power to your VS code. Steps (1) Install tslint in your project. npm i –save-dev tslint (2) …

Sitecore

Sitecore PowerShell Extensions Installation Hangs on Spinning Wheel – Sitecore 8.2

Sitecore PowerShell Extensions is a powerful Sitecore development tool to manage Sitecore contents, create automation jobs and do a tons of cool stuff. It brings the PowerShell scripting capabilities to deliver Sitecore solutions faster. It also has a lot of out of box tools that doesn’t require PowerShell scripting skills. …

Sitecore

Could not create controller with Constructor on type not found exception – Sitecore 8.2

When your controller rendering is failing with Could not create controller along with the inner exception,Constructor on type (your constructor name, e.g Sitecore.Feature.Controllers.MediaController)  not found, there is something wrong with the actual controller code. Could not create controller error has a few different reasons. Another common reason is the inner …

Sitecore

Program does not contain a static ‘Main’ method suitable for an entry point – Sitecore 8.2

When you set up a visual studio project for Sitecore, you need to set Output type to Class Library. If it is set to Windows Application or Console Application, you need to change it to Class Library. Otherwise you get a build error below. error CS5001: Program does not contain …