firehoseio / firehose

Build realtime Ruby web applications. Created by the fine folks at Poll Everywhere.
http://firehose.io/
MIT License
727 stars 72 forks source link

Missing modules with Sprockets? #26

Closed jweissman closed 11 years ago

jweissman commented 11 years ago

I'm having a lot of trouble with Firehose.io and the asset pipeline. Everything seems to go smoothly when config.assets.debug is true, but when I set to false and Sprockets attempts to concatenate everything together, for some reason certain modules don't seem to be getting loaded.

In particular, Firehose.Consumer is missing! Here's what the window.Firehose object looks like at the console in this context:

Object {version: "1.1.0", codeName: "Rockin' Reconnect", Transport: function, LongPoll: function}
  LongPoll: function LongPoll(args) {
  Transport: function Transport(config) {
  codeName: "Rockin' Reconnect"
  version: "1.1.0"
  __proto__: Object

I'm wondering if I'm just missing something here. I'm just including of the Firehose manifest at the end of my own Sprockets manifest with //= require firehose. Note I'm definitely seeing the Firehose.Consumer module in the concatenated Javascript -- I'm wondering if there's something different with how the WebSocket and Consumer modules reference/declare themselves?

jweissman commented 11 years ago

I think I might have figured it out. I'm getting a stray exception in LongPoll around a missing reference (something about the MSIE browser check.) I think I will plan to fork and see if I might be able to workaround to see if that resolves it...

jweissman commented 11 years ago

Have worked it out in a fork and put a pull request together here: https://github.com/polleverywhere/firehose/pull/27