Pass empty dependency array for AMD to prevent dependency scanning #12

Merged
merged 1 commit into from Mar 24, 2014

Projects

None yet

4 participants

@jrburke
Contributor
jrburke commented Jan 12, 2014

AMD loaders will scan for require('dep') style dependencies when just a factory function is passed to define (no dependency array). Now that projects may use CommonJS/Node modules internal to source function to generate the final exports, this is causing some undesired matching behavior, the AMD loader may also try to load modules for those require('dep') names.

Passing an empty dependency array, as this changeset does, avoids that factory function scanning and possible confusion around if the UMD-wrapped code has dependencies.

@jrburke jrburke referenced this pull request in requirejs/almond Jan 12, 2014
Closed

Does 'namespace' work with almond? #77

@kebot
kebot commented Mar 24, 2014

+1, it will be helpful.

@dexteryy

@jrburke @ForbesLindesay @substack This issue has affected Browerify and React. The latter contains require('dep') in comments.

http://dragon.ak.fbcdn.net/hphotos-ak-prn1/t39.3284-6/851567_673854412678843_1478589082_n.js

/**
 * Collection of methods that allow declaration and validation of props that are
 * supplied to React components. Example usage:
 *
 *   var Props = require('ReactPropTypes');
 * ...
 */
@ForbesLindesay ForbesLindesay merged commit bfad223 into ForbesLindesay:master Mar 24, 2014

1 check passed

default The Travis CI build passed
Details
@kebot kebot referenced this pull request in reactjs/react-bower Jul 6, 2014
Closed

Pass empty dependency array for AMD. #3

@ForbesLindesay
Owner

Would you like to be added as a collaborator on this repository?

@jrburke
Contributor
jrburke commented Feb 9, 2015

That is not necessary, the commit log is enough for me.

@jrburke jrburke referenced this pull request in cujojs/when Feb 10, 2015
Closed

Paths for lib modules not resolving #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment