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
Meteor.Collection !== Meteor.Collection.prototype.constructor #6
Comments
…ructor in rclai/meteor-collection-extensions. See: Meteor-Community-Packages/meteor-collection-extensions#6
I totally get your pain. I'm not a big fan of this monkey-patching business, which is one of the reasons that I wanted to create this package, reluctantly, so that the blame can get pointed to one destination, instead of many, until a more suitable solution is available. There is a Meteor issue pending to be addressed for a better solution of extending I agree with the implementation that you suggest there, but that would result in a Meteor-community-sized shockwave of doom. There are numerous packages that depend on Aside from this, if this issue stems from Coffeescript using |
I've created a PR. Let me know if this works. |
After loading this package, the
Meteor.Collection
object is left halfway between the old state and the extended state. Any package that extends the patchedMeteor.Collection
using prototype inheritance, such as using Coffeescript class / extends will fail to use the monkey-patched constructor.Here's the issue where I discovered this: vsivsi/meteor-file-sample-app#2 (comment)
I'm not embarrassed to say that I'm pretty opinionated about this, and I'm going to add more sanity checks and throws to my packages to defend against other packages that misbehave when replacing Meteor provided standard system calls.
IMO, the safe and sane way to extend
Mongo.Collection
is via a mechanism that supports, e.g.:If the app developer wants the "convenience" of setting
Mongo.Collection = extraExtendedCollection
then let that be their choice.The text was updated successfully, but these errors were encountered: