Hello all,
I really don’t know if this is of any interest for someone, but I feel like maybe it could be of some use to have another thread to share some experiences and thoughts about moving projects towards meteor 3.0
About myself+my project: I have a private repo on meteor 2.12 + react + react native client, that is an app for the organization of schools, such as timetable and substitute schedules, resource management etc.
I have some server internal methods (~450) and quite a lot pubs and methods and just started building a restful api to get some existing third party apps connected.
All of this is done in my free time as a side project, since in my main job I’m a teacher, but I really love developing the project, since I hope it might help a lot of people in school with their job&learning. Currently I have around 3200 users using the app actively. I deployed the app at scalingo.io. When I started this project around two years ago I had no clue on nodeJS, react or anything, but since I white labeled Rocket.Chat + RN client for our school during the pandemic I came across meteor and love it since I finished the react todo tutorial
This is how I move to 3.0:
First I used this guide here and the jscodeshift scripts to get a first conversion of my internal server methods. That really worked quite well, but some schemes won’t get covered (such as array.forEach(...)
or array.some( async (item) => {} )
patterns like that).
In order to make sure that everything works as expected I‘m adding mocha Tests for all of these methods. That’s taking a lot of time but currently I’m at about 90% test coverage.
I also rely on several packages, like Roles and Migrations, also meteor-push and ostrio:files
For Roles and Migrations I have forks where I added async functions (like Roles.userIsInRoleAsync(...)
) to move await from fibers. But there’s a lot of testing required here, especially for async Roles methods. (One can easily run into serious problems when checking Roles like if (Roles.userIsInRoleAsync(user, "admin")) { ... }
)
I also used Collection Hooks to get some tenancy functionality into my app, but I couldn’t get and async version of this running, so I implemented tenancy functions without hooks.
I guess that ostrio:files will also needed to be updated to async functions.
Also, I could find any async version of these meteor Accounts url functions, but maybe this has changed in the meantime.
Finally I still have some basic questions on how the client will be affected. As fibers only live on the server, will I still be able to use Meteor.call from the client side via (err,res) => {}
-style callbacks? (Would be quite a time-saver…).
Alright, will now get my last couple of tests ready. I’d be really interested in sharing experiences with all other devs moving their apps to meteor 3.0.
Thanks for the meteor team for all the work they put into meteor! Keep going guys!