LABJS, Requirejs, Seajs which is the best use? Why?

Source: Internet
Author: User
Tags definition modify node server
The core of LABJS is LAB (Loading and Blocking): Loading refers to asynchronous parallel loading, and Blocking refers to synchronous waiting for execution. Labjs through elegant grammar (script and wait) to achieve these two characteristics, the core value is performance optimization. LABJS is a file loader.

Requirejs and SEAJS are modular loaders that advocate a modular development philosophy, and the core value is to make JAVASCRIPT modular development simpler and more natural.

Module loaders can generally be degraded to file loaders, so the Requirejs and Seajs can also be used to achieve LABJS performance optimization.

Both Requirejs and Seajs are very good modular loaders, and the difference is as follows:

1. There is a discrepancy between the two positions. Requirejs wants to be a browser-side module loader and also wants to be a module loader for environments such as Rhino/node. Seajs is focused on the Web browser side and can be conveniently run on the node server side through node extensions

2. There are differences in the standards followed. Requirejs follows the AMD (asynchronous module definition) specification, SEAJS follows the CMD (Common module definition) specification. The difference between the specifications leads to the difference between the APIs. Seajs is more concise and elegant, closer to Commonjs modules/1.1 and Node Modules specifications.

3. There are differences in the concept of the community. Requirejs is trying to get the third party library to modify itself to support Requirejs, which is currently adopted by only a handful of communities. Seajs is not strong push, and adopt the way of independent encapsulation to "Haina Rivers", now has a more mature packaging strategy.

4. There is a difference in the quality of the code. Requirejs is no obvious bug,seajs is obviously no bug.

5. There are differences in support for debugging and so on. Seajs through Plug-ins, can realize the function of automatic mapping in Fiddler, also can realize automatic combo function, very convenient and convenience. Requirejs has no support in this respect.

6. There are differences in the plug-in mechanism between the two. Requirejs take is in the source code to set aside the form of the interface, the source code left for the plug-in and write. SEAJS's plug-in mechanism is the same as Node: open itself, so that the plug-in developers can directly access or modify, so very flexible, can implement various types of plug-ins.

There are a lot of details of the difference will not say more.

In short, SEAJS is simpler and more elegant than requirejs from API to implementation. If Requirejs is the Prototype class library, then Seajs is the JQuery class library.
Author: Yuber
Link: http://www.zhihu.com/question/20342350/answer/14828786



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.