meteor-feature-requests icon indicating copy to clipboard operation
meteor-feature-requests copied to clipboard

Move Random to npm

Open juho opened this issue 8 years ago • 2 comments

meteor-random was last published three years ago, so it would be nice to have the random module officially on npm for interop purposes. The core code could just wrap that. Currently for some Lambda functions we've resorted to just having a minified version of the one in the meteor repo with Meteor.isServer and some other things hacked off.

I'm aware of #51, maybe the way forward would be with single package migrations instead of a monolithic project? Random and check/match would both be great to have on npm to start with. ReactiveVar, Tracker, timers, Session and such only are applicable in Meteor (and some only make sense with Blaze) so it doesn't make a lot of sense to migrate them to npm while Atmosphere is a thing.

juho avatar Oct 16 '17 18:10 juho

Just to add another usecase here: We currently maintain a pretty huge meteor application and fromm time to time to schema migration with an external non-meteor application. The problem is that we cannot access Random for generating the meteor like ids - so the current workaround is copy pasting the related code from https://github.com/meteor/meteor/tree/devel/packages/random to our external application. It would be good if we could instead just use the official package.

@juho I read somewhere (not in the linked ticket and can't find it any more) that one of the main blockers for moving packages to npm is the testing story. TinyTest is only working within meteor and caused by this we cannot move meteor core packages to npm without moving TinyTest before. (or sth along these lines, please correct me if this is wrong).

Looking at #9603 https://github.com/meteor/meteor/pull/9603/files#diff-8ce5da5333dd95f3ab6f86723bfafb70 tests don't seem to be that massive for meteor/random so perhaps just rewriting them with another test runner would be an option as well? Let me know if I can somehow assist with that part.

sakulstra avatar May 22 '18 16:05 sakulstra

https://github.com/reactioncommerce/random is a good replacement, it's used in https://github.com/meteor/meteor/pull/11423

harryadel avatar May 12 '21 12:05 harryadel