MeteorJS 3.0 major impact estimated for July 2024 ☄️ - here is all you need to know 🧐
Tags: javascript, webdev, meteor
Published: 2024-06-24 18:14:25

The next major [MeteorJS](https://meteor.com) release is coming in July 2024! After more than two years of development, this is the final result. The [first discussions started in June 2021](https://github.com/meteor/meteor/discussions/11505) and there has been multiple alphas, betas, rcs and a huge amount of package updates. These were constantly battle-tested by the Meteor Core team and the Community, shaping the features and performance of the platform one by one.

## Table of contents


1. [Back in 2021 - the Fibers situation](#back-in-2021-the-fibers-situation)
2. [Biggest changes](#biggest-changes)
3. [Will it have consequences?](#will-it-have-consequences)
4. [Conclusion](#conclusion)
5. [Resources to help you migrate your Meteor app](#resources-to-help-you-migrate-your-meteor-app)


---
## Back in 2021 - the Fibers situation

MeteorJS emerged from a JavaScript framework towards a true full-stack development platform, batteries included. One of its *greatest advantages* was to provide features like **optimistic UI, zero-config, reactivity out of the box and support for many popular front-ends**, which are still among [its core features nowadays](https://dev.to/meteor/5-core-concepts-you-should-know-about-meteorjs-in-2024-5fpb).

Since pre-1.0 versions, MeteorJS relied on `fibers` (coroutines) as its back-end for async programming, long before `async/await` became a thing. That was revolutionary for developers: writing async code naturally, in sync-style, without callbacks or other nesting structures, resulting in more comprehensible code and a better developer experience.

In April 2021, `fibers` became [incompatible with Node 16](https://github.com/meteor/meteor/discussions/11505) and therefore, Meteor was pinned to Node 14. It was clear that that replacing `fibers` with `async/await` for the entire ecosystem was the only future for MeteorJS. That way, it would always be up-to-date with the latest Node LTS and support the majority of NPM packages out there.

---
## Biggest changes

The core-repository development for this major release gathered [over 2300 commits, affecting over 800 files](https://github.com/meteor/meteor/pull/13163), split in [over 200 pull requests](https://github.com/meteor/meteor/pulls?q=is%3Apr+is%3Aopen+base%3Arelease-3.0), involving contributors from the Meteor Core team and the Community. The efforts for all affected packages are uncountable as they are distributed across the whole community.

The following table lists the most impactful changes:

|change|what happend|
|----|-----------|
|dropping Fibers|replace any `fibers`-reliance with `async/await`|
|top-level await|use `async/await` without the need for an IIFE|
|async database|make all MongoDB interactions `async/await`|
|async accounts and oauth|ensure accounts, 2FA, passwordless and OAuth packages are async and thus, still zero-config|
|ARM support|finally support MeteorJS on ARM architectures|
|replace connect with express|drop connect to use express as webserver|
|docs upgrade|the entire documentation system was rewritten, replacing hexo with docusaurus, integrating Ask AI into the new docs|
|upgrade Node|stick to the latest Node LTS (20 as of writing this article)|
|update DDP|make the whole DDP/Websocket infrastructure and data layer compatible with the `async/await` while avoid breaking isomorphism where possible|
|update build system|make the build system (isobuild) work without `fibers`|
|Galaxy 2|the official **zero-config hosting platform for MeteorJS apps** has been upgraded with a facelift and many quality of life features|

Furthermore, there were [many fixes, patches, and updates to NPM dependencies and skeleton projects](https://github.com/meteor/meteor/blob/release-3.0/docs/history.md), all aimed at ensuring that MeteorJS remains zero-config by default for many of its core features.

---
## Will it have consequences?

### If you are new to MeteorJS:

No worries! Just follow the [new docs](https://v3-docs.meteor.com/) to create a new project with Meteor 3.0 and develop amazing apps quickly.

```shell
$ npm install -g meteor
$ meteor create --release 3.0-rc.4 # soon --release is not required anymore
```

### If you have an existing Meteor apps or packages: 

Every (**I repeat: every**) Meteor app out there **was affected!** They had to be rewritten in order to being able to upgrade towards 3.0 or otherwise being stuck on Node 14.

This especially involves any database interaction, the backbone of most MeteorJS apps. It also applied to any package with reliance on `fibers`. Consider the following example:

```js
import { Meteor } from 'meteor/meteor'
import { Mongo } from 'meteor/mongo'

const Tasks = new Mongo.Collection('tasks')
```

Before 3.0, using fibers

```js
Meteor.methods({
  updateTask ({ _id, text }) {
    const taskDoc = Tasks.findOne({ _id })

    if (taskDoc.createdBy !== this.userId) {
      throw new Meteor.Error(403, 'permission denied', 'not owner')
    }

    return Tasks.update({ _id }, { $set: { text }})
  }
})
```

After 3.0, using async/await

```js
Meteor.methods({
  async updateTask ({ _id, text }) {
    const taskDoc = await Tasks.findOneAsync({ _id })

    if (taskDoc.createdBy !== this.userId) {
      throw new Meteor.Error(403, 'permission denied', 'not owner')
    }

    return Tasks.updateAsync({ _id }, { $set: { text }})
  }
})
```

It looks not that much but beware that it breaks *isomorphism*, another core  concept of MeteorJS, where code can be **shared across server and client**. This, combined with the size and structure of medium or large-sized apps can result in a migration effort of multiple months, involving multiple developers.

Another big task was to resolve the version conflicts in the packages, since all of the MeteorJS core packages were updated to a new major version. Thankfully, the Meteor Community Ambassadors ([StoryTellerCZ](https://dev.to/storytellercz), Alim Gafar, and I) collaborated to create a detailed guide covering this topic: 


{% embed https://youtube.com/live/hGoxWQNIrfs?feature=share %}

---
## Conclusion

The next major MeteorJS release is coming in a few weeks, and of course, there will be changes if you have Meteor apps and packages. To help you prepare for all of them, I have made a list below to help you. 

---
## Resources to help you migrate your Meteor app

- Read the [migration guide](https://guide.meteor.com/3.0-migration)
- Read on how to [prepare your 2.x app for async](https://guide.meteor.com/prepare-meteor-3.0)
- Read the [new meteor 3.0 docs](https://v3-docs.meteor.com/)
- Read on [extended Node 14 support with security patches](https://guide.meteor.com/using-node-v14.21.4)
- Subscribe to the [Meteor Community Dispatches podcast](https://www.youtube.com/channel/UCqi1HYAD1Mm2vZtAn3-H-Cw) to stay up to date
- [Consult StorytellerCZ](https://cal.com/storyteller), Meteor ambassador and one of the (if not the) most active contributors from the community for help
- Join the [Meteor forums](https://forums.meteor.com/) and ask for help and guidance

I hope you enjoy this read and see you on Meteor Community!

---
## About me 👋

I regularly publish articles about **MeteorJS** and **JavaScript** here on dev.to. I also recently co-hosted the [weekly MeteorJS Community Podcast](https://www.youtube.com/@meteorjscommunity), which covers the latest in Meteor and the community.

You can also find me (and contact me) on [GitHub](https://github.com/jankapunkt/), [Twitter/X](https://twitter.com/kuester_jan) and [LinkedIn](https://www.linkedin.com/in/jan-kuester/).

If you like what you read and want to support me, you can [sponsor me on GitHub](https://github.com/jankapunkt) or buy me a book from [my Amazon wishlist](https://www.amazon.de/-/en/hz/wishlist/ls/12YMIY0QNH9TK?ref_=list_d_wl_lfu_nav_1).