Did you ever feel that it is going to be very difficult to upgrade Angular5 project to Angular6.x version. It might be “Yes” for many developers. Even I faced many errors while upgrading my PrimeNG-Extensions project (https://github.com/sudheerj/primeng-extensions) to Angular6.x version.
If you try to upgrade the Angular6 dependencies manually with in your package.json file and then renaming .angular-cli.json to angular.json, you will get the below error which is not easy anyway to find out the root issue,
This is because the schema will be different for .angular-cli.json and angular.json. Instead you need to follow the below four steps to achieve successful upgrade.
Note: You remove ./node_modules folder before the upgrade. It make sure the correct dependencies and avoiding compatibility/conflict issues
1.Upgrade your Angular CLI version
Run the below npm command to upgrade your angular CLI version. This command will update the angular cli version in devDependencies section of package.json file
npm install @angular/cli --save-dev
2. Upgrade your Angular CLI configuration using npm
Run the below npm command to convert the project configuration file from .angular-cli.json to angular.json file. It will also update unit testing and tslint config files such as karma.config.js, tsconfig.json and tslint.js etc.
3. Update your Angular dependencies
Run the below npm update command to upgrade all your Angular dependencies in package.json file
4. Upgrade third party dependencies
You also need to upgrade older TypeScript version which may not be compatible with latest Angular version. So manually update this dependency from “2.4.2” to latest version( currently it is “2.9.2”). Another important upgrade is RxJS version from “5.5.2” to latest( currently it is “6.3.2”). Other third party dependencies upgrade which depends on your project also should be done based on the usage.
There are two ways to install typescript tools
- Using npm (a node package manager)
npm install -g typescript
2. Using Typescript’s visual studio plugins
If you are using either Visual Studio 2017 or Visual Studio 2015 Update 3 then it include TypeScript by default. And if you are using older versions then you need to download it separately.
Nowadays, Webpack is a leading bundler for Angular, React and Vue frameworks with various templates. Due to it’s unique syntax who are new to Webpack thinking that it is difficult to configure and using it. But once you are familiar with it’s features then it is very easy to use in all kinds of applications. The current version of webpack is 3.8.1v.
It works with two major goals
- Everything treated as a module which includes JS files, CSS files, image files and HTML files. Also each artifict can be divided into smaller and reusable chunks.
- Load only the modules which you need on demand. Some of the bundlers combines all of the modules into single big bundle.js file which takes more time for initial load.In contrast, Webpack generates several smaller “bundle” files, which loads some parts of the app asynchronously to improve the page load time.
The module methods are mainly used for
- Iterating Arrays, Objects and Strings
- Manipulating and testing values
- Creating composite functions
- Creating own mixins for Lodash
The major features of this library are,
- Modularity and consistency
- Enhances and compatible with ES6/7
- Compatible build available for IE8 and older
- Available in AMD, ES and CommonJS module formats
InquirerJS is an easily embeddable and beautiful command line interface for NodeJS projects. I found this library while I was working with JHipster-PrimeNG module. JHipster provides various modules to generate the modern web applications with the help of Yeoman generator. Internally Yeoman generator uses this library for an interactive question and answer prompts through CLI. But we can use this library in a standalone environment as well. Even though there are full blown command-line utilities such as Commander, Vorpal and args available in the market, the usage and benefits of InquirerJS is quite impressive.
The major tasks of this library includes:
- Asking questions
- Parsing input
- Validating answers
- Providing error feedback
- Managing hierarchical prompts
In this post I’m going to provide my review comments on ‘Beginning Spring Boot 2.0’ book written by Siva Prasad Reddy. I know the author of this book very well by working as a technical reviewer for one of his previous book titled “PrimeFaces Beginner’s guide”. This book is divided into 19 smaller chapters to make the concepts clear. Each chapter explains how Spring Boot makes the life easier in terms of configuration and integration with other technologies when compared to plain Spring based applications. This book covers most of the popular Spring boot starter projects with step by step examples in a simple language. Apart from these spring boot modules, there are some dedicated chapters for security, testing, building RESTful apps, reactive programming, JHipster generator and deploying the Spring boot applications.
JHipster is an open source application generator used to develop modern web applications and microservices using Angular and Spring framework. The tool generates Java stack on the server side(Spring Boot) and responsive front-end(Angular) on the client side. JHipster 4.0 supporting Angular2 and after that JHipster 4.2 supported Angular 4 versions. It can cover more scenarios if it supports any popular Angular component library. Currently PrimeNG is one of the most popular component library in Angular community with 85+ components categorized under 8-9 groups. Also, the components look and feel can be changed with the help of around 20 themes available.
JHipster-PrimeNG module enables PrimeNG support with an easy setup similar to any other JHipster module. Initially it supports interactive theme selection and component groups to generate customized application.
The Github project is available here
After two months, PrimeNG released 4.2 version with some new features and around 200 defect fixes. The notable features are rewrites for Terminal using service, Message service for Growl and messages, button bar(Today and Clear buttons) and date template for Calendar component, item template for MultiSelect, loading indicator for DataTable and autoComplete components and floating feature for input components and so on.
Some of the major features are as follows,
In the previous blog post series, we have seen how to achieve the internationalization support using ngx-translate library. Please read this post if you didn’t read yet. In this blog post, you will see how to achieve it through Angular’s official i18n tools. “Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes”. Angular uses ngx-i18n tools to support internationalization. The process involves four steps.
- Identify the messages: Initially mark the static text messages in your component templates.
- Generate standard translation files: Extracts the marked messages into an industry standard translation source file(XLIFF and XMB formats).
- Translating the messages: Translating the extracted text messages into the target language by Translator tool.
- Complete the translation files: Angular compiler imports the compiled translation files and replace the original text with translation text files. Finally it creates translation files based target language.
The demo example is powered by PrimeNG components and the internationalization support for German and Spanish languages. You can close the Github URL to play with the features.
JHipster announced it’s new release 4.6 version on yesterday. This includes some of the major improvements such as Angular 4.0 support, upgrade Gradle 4 and RTL support.Let us see one by one. You can upgrade in both automatic and manual ways.
- Upgrade your version of JHipster:
yarn global upgrade generator-jhipster
2. Run the upgrade sub-generator:
1.Upgrade your JHipster version
yarn global upgrade generator-jhipster
2. Remove node_modules folder and run the below command to make sure it is not using older version.
3. Upgrade the entities in your project (Optional)