Is it safe to update Meteor Underscore to 1.7.0?

It comes from this thread:

Best way to deduce keys with invalid values ​​(NaN, blank, etc.) from an object?

I couldn't get the commenter underscore method to work because Meteor uses Underscore 1.0.0 and some features don't work like Underscore 1.7.0 does.

From the Meteor docs:

We've slightly changed the way Underscore distinguishes between objects and arrays in the collection functions. The original Underscore logic is to treat any object with the numeric length property as an array (which helps it work correctly in NodeLists). In the Meteor version of the subtree, objects with a numeric length value are treated as objects if they have no prototype (in particular, if x.constructor === Object.

So it seems like Meteor changed Underscore a bit.

Has anyone here forced Meteor to use Underscore 1.7.0 in their application and got some weirdness?

+3


source to share


1 answer


If you look at the history of the underscorejs package in the meteors repository, you can see that they actually changed the underscorejs library instead of monkeypatching it. ( here and here )

Therefore, I highly recommend not updating the underscorejs version.



If you really need to update, I suggest trying to apply the meteor version commits to the latest version. Fortunately, the package contains tests for the fixes performed by the meteorite team. So start by updating your underscorejs file and then run your tests, if they all pass you will probably be happy.

+4


source







All Articles