AMD and CMD is dead Kmd.js version 0.0.2 released

Source: Internet
Author: User

Update

Formally switch from UGLIFYJS to UglifyJS2

Increased dependency visualization capabilities

Compress code more easily

Unified Style: If the class name of main is not omitted

Optimized the KMDJS pipeline

Fixed countless bugs

Open Debug mode via SRC

Code format Force semicolon to end or error

Problem

1. Switching from UGLIFYJS to UglifyJS2, the main UglifyJS2 is to more strictly standardize the AST, and provides a convenient ast.walk traversal JS code syntax tree, the analysis of any code is extremely thorough, than the huge complex regular expression stability more reliable, through the UGLIFYJS, so that developers can put the JS Code arbitrary assembly optimization compression landscaping, so that users have unlimited play space.

2.UGLIFYJS2 is not compatible with the old version of IE, a lot of new methods are used, so here is a waste of time to fix the method on prototype. such as: JSON, Array, String, and so on.

3. Developers who have used Kmdjs know that KMDJS does not have require keywords. In such things as CMD and AMD, Main.js must use the Require keyword. And this is very contrary to conventional thinking, because Main.js is also the code in the project, since it is the code in the project, it must also be in a module, that is, a certain namespace, and Kmdjs is so dry. Main.js inside except more kmdjs.config, the rest of the code and other JS, are using define beginning, must declare a name.

4. Regarding the mandatory addition of a config to Main.js, this is very inhumane, thought Main.js is just an entrance. Kmdjs.config does not fall within the scope of its duties. But this is the result of forced helplessness. In the earliest version of Kmdjs, Config uses a separate JS store, which, while loading KMDJS, will initiate an AJAX request load via XMLHttpRequest Config,config the name of the project and the BaseURL and namespace, The relationship between path and class. The future config will also be responsible for configuring that JS lazy load. But one of the major pitfalls of this design is that browsing the KMDJS project has to start with a Web server, with the file system open and an error. So decisively removed, directly the config exists main.js the top.

Kmd.js VNEXT

The next version of Kmdjs, v0.0.3, will add a significant and useful lazy load. Please look forward to ...

Address

Https://github.com/kmdjs

AMD and CMD are dead. I'm not serious, I just want to see AMD and CMD lying in a pool of blood.

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.