Upgrade Meteor 1.2.0.1 and deprecated package


#1

hi

After update 1.1.0.3->1.2.0.1 there were appear several errors, I removed deprecated package meteor-platform.
Errors were following:

  1. In the package mizzao:timesync the function check is undefined.
    Exception in template helper: ReferenceError: check is not defined

    TimeSync.serverTime = function(clientTime, interval) { // 79
    check(interval, Match.Optional(Match.Integer)); // 80
    // If we don’t know the offset, we can’t provide the server time. // 81
    if ( !TimeSync.isSynced() ) return undefined; // 82
    // If a client time is provided, we don’t need to depend on the tick. // 83
    if ( !clientTime ) getTickDependency(interval || defaultInterval).depend(); // 84
    // 85
    // SyncInternals.offsetDep.depend(); implicit as we call isSynced() // 86
    // Convert Date argument to epoch as necessary // 87
    return (+clientTime || Date.now()) + SyncInternals.offset; // 88
    }; // 89

  1. In the package alanning:roles function Match is undefined
    Exception in template helper: ReferenceError: Match is not defined

    isInRole: function (role, group) { // 46 // 774
    var user = Meteor.user(), // 47 // 775
    comma = (role || ‘’).indexOf(’,’), // 48 // 776
    roles // 49 // 777
    // 50 // 778
    if (!user) return false // 51 // 779
    if (!Match.test(role, String)) return false // 52 // 780
    // 53 // 781
    if (comma !== -1) { // 54 // 782
    roles = _.reduce(role.split(’,’), function (memo, r) { // 55 // 783

To solve these problems I discovered two ways:

  1. to comment function check and Match
  2. to install meteor-platform: meteor add meteor-platform

First way is inconvenient, second way is rum.

Is there correct method to solve these problems?


#2

This thread may shed some light (although it won’t help with the inconvenience :wink:).


#3

I would not say that 1) is a solution.

Approach 2) is valid. It adds a number of dependencies in one go. some of them you may never use.

So, a third option is to add the package dependencies individually: meteor add check (which covers both check and match method)


#4

Great!

meteor add check helped