meteor icon indicating copy to clipboard operation
meteor copied to clipboard

[Meteor 3] Tinytest major version increased

Open zodern opened this issue 1 year ago • 4 comments

I have a package that should work in Meteor 3 as is, but fails while running tests due to a version constraint on tinytest. The Meteor 3 changelog doesn't mention any breaking changes for tinytest. It would be nice if the major version of tinytest was changed back, or if any breaking changes in the package are documented.

zodern avatar Apr 25 '24 22:04 zodern

Sorry. Of which package you refer into? Or how to replicate the problem you mention?

Just any app with a package on Meteor 2.x using tinytest, when upgrade to 3.x will trigger the version constraint?

nachocodoner avatar Apr 29 '24 13:04 nachocodoner

Anytime the major version of a core package is increased, every package that uses it has to be updated to indicate they are compatible with the new major version. Early Meteor 3 releases had bumped the major version of every core package, and some work was done a while ago to find packages with no breaking changes and revert the major version back to what was. It seems either tinytest was missed, or we're missing documentation on what the breaking changes in it are.

I discovered this while updating montiapm:agent-binary-deps. The only package it uses is tinytest. If tinytest has no breaking changes, then montiapm:agent-binary-deps should have worked in Meteor 3 without having to update its package.js file.

zodern avatar Apr 29 '24 16:04 zodern

I reviewed the current state of the tinytest package.

A minor use of fibers was removed. This change is not breaking as it only affects logging, not functionality.

image

However, a breaking change was identified with the removal of Meteor.connection.registerStore on Meteor 3.x. It was replaced by Meteor.connection.registerStoreClient. As this is a core method affects other packages and likely prompted the major version bump for tinytest, preventing crashes for Meteor 2.x packages using tinytest.

image

The changelog for 3.x mentions a breaking change: tinytest has been updated to version 2.0.0. Is this sufficient, or should we also detail breaking changes in the code, even being an indirect one like registerStoreClient?

image

nachocodoner avatar Jun 26 '24 15:06 nachocodoner

I haven't opened an issue for it yet, but I think Meteor.connection.registerStore and Meteor.connection.registerStoreClient should be combined in Meteor 3. The current solution was at least partly my idea, but after better understanding it there's no reason why the api needs to be async on the server. It allows minimongo to use an async queue for observer callbacks on the server. However, it works fine with a sync queue on the client, and it's only used on the server for collections created for DDP Client's created on the server, or other in-memory collections so it can always by synchronous.

edit: actually, there might be some cases where the async queue on the server could be helpful, depending on what the observer callbacks are doing.

preventing crashes for Meteor 2.x packages using tinytest

Each Meteor release limits which major/minor version of each core package they use. You can bump the minor version of tinytest to prevent Meteor 2.x from using it. The major version doesn't need to be increased for this.

zodern avatar Jun 26 '24 16:06 zodern

This is now fixed.

denihs avatar Jul 24 '24 17:07 denihs