firehoseio/firehose

Accessing the .js file

jscott1989 opened this issue · 7 comments

I want Firehose to sit alongside the rest of my application (which is in Python).

My preferred use of it is for my python app to push updates to firehose, which pushes it to the browsers.

This seems like it would work except that I can't really figure out how to get the .js file needed. Is there a prebuilt version of it anywhere?

There's not, just the coffeescript files. Can you use bower from Python? Also, how do you plan to run the server? Separate Ruby process from Python?

Yeah the plan is to run Firehose as a completely separate process.

I currently use bower for other requirements but wasn't able to find a bower firehose file (I found something called "FirehoseJS" and was disappointed :P).

Compiling firehose.js.coffee with the standard coffee-script compiler just gives me:

// Generated by CoffeeScript 1.6.3
(function(){}).call(this);

You need to compile the assets with sprockets.

I started writing a CLI that can compile on branch https://github.com/polleverywhere/firehose/tree/asset_compiler but stopped short of merging into because Sprockets insists on compiling fingerprinted assets.

You can run it by:

  1. Pull the asset_compiler branch from this repo.
  2. Run bundle && bundle exec bin/firehose assets

The JS file will be in something like firehose-17234ca175a66b84712bc34cae80f9aa.js.

Note that json2.js is included in this bundle. I probably need to make a compiler that excludes dependencies, but for now you can delete it from the JS file.

@jscott1989 I'm closing this issue. Please comment how this solution worked out.

Hi, I'm sorry! I forgot to respond to this.

It worked perfectly. This should probably be written down somewhere more permanent as I can't imagine I'm the only one with this requirement.

Thanks for the help @bradgessler :)

Excellent! I'll merge this into master, clean it up, and document.