Backward compatibility with 3.0

I’ve got 500+ methods in my codebase. If I want to upgrade to Meteor 3.0 that’s going to be a huge undertaking, and my basic attempts so far have failed.

Is there a chance of getting backward compatibility so that the existing Collection.find().fetch() stuff will still work in the new version? Or is that effectively off the table?

The decision point is already beyond this, as there was no easy way of maintaining backward compatibility as fibers became unsupported with current node versions.

Hi, I’m a little confused here.

If you are asking if there is a way of keeping Collection.find().fetch() sync, the answer is no. rjdavid summarised below why.

Now, if your question is about the other post, that example should be working…

Can you provide more details of your code?

One thing I see as a problem there is that on the client, you’re using a Meteor.call to call an async method. You should use Meteor.callAsync in the client as well.

If you could provide a reproduction of that example, it would be easier to tackle the problem.

2 Likes

@jasongrishkoff Here is a polyfill for client-side synchronous cursor.fetch(). Use that, or use useFind directly if you can.

PS Sorry, got confused. This question is about methods not publications. There is no way around async on the server.

Keep in mind that this workaround (not polyfill!) will work only on the frontend and only because of the way the underlying code works. I can’t tell for the Meteor team, but it wasn’t my intention to suggest using it in projects.

1 Like

You will need to convert your methods to async. It’s lots of pain but you just need to do it once.
There is a tool which may help you: How did I migrate our app to new Async API (Meteor 2.8+)

1 Like