lauripiispanen / angular-bacon

Angular-bacon.js bindings
MIT License
146 stars 16 forks source link

Use umd wrapper #16

Open mr-mig opened 9 years ago

mr-mig commented 9 years ago

Can you please use umd wrapper and publish the module to npm?

lauripiispanen commented 9 years ago

Published. UMD wrapper is a bit problematic though - even though Angular team started to publish their releases to npm, they don't export Angular as a CommonJS module yet. Angular will therefore always require some amount of shimming depending on which bundler you're using.

If you have a straightforward solution to this, I'd love to see it! Otherwise I'm going to close this issue for now, and revisit it once Angular supports CommonJS better.

mr-mig commented 9 years ago

Angular will therefore always require some amount of shimming depending on which bundler you're using.

Yes, that's a common problem. There is angular-cjs shim for cjs modules, and shimming is pretty straightforward with AMD.

Otherwise I'm going to close this issue for now, and revisit it once Angular supports CommonJS better.

I am skeptical about this, as they have some issues with merging AMD-related pull requests for a long time.

Anyway, I am using both CJS/AMD modules and UMD will be much helpful.

mr-mig commented 9 years ago

I need this thing as I am planning to use angular-bacon with my "framework" based on angular (from now on). I will either use requirejs or webpack (which supports AMD/cjs/es6 modules) as a opinionated module loader for those stuff.

lauripiispanen commented 9 years ago

Sure, I think I'm going to do a proof of concept sometime next week to explore some options on how that might work with Browserify, RequireJS and Webpack.

mr-mig commented 9 years ago

If you need the setup for angular, you can see it here:

  1. w webpack: https://github.com/packetloop/angular-webpack
  2. w requirejs: https://github.com/tnajdek/angular-requirejs-seed/blob/master/app/js/main.js