percolatestudio / publish-counts

Meteor package to help you publish the count of a cursor, in real time
https://atmospherejs.com/tmeasday/publish-counts
MIT License
200 stars 46 forks source link

add underscore as dependency #89

Closed sebakerckhof closed 8 years ago

sebakerckhof commented 8 years ago

This fixes reference errors (ReferenceError: _ is not defined) on Meteor 1.4

boxofrox commented 8 years ago

I created a simple app with Meteor 1.4.1.1 app and publish-counts 0.7.3, and could not generate a ReferenceError with respect to underscore on server or client.

@tmeasday, @dburles any issues you know of with explicitly assigning underscore as a dependency? As I recall, Meteor pulled in underscore itself which caused problems with apps that wanted to use newer versions of underscore, but that was awhile back (thinking Meteor 1.1). I haven't done much with Meteor since then.

@sebakerckhof does the ReferenceError appear in the server logs, browser console, or on a different platform altogether?

sebakerckhof commented 8 years ago

@boxofrox Well, it's not really 1.4 specific, but since Meteor introduced NPM support (so 1.3+) it's easy for packages/apps to include e.g. lodash instead of underscore and therefore applications can choose not to include underscore by default, which will result in the error.

Reproduction: https://github.com/sebakerckhof/publishcountsproblem

boxofrox commented 8 years ago

Found the test units also produced the error. Added underscore dependency to test section.

Fixed in v0.8.0. Also fixes #81.

Thanks for the pull request @sebakerckhof, and especially thanks for the reproduction example!