disclaimer

This article is a hasty work, from conception to written less than half a day. There are not many excellent libraries and frameworks mentioned in this article, so I apologize in advance because I didn’t have time to collect them. That doesn’t mean I don’t have respect for these libraries and frameworks. In fact, my kudos to the entire community and contributors behind these names, including jQuery, including of course the original authors of the library and framework, such as John Resig.

In addition, due to time constraints, this paper describes the development context of front-end technology roughly, not strictly, and perhaps not objectively. This judgment of the front-end development trend only represents my own subjective cognition, not the consensus of the industry, please understand. Don’t use the ideas in this article as a basis for evaluating the development of front-end technology. Thank you very much!

Dead simple to abandon the jQuery

On July 25, 2018, Mislav Marohnić posted a tweet announcing that jQuery had been completely removed from the GitHub.com front end (below). What’s more, it was self-explanatory (understated), and no other framework was used after jQuery was removed, relying entirely on native apis.

A lot of people don’t know this, but I have a long history with jQuery. About 11 years ago (2007), I was the first one in China to translate the documentation of jQuery 1.1 due to my “crazy love” for jQuery. Later have a good based on my translation version to the jQuery version of the document, don’t forget referred to in the “about” I (http://hemin.cn/jq/about.html) :

Incredibly called me “domestic jQuery guide”, ashamed. However, given the lack of jQuery documentation at that time, the Chinese version of my translation should have helped many students. Later, I also translated Learning jQuery (jQuery Basics tutorial).

Because of this connection with jQuery, the news that GitHub.com is getting rid of jQuery completely made me think a few things. Therefore, I decided to write this short article for readers (hopefully useful, haha).

JQuery’s brilliant

JQuery originally was born in August 2006, the author is John Resig (https://zh.wikipedia.org/wiki/JQuery). More than a decade ago, web developers (before the concept of a “front end”) suffered from browser incompatibilities. A number of JavaScript libraries/frameworks like jQuery have emerged:

  • Dojo
  • jQuery
  • MooTools
  • Prototype
  • Yahoo! User Interface Library (YUI)
  • Script.aculo.us

Some of these libraries are general-purpose like jQuery, such as Dojo and Prototype. Others go more specialized, such as YUI (componentization) and script.aculo. us (animation interaction). In terms of common functionality, most of these libraries offer the following features:

  • Syntactic sugar: chain calls, utility functions
  • Selection elements: Custom selectors based on various standard selectors and libraries, as well as filtering through callbacks
  • Manipulating DOM: Create and manipulate elements, and even various attribute operations
  • Handle events: Ready events and various methods for registering and triggering events, and even delegates
  • Animation: Animate CSS properties based on animate, with built-in animation methods
  • Ajax: Encapsulates the native XMLHttpRequest API to simplify request methods and callback handling

A flurry of books promoting and promoting these libraries and frameworks quickly spurred their adoption. DOM Scripting, 2nd (The Art of JavaScript AND DOM Scripting (2nd edition)), published in 2010, is one of them. The book has an appendix devoted to popular libraries at the time, mainly jQuery.

The self-description on the jQuery website at the time was as follows:

“A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, And Ajax Interactions for Rapid Web Development. JQuery is designed to change the way that you write JavaScript.”

Yes, that’s right. With its selector approach, collection-oriented chain calls, complete support for events and Ajax, and simple and powerful dynamic effects, jQuery has quickly become a necessary JavaScript library for almost all web development, and even created the jQuery programming style.

The reasons for choosing jQuery are simple and straightforward:

  • cross-browser
  • A simple and efficient
  • Stable and reliable
  • The plugin is rich

In The upcoming “rhino Book”, 6th edition — JavaScript: The Definitive Guide, 6th edition, 6th Chapter 19 is devoted to jQuery.

JQuery has since reached its peak. Later, as front-end interaction became more and more important and Mobile applications became more and more popular, jQuery UI and jQuery Mobile came out one after another.

Today, jQuery still underpins tens of millions of websites of all sizes — although she’s rarely seen in the spotlight.

Choice of history

The past decade has been the fastest growing in the history of the “front-end industry”.

Far from eclipsing the desktop Web, the mobile social era has spurred rapid improvements in Web standards. HTML5 not only brings great backward compatibility, but also richer native DOM apis. CSS from CSS3 on the modular fast track, text style, layout, media query, a variety of new modules dizzying people.

Firefox, Chrome, Opera, Safari, IE and Even Edge are all actively redesigning and rewriting their kernels to become the “model” for supporting Web standards. Against this backdrop, Internet companies have been upping the compatible version numbers of Internet Explorer from 8 to 9 to 10 to 11.

And, of course, the ECMAScript language standard. Since the epochal release of ES6 (ECMAScript 2015), JavaScript has finally really begun to shed its “toy” language embarrassment. More importantly, since ES6, ECMAScript has also moved into a fast iterative, yearly rhythm. ES7, ES8, and ES9 each time inject more powerful language features into the language.

At the same time, the emergence of server-side runtimes and translation tools such as Node.js and Babel has accelerated the pace of front-end engineering and convergence with traditional industrial-grade software development best practices.

In 2012, the author translated an article in Turing community “JavaScript throne: among the seven framework” (http://www.ituring.com.cn/article/8108). The “Seven Frameworks” were:

  • Backbone
  • Knockout
  • Spine
  • CanJS
  • Ember
  • AngularJS
  • Batman
  • Meteor

Angular, Google’s flagship Single Page Application (SPA), came out on top. Soon after, Facebook’s React, which “writes HTML gracefully in JS,” took off. Finally, Vue, which combines the best of each and is easy to use, emerged.

Front-end development has gradually evolved from the “agricultural civilization” in the post-slash-and-burn era to the quasi-” industrial civilization “characterized by large-scale, scalable, standardized and automated development.

As the saying goes, “Without skin, hair can be a blessing in disguise.” As times change and technology advances, the environment in which jQuery was built is disappearing. As mentioned earlier, the new environment has spawned a new crop of frameworks. The once glorious jQuery has finally come to a glorious end.

A few words of advice

Eight years ago, DOM Scripting, 2nd, recommended the use of front-end libraries.

“It’s ok to use a library in development, but if you don’t just know how to use it, you need to know how it works. If you can’t transcend these libraries, you will be crippled when they become your crutch. Take the time to learn JavaScript and the DOM before using a library. From the very beginning, we emphasized the importance of “knowing how” and told people that they should not be satisfied with “knowing how”. “If you use a library and you don’t know how it works, you’re doing yourself and your product a disservice.”

In 2012, from the back-end front-end Ray Nicholus soon took over a cross-browser file upload library (https://github.com/FineUploader) of the maintenance and development work. His first instinct was to rewrite the library in jQuery. However, users are opposed to introducing any dependencies on other libraries. As a result, he can only use the native browser API. So what? He found it easier than he thought to give up writing jQuery.

In 2014, Ray published “You Don’t Need jQuery!” Series of blog (https://blog.garstasio.com/you-dont-need-jquery/). In 2016, his works Beyond the jQuery (Apress, https://www.amazon.com/dp/1484222342/). Ray suggests that learning front-end development should be in this order:

  1. Learning JavaScript
  2. Learning Web API
  3. Learn jQuery (or other frameworks/libraries)

But many people actually start with #3 and then move on to #1 and #2 much later (and never even think about #1 and #2). The result is “knowing the is and not knowing the why.”

Now, time has changed, jQuery is coming to an end, and a new generation of component-based frameworks has emerged. However, “there is nothing new under the sun.” Whether it’s Using Angular, React, or Vue, really understand how they work.

(In order to avoid the suspicion of advertising, I will not recommend the forthcoming book “Simple to Understand Vue. Js” by Liu Bowen of 360 navigation front, hahaha ~ ~, because there is no cover to show.)

The end of the

As the first generation of front-end libraries, jQuery has contributed to the prosperity of today’s Web and a generation of Web developers. As a “jQuery guide in China” (this hat was given by someone else, I borrowed it, haha), my personal feelings towards jQuery are mixed. I don’t want it to leave, but I also want it to leave soon. I think this is the sentiment of many front-end developers who were introduced to jQuery early on.