Skip to content

Releases: gfranko/amdclean

Improved AMD Support and Removed Unique Module Name Checking

15 Oct 19:38
Compare
Choose a tag to compare
  • Internally, escodegen, estraverse, escodegen, and underscore are listed as AMD dependencies. As long as you use those exact names for each respective library, everything will work with AMD.
  • No longer checking for unique module names/ids, since requirejs will handle this.

Bug Fixes

15 Oct 07:11
Compare
Choose a tag to compare
0.2.5

Version 0.2.5 Stable

Support Ignoring Certain Define() and/or Require() Methods

15 Oct 04:58
Compare
Choose a tag to compare

If you don't want one or more define() and require() methods to be removed by amdclean, then you must put a comment with only the words amdclean on the same line or one line above the method in question. For example, amdclean would not remove the define() method below:

// amdclean
define('example', [], function() {});

Improved CommonJS Support and Relative File Path Normalizing

14 Oct 22:37
Compare
Choose a tag to compare

With this release, there is now support for converting CommonJS require() variable declarations inside of define() modules. This can be extremely helpful when using the r.js cjsTranslate configuration option.

CommonJS

Here are a few examples:

This:

var x = require('third');

Becomes:

var x = third;

This:

var x = require('third').exampleProp;

Becomes:

var x = third.prop;

This:

var x = require('third').exampleProp();

Becomes:

var x = third.exampleProp();

Relative File Paths

Also, relative file paths are also now getting normalized to JavaScript-standard variable names.

This:

define('./someModule', function() {}

Becomes:

var someModule = function() {})();
define('../modules/someModule', function() {}

Becomes:

var modules_someModule = function() {})();

Replace semicolon removal logic with Estraverse

14 Oct 21:29
Compare
Choose a tag to compare

Use Estraverse to remove left-over semicolons from removing require() calls

Improved Define() Function Conversion

13 Oct 03:13
Compare
Choose a tag to compare

Define() method calls that have one or more dependencies will now be converted like this:

AMD

define('example', ['example1', 'example2'], function(one, two) {

});

Standard

var example = function (one, two) {

}(example1, example2);

Unit Tests, Doc Updates, Minor Tweaks

12 Oct 19:58
Compare
Choose a tag to compare
  • Created Jasmine unit tests and added Travis CI support
  • Updated the README to demonstrate how to use amdclean with Grunt
  • Added comments to the source code for clarity
  • Reset the internal moduleNameStore back to an empty object after each clean() method call to prevent unnecessary duplicate module name errors.

Make the Browser Module Consistent

11 Oct 13:18
Compare
Choose a tag to compare

Expose a global amdclean windows property instead of a cleanamd windows property.

Initial Release

11 Oct 02:13
Compare
Choose a tag to compare
  • Added documentation
  • Published to NPM