Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CommonJS support in accordance w/ Angular convention #567

Merged
merged 1 commit into from
Feb 26, 2015

Conversation

bendrucker
Copy link
Contributor

Implements #566

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.85% when pulling 718c375 on bendrucker:cjs into db222d0 on firebase:master.

@katowulf
Copy link
Contributor

Thanks, Ben! Let me find some time to review and see if we can get this in 1.0

@katowulf katowulf self-assigned this Feb 26, 2015
@jamestalmage
Copy link
Contributor

IMO, this is a no brainer. It is now the official way angular exports modules for CommonJS consumption. The sooner I can stop shimming these, the better.

@@ -23,7 +23,7 @@
"firebase",
"realtime"
],
"main": "dist/angularfire.js",
"main": "index.js",
"files": [
"dist/**",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also list index.js in the files list right here. It may not be required since npm may automatically include the file listed in main, but I'd prefer to see it listed in files as well.

@jwngr
Copy link

jwngr commented Feb 26, 2015

Yeah, I mean this looks like goodness to me. I made one comment which I'd like to see addressed but then I'm a thumbs up on merging this in.

@jwngr
Copy link

jwngr commented Feb 26, 2015

Actually, now that I think about it, I'm not sure this is compatible with the fact that we got rid of $firebase in favor of three separate services, $firebaseArray, $firebaseObject, and $firebaseAuth, all of which can be injected invidually. @bendrucker, I'm not sure how that fits into the string we are exporting here.

@jwngr
Copy link

jwngr commented Feb 26, 2015

Ignore my last comment; not thinking properly today. The module is still called firebase, so we are all good.

@bendrucker
Copy link
Contributor Author

Totally right on the need to include it in files. That's done. And per your comment and correction, that's exactly right. It only has to do with the module name, not any of the injectables.

This requires much less of a hack and dries up your modules when you do build with Browserify.

Here's ES5: https://github.com/bendrucker/angular-stripe/blob/f93a874097b30c757410ac5d5050a020edc01590/src/index.js

And ES6: https://github.com/bendrucker/angular-countdown/blob/bd5555d2302204f8e8874d78d95c4a9b3879a683/src/index.js

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.85% when pulling 30861bd on bendrucker:cjs into db222d0 on firebase:master.

@katowulf
Copy link
Contributor

Looks good, Ben. Thanks.

katowulf added a commit that referenced this pull request Feb 26, 2015
Add CommonJS support in accordance w/ Angular convention
@katowulf katowulf merged commit 1d32609 into FirebaseExtended:master Feb 26, 2015
@bendrucker bendrucker deleted the cjs branch February 26, 2015 21:58
@bendrucker bendrucker mentioned this pull request Feb 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants