Year-end summary: JavaScript review in 2016

Source: Internet
Author: User
Tags chrome developer home screen
2016 is a memorable, strange, happy, and terrible year. It all depends on what you think. Compared with other events, simply focusing on javascript may seem no big deal, but javascript is a very big part of your work life for every web developer. 2016 For every web developer, javascript is a very important part of their work and life.

The popularity of JavaScript continues to surge. Not everyone liked this language, but you seldom heard the slogan comments from ten years ago. Personally, I have always liked JavaScript, even in the early days of frustrating times. Anyone who approaches it from C ++, Java, or PHP will first be confused: JavaScript looks familiar, but not. To overcome your assumptions, you will enjoy its simplicity, elegance, practicality, and flexibility. (For example, date processing is still a nightmare !)

JavaScript celebrated its 21-year-old birthday in March. Let's review its first year of maturity...

ECMAScript Development

ViaES6/2015 is the most important language update since its birth. It took seven years to complete the rule, but browser and runtime finally began to support arrow functions, let and const, which brought more fun. The ES6 compatibility table is becoming a shining green.

If you need to support the old browser, it may be a little early to switch to es6. For old browsers, projects released more than a year ago. You can use ES6 to ES5 compilers (such as Babel), but the development is very complex and requires additional building steps.

ES7/2016 is more revolutionary. An exciting new feature is async, which allows asynchronous code to be written in synchronous mode without the syntax complexity of callback or Promises (continue to confuse me.

Progressive Web Applications

Via my favorite JavaScript-based 2016 technology grants Progressive Web Apps. PWA was announced at Google's 2015 Chrome developer summit, but stable technologies and tools finally arrived at Chrome 52 in July. PWA allows offline priority and replaces the slice-like AppCache method. Web applications can finally compete with native applications and provide the following advantages:

1. Home screen icon

2. Quick Start and custom pop-up Screen

3. Quick execution

4. Offline functions, no Internet connection required

5. URLs, links and bookmarks

6. Full Screen or topic Interface

7. Sandbox execution

8. Local or cloud-based storage

9. Less device space and processing resources

10. Better security (HTTPS is a prerequisite)

11. Easy discovery from any search engine

12. Please try before installation

13. Simpler deployment: it is just a Web application

14. No App Store nonsense: Your application can contain any nude pictures and you will definitely want no one to take away 30% of your profits!

Most importantly, any website or application can be converted to PWA within hours. Steps:

1. Enable HTTPS on the server.

2. Create an Application List-a json file in the application root directory to define the name, color, icon, and display options.

3. Create a JavaScript file in the Service Worker-root directory to intercept network calls and return cache or real-time data as needed.

There are few initial examples, but PWA provides a good opportunity to "mobilize" your Web applications. Although it is not guaranteed that Apple will implement this technology, it does not matter. Your application can still work in Safari, but it will not benefit from offline execution. I have a feeling that once the web experience on Android is significantly improved, Apple will encourage PWA support.

Fixed framework

Via is hard to make a fair judgment, but React seems to have received the most attention this year. You may not agree, because it depends on what you are using and what you have browsed before!

Vue. js is widely used. Version 2.0 was released in September.

AngularJS may have lost some of its momentum in 2015, but this may change with the release of Angular 2 in September. The new version is completely rewritten; it is not backward compatible with v1.0.

Although the new frameworks and libraries are exciting, jQuery was still powerful 10 years ago. V3.1. The library runs in strict mode, supports Promise, and implements various fixes. (View the upgrade guide for the complete modification list .)

JQuery is used on JavaScript 96.4% websites. In contrast, Angular is the most commonly used modern framework-accounting for 0.5%. JQuery 1.x is the most popular version, accounting for 93.5% of usage. Version 2.x accounts for 6.0% and version 3.x accounts for 0.5%.

I have always criticized developers for using jQuery directly. When there is another more appropriate option or a small JavaScript segment can be used to meet the demand, it will be over-used. However, it provides a lighter learning curve and is more flexible than most frameworks. It takes many years to replace other frameworks or libraries.

API abuse

For example, the battery status API. When I wrote JavaScript in 2013, it seemed very useful. When your application detects that your mobile phone is about to shut down, how can we better minimize network requests and handle them?

Unfortunately, Mozilla estimates that about 6% of websites use this API, but most of them are used by advertisers to detect the battery status and track the domain names of websites that users browse. It may also be because some service providers know that a user's mobile phone is desperate to shut down, in order to increase the price of some services,

Although this is not a problem with JavaScript or API, Mozilla has taken unprecedented measures to delete the battery status API from Firefox 53 for privacy reasons. This is unlikely to happen on ios devices. Other APIs for similar reasons include sensors and Bluetooth. This is not a glorious thing: These APIs have practical advantages, and I hope the privacy issue can be solved in future versions.

New version of Node

Every year, Node. JS will bring us two release progresses: April in 6.0 and October in 7.0.

The platform is currently on the rise, although W3Techs reported that Node. js server usage is only 0.2%, while PHP is 82.3%. These numbers may be a bit misleading, because even if Node. js is installed, it cannot be identified.

Because php has been around for a long time and is still the most reliable choice on the server. However, Node. js is writing its own history and is widely used by developers of all language beliefs.

Yarn

I like npm very much and think it is one of the main reasons for the popularity of Node. js tools. I have never encountered too many problems on npm, but I am not working on a big project like Facebook.

Facebook engineers released Yarn in March. It is a new Node. js Package Manager designed to be faster and more stable than npm. It depends on the npm registry, so it can be fully compatible with npm.

Tim Severien's Yarn vs npm: everything you need to know. I agree with his conclusion:

Although Yarn is not a replica, it improves several npm defects. If npm learns from Yarn and asks Facebook, Google, and other Yarn contributors to improve npm, Is it great?

Fatigue

I-can't-take-this-any-more was added to Jose Aguinaga's study of JavaScript in.

This may be a humorous way to show the current status of JavaScript, but one thing to note is that, to keep up with the latest trends, the framework and recommendations become increasingly difficult. Developers dispute over a large number of technical solutions.

My suggestion: do not try to keep up with it. This is simply not possible. Any system that you focus on today will be replaced by better things tomorrow. Select a good solution for your project and stick to it unless it makes your work worse.

One thing that can be determined is JavaScript itself. First, learn the language and continue to expand your knowledge. Your experience will help you understand how each framework works, so that you can make a wise choice, even if this choice may be totally out of all frameworks.

I wish you all the best at work and life.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.