pouchdb-community / pouchdb-load

Load documents into CouchDB/PouchDB from a dumpfile
Apache License 2.0
120 stars 33 forks source link

(#18) - Support AMD #20

Closed ddouglascarr closed 9 years ago

ddouglascarr commented 9 years ago

Adds support for require.js and the like.

For issue #18

nolanlawson commented 9 years ago

I've taken a stance with all my plugins to not support AMD or UMD, because it would be too much effort to fix all of my projects to support every JavaScript packaging format.

If you'd like to use AMD, then you are encouraged to build from source. dist is a convenience thing for old-school people who still prefer globals (which based on the research I've done, is the vast majority of JavaScript users). Sorry to be "that guy" about this, but gonna close this issue.

nolanlawson commented 9 years ago

Actually on second thought, since this seems like such a clean PR, maybe I should look into applying this patch to all my plugins as well as the plugin-seed.

@ddouglascarr something I don't understand - have you been able to use PouchDB with RequireJS/AMD up to this point? I wasn't aware we were even supporting it in PouchDB itself.

ddouglascarr commented 9 years ago

Hi @nolanlawson.

PouchDB just worked for me with require.js. Most libraries that create a global attribute do. The reason that the plugin doesn't is because it tries to modify the PouchDB global, which is not the PouchDB that it has access to.

I fully understand your attitude towards AMD loaders, and would probably adapt a similar policy myself in your position.

nolanlawson commented 9 years ago

Yeah, I think I just don't want to support AMD. Too much effort, and people can always write wrappers for browserify.