Weekly Update, November 4th, 2024 🎉

It’s time for an update! We are nearing the release of 3.1.0, which is expected to arrive in one to two weeks.

We have been hard at work upgrading Node.js to v22, the MongoDB driver to v6 and Express to v5.

The beta for 3.1 was out today; please help us validate it.

You can create a new app by calling the following command:

meteor create myapp --release=3.1-beta.0

We started refactoring the mongo package for TypeScript and splitting large files into more manageable parts. Let’s say it lacked some 5S! Things are starting to look much better there.

The 5S methodology, originating from Japan, is a system for workplace organization and efficiency. It includes five steps: Sort (remove unnecessary items), Set in Order (organize and label everything), Shine (clean the workspace), Standardize (establish routines), and Sustain (maintain practices). This approach reduces waste, improves workflow, and fosters a disciplined, efficient work environment.

Japan seems to be a theme lately :japanese_castle:

This ties back to our commitment to performance and TypeScript, preparing the floor for big architectural improvements and lowering the barrier for contributions by reducing cognitive load (among many other benefits!). There is still a long way to go, but a journey of a thousand miles starts with a single step.

The first and last steps are the real game-changers: knowing where you’re headed and making sure you start moving in that direction every single day.

The goal is to completely refactor the real-time logic, which is the heart of Meteor and involves mainly the mongo package and others, like ddp.


We also created a completely experimental package which aims at helping devs understand easily how they can optimize their apps. We called it, surprise suprise, meteor-perf!

It’s still quite early, so you should not install and run it in production yet, definitely not on a Friday.

What it does, in basic terms, is watch and aggregate observer behavior by collection & selector, giving you the hotspots of activity in your real-time logic, and help anyone perform userland optimizations.

  "observer_stats": [
    {
      "key": "child::{\"parentId\":\"MBLMPnnYYCu3RC99p\"}",
      "added": 5600,
      "changed": 3234,
      "removed": 0,
      "started": 56,
      "stopped": 42,
      "lagging_added": 0,
      "lagging_changed": 0,
      "lagging_removed": 0,
      "score": 14854
    }
  ]

This array is sorted by score, which is a heuristic to account for expensive operations, so that heavier stats will be at the top.

The output can be downloaded anytime by the following endpoint:

GET /meteor-perf.json

Bear in mind the queries are not anonymized yet, and there might be a memory leak somewhere (nasty things!). This will get more mature in the future. Please help validate it! :hugs:


• Tasks and fixes for the next, Meteor 3.1.0 release.
• Update Node to v22
• Update Mongo Driver to v6
• Update Express to v5
• Include Roles into Meteor Core
• Create meteor-perf package
• Refactor or prepare mongo package for TypeScript (Phase 1, ~60%)
• Fix slow HMR in Meteor 3.0
• Remove inflight from Meteor Node Stubs
• Upgrade elliptic in Meteor Node Stubs
• Cordova has incomplete dependencies on build Android project within specific plugins
• Performance benchmark suite improvements
• Measure performance with Node v22 and --experimental-async-context-frame
• Fix bindEnvironment is not preserving all values (thanks to @zodern)
• Remove Underscore (thanks to @harry97)
• Fix reify being too eager to detect TLA with false positives (thanks to @permb)

Pull Requests for v3.1.0

Next Releases

  • Meteor 3.1 (Early-November, 2024)
  • Meteor 3.1.1 (Mid/Late-November, 2024)
13 Likes

@zodern monti-apm throws

meteor://đź’»app/packages/montiapm_agent.js:6926
      const Layer = WebApp.rawHandlers.parent._router.stack[0].constructor;
                                                      ^

TypeError: Cannot read properties of undefined (reading 'stack')
    at wrapWebApp (packages/montiapm:agent/lib/hijack/wrap_webapp.js:54:51)
    at Object.Kadira._startInstrumenting (packages/montiapm:agent/lib/hijack/instrument.js:29:3)
    at module.wrapAsync.self (packages/montiapm:agent/lib/auto_connect.js:47:8)
    at Module.wrapAsync (/Users/jan-michaelpilgenroeder/.meteor/packages/modules/.0.20.3-beta310.0.my9feev5s1c++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:252:8)
    at module (/Users/jan-michaelpilgenroeder/Code/plAIground/.meteor/local/build/programs/server/packages/montiapm_agent.js:7225:9)
    at fileEvaluate (packages/modules-runtime.js:335:7)
    at Module.require (packages/modules-runtime.js:237:14)
    at Module.mod.require (/Users/jan-michaelpilgenroeder/.meteor/packages/modules/.0.20.3-beta310.0.my9feev5s1c++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
    at Object.require (packages/modules-runtime.js:257:21)
    at evaluateNextModule (packages/core-runtime.js:167:26)
    at evaluateNextModule (packages/core-runtime.js:202:7)
    at evaluateNextModule (packages/core-runtime.js:202:7)
    at evaluateNextModule (packages/core-runtime.js:202:7)
    at evaluateNextModule (packages/core-runtime.js:202:7)
    at evaluateNextModule (packages/core-runtime.js:202:7)
    at evaluateNextModule (packages/core-runtime.js:202:7)

Node.js v22.11.0
1 Like

Could be the Express upgrade perhaps :thinking:

It’s montiapm:agent try disabling it and the error would go away

@leonardoventurini because I trust you :)) I pushed the 3.1 beta to production with a small project and all works ok. I use the montiapm:agent, I don’t see an error in the server console in production (but I do see it in development) and I am getting the APM production data on my self hosted Kadira system.
Unfortunately Monti still depends on Underscore.

Screenshot 2024-11-06 at 1.06.25 PM

4 Likes

Are you seeing any massive migration for those affected by these updates?
Those using webapp for custom endpoints?
Those using rawCollection()?

Mongo v6 should be straightforward; Express seems to have a more significant impact in userland code

I’ve published a new version of the montiapm:agent that adds support for express 5.

Unfortunately Monti still depends on Underscore.

It’s only used on the server, so as long as you have no other packages that use underscore it won’t be part of the client bundle. I’ll look into removing it from the server too.

2 Likes

When I said “unfortunately” I meant no pressure :). I know Meteor generally is being deunderscored. I keep seeing git commits from the team.

3 Likes