jkuester:migration-helper

v1.1.0Published 5 months ago

Meteor.js Migration Helper

Detect which parts of your Meteor.js server environment need to be migrated in your current 2.x code.

built with Meteor JavaScript Style Guide Project Status: Active – The project has reached a stable, usable state and is being actively developed.

No need to upgrade to 3.0 now to find out, what's still using Fibers.

There is also an article, which covers this packages functionality: https://dev.to/jankapunkt/prepare-your-meteorjs-project-for-the-big-30-release-14bf

Installation

$ meteor add jkuester:migration-helper

Now open in your Meteor.js project the file .meteor/packages and move the entry jkuester:migration-helper to the top, in order to also detect dependency packages that still use Fibers.

Run detection

This is a runtime detection. In order to cover all detectable structures you need to either run your Meteor.js application or the tests.

The more your tests cover of your code (test-coverage), the better you will be able to detect these.

Detect validated methods using mixins

This package also provides a mixin to be used with mdg:validated-method

You can import it via

1import { checkAsyncMixin } from 'meteor/jkuester:migration-helper'
2
3// ...
4const m = new ValidatedMethod({
5  name: 'coolMethod',
6  mixins: [checkAsyncMixin],
7  validate: () => {},
8  run: () => {}
9})

A more versatile approach is to use a factory function for your ValidatedMethods:

1export const createMethod = options => {
2  options.mixins = options.mixins ?? []
3  options.mixins.push(checkAsyncMixin)
4  return new ValidatedMethod(options)
5}

If this is not feasible then you might skip this and let the package detect them at runtime, when they are executed.

Note

This package may not detect everything. However, it helps to identify lots of parts on the server that need change and I hope it will be useful to you.

License

MIT