Ryan, Thanks for your patience. I'm not trying to be willfully ignorant, but I'm still not sure what you are trying to say exactly. Twitter is the worst except for everything that's come before it. Let me try to break down your last tweet:
its not for lib authors who want to depend on other libs that aren't UMD or export to everything, that's my entire point.
What is "its"? I'm assuming you were referring to my previous tweet: "interop is possible for lib authors". So you mean:
Interop is not possible for lib authors who want to depend on other libs that:
- are not umd, or
- do not export to everything
I agree with that with some qualifications. Some terms:
library
- the library someone is authoringdependency
- a dependency of thelibrary
app
- an application that wants to usedependency
The qualifications:
-
The
app
can't use something like SystemJS. -
The
app
can't include a Browserify "super-plugin". For example, I think browserify-config might be able to handle AMD? Not entirely sure. But there's probably browserify plugins or one can be made that works with AMD. -
The
app
can't include a "commonjs" plugin for RequireJS (probably an installable dependency oflibrary
) that would allow RequireJS to process commonjs likedefine(["commonjs!querystring","underscore"] ...)`.
This is how library
would export it's AMD build.
-
library
wants existing package installers (npm / bower) to be able to do the install of LIB dependencies without post-install transpiling/building. -
library
does want to package those dependencies inside themselves. I think this is probably ok for node environments (it's common that two dependencies might install the same dependency that is not shared). And with RequireJS's bundle config, one could point the "bundles" config atlib
like:```js RequireJS.config({ bundles: {lib: ["querystring"]} }) ```
Now that I've written all that out, it's probably doable by making RequireJS or Bower understand the other format, or being ok packaging your dependency internally. I can see how "making RequireJS or Bower understand the other format" is a cheat.
Thanks for talking through this with me.
After thinking about it more, "packaging your dependency internally" is not a solution for RequireJS. If any other project also packages, you are loading it 2x.