Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Meteor.users instanceof Mongo.Collection = false in IE < 10 or so #122

Open rclai opened 9 years ago

rclai commented 9 years ago

When you implemented replacing the prototype of Meteor.users, were you able to find a solution to get it to work for IE < 10? Or were you stuck (like I was)?

matb33 commented 9 years ago

I had a solution... I think... Perhaps it had to do with the presence of this file: https://github.com/matb33/meteor-collection-hooks/blob/v0.7.5/bind-polyfill.js which has since been removed

comus commented 9 years ago

hi, recently i found my meteor-telescope app needs IE version >= 11 to run. because telescope use collection-hooks. and collection-hooks needs IE versions >= 11 and my meteor app crashed if i use IE<11. it's __proto__ problem, i know.

I just want my meteor app not crash and then alert some message such as "please update your browser"

finally, i modified collection-hooks some source.

matb33:collection-hooks v0.7.13 users-compat.js i added last 3 lines

if (Meteor.users) {
  // If Meteor.users has been instantiated, attempt to re-assign its prototype:
  CollectionHooks.reassignPrototype(Meteor.users);

  // Next, give it the hook aspects:
  var Collection = typeof Mongo !== "undefined" && typeof Mongo.Collection !== "undefined" ? Mongo.Collection : Meteor.Collection;
  CollectionHooks.extendCollectionInstance(Meteor.users, Collection);

  if( !(Meteor.users instanceof Mongo.Collection) && Meteor.isClient ) {
    Meteor.users = jQuery.extend(true, new Mongo.Collection(null), Meteor.users);
  }
}

it works, and telescope runs without errors, although the stylesheets crashed with old browser. i dont know is it ok enough

StorytellerCZ commented 4 years ago

@comus Could you submit a PR for this if it is still and issue? Thank you!