Meteor 3.3.2 Now Available: MongoDB and security fixes, accounts-base and DX improvements

Meteor 3.3.2 is now available and recommended!

This release focuses on fixing security issues, bugs and DX, catching up on a few errors around the npm-mongo-legacy and mongo, bumping up sha.js, and attaching findUserByEmail to accounts-base.

:paperclip: Meteor 3.3.2 full changelog

Hands on

To start using Meteor 3.3.2.

Update Your App

# Update your existing Meteor app to version 3.3.2
meteor update --release 3.3.2

Create a New App

# Create a new Meteor app using Meteor 3.3.2
meteor create my-app --release 3.3.2

Highlights

Async-compatible account URLs

Accounts.urls lets you customize the action URLs inside system emails.
By default, they are simple sync links like #/reset-password/:token. Now you can define them as async if needed.

// Example: include the email or other info in the resetPassword email URL
Accounts.urls.resetPassword = async (token) => {
  const user = await Meteor.users.findOneAsync(
    { "services.password.reset.token": token },
    { fields: { "services.password.reset.email": 1 } }
  );
  const email = user.services?.password?.reset?.email;
  return Meteor.absoluteUrl(
    `reset-password/${token}?email=${encodeURIComponent(email)}`
  );
};

Move findUserByEmail method from accounts-password to accounts-base**

Now you don’t need to install accounts-password to use findUserByEmail

meteor remove accounts-password

Return insertedId on client upsert to match Meteor 2.x behavior

For those that use 3.x, upsert methods returns insertedId

// Upsert (insert case)
const upsertInsertResult = await c.upsertAsync({name: 'doc2'}, {$set: {value: 3}});
test.isTrue(upsertInsertResult.hasOwnProperty('insertedId'));

// Upsert (update case) 
const upsertUpdateResult = await c.upsertAsync({name: 'doc1'}, {$set: {value: 2}});
test.isFalse(upsertUpdateResult.hasOwnProperty('insertedId'));

Unrecognized operator bug fixed

The issue with unrecognized operators in queries has been resolved, ensuring smoother query execution and improved error handling.

Meteor.publish('Home', function(viewport) {
 check(viewport, Match.ObjectIncluding({bounds: geoPolygonSchema}));
 // don't throw error anymore
 return Features. find({
   'hull': {$geoIntersects: {$geometry: viewport.bounds}},
 });
});

Big up contributors

We want to highlight how important community members contributions have been in delivering these changes.

Thanks to our core contributors: @nachocodoner, @italojs, @graemian, @Grubba27 and @copleykj-Goel1107

Join us and contribute! Check out Meteor GitHub issues or start with Good first issues.

What’s Next?

10 Likes