Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Provide CommonJS support #69

Open
mulderp opened this issue Jun 27, 2014 · 5 comments
Open

Provide CommonJS support #69

mulderp opened this issue Jun 27, 2014 · 5 comments

Comments

@mulderp
Copy link

mulderp commented Jun 27, 2014

Hi!

Until recently, I was using this shim to run Backfire with CommonJS support: https://github.com/cloud-walker/client-backfire

Unfortunately, the project has been deprecated. Any option to have CommonJS support built in in Backfire?

That would help running small Browserify projects like these: https://github.com/pipefishbook/pipefishbook.github.io

Thanks!

@katowulf
Copy link
Contributor

katowulf commented Jul 4, 2014

Here was an initial approach at integrating this (also in the closed pull request): https://gist.github.com/katowulf/acd0b51b740782f1851e

The difficulty is that if we inject require('firebase'), the factory resolved the server NPM module 'firebase' (see https://www.npmjs.org/package/firebase ), what we would need is the client-side version of firebase (see https://www.npmjs.org/package/client-firebase ).

This means, if we inject:

 require('client-firebase')

everything works great.

Here is @mulderp's working example: https://github.com/mulderp/debug/blob/master/app/main.js

All in all it would be awesome, if one would just have to do:

 $ npm install backfire

then, in a file main.js:

var Backfire = require('backfire')

And have e.g. Backbone.Backfire.Collection({ firebase: 'someUrl' })

@katowulf katowulf added this to the Future Release milestone Sep 15, 2014
@davideast davideast mentioned this issue Jan 13, 2015
9 tasks
@chuangbo
Copy link

+1

@bricejlin
Copy link

+1!!

@ChetHarrison
Copy link

Hey all. I just added the UMD wrapper in a PR. Once they merge it It should work with requirejs and commonjs as well as the global.

@mbrevda
Copy link

mbrevda commented May 11, 2016

PR in #147

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants