Discussion on Update ECMAScript 2015 to 2023

It would be great for the babel packages to be updated. These are the main things that need to be done. They don’t all have to be done at the same time or by the same person.

  1. In meteor-babel, add a function to get defaults for the node version used in Meteor 3. We have one for node 8, but haven’t added any for newer node versions: https://github.com/meteor/meteor/blob/829d0eabb6357714f42699a88d9d751d0b6eb0bb/npm-packages/meteor-babel/options.js#L165. This includes both removing babel plugins that aren’t needed anymore, and adding babel plugins for ecmascript features that Node is missing. A useful resource is https://node.green
  2. Do the same thing for Node 14 to use in Meteor 2
  3. Update the config for Node 8 so it supports that latest ecmascript features
  4. Update minimum version for modern browsers: https://github.com/meteor/meteor/blob/devel/npm-packages/babel-preset-meteor/babel-presets-meteor/modern.js. Move the babel plugins for ecmascript features that are widely supported to index.js (used for the legacy client) and update the minimum modern browser versions so any browsers that don’t support those features use the legacy client.
  5. Ensure the legacy client has babel plugins for all newer ecmascript features
  6. Ensure the modern client has babel plugins for all ecmascript features that are not fully supported by the minimum modern browser versions.
  7. Drop support for browsers that don’t fully support es5. I don’t think Meteor has supported these browsers for years, but there is still code in every Meteor app to support them
  8. We’ve discussed possibly dropping support for old browsers that don’t support es6 classes. This would allow the legacy client to use native es6 classes, fixing a common cause for the legacy client to break. Since the browser versions that supports classes also support many other es6 features, this would allow us to remove many babel plugins and polyfills from the legacy client.

There’s also the ecmascript-runtime-client and ecmascript-runtime-server packages that need to be updated along with the babel packages.

We don’t really have any guidelines on where to put the line between legacy and modern clients. One thing to keep in mind is that many developers don’t test the legacy client so it frequently is broken.

The data for caniuse and mdn support tables has become easily accessible the past few years. We could create some simple tools to help with maintaining this.

2 Likes