meteor-vue / vue-meteor-tracker

Use Meteor Tracker reactivity inside Vue components
90 stars 20 forks source link

[Request] Import/require Tracker dependency #16

Open ejfrancis opened 7 years ago

ejfrancis commented 7 years ago

This may not be a typical use case, but I'm running unit tests for a Meteor app with Jest and circumventing Meteor's test command. If you were to change this package from using Tracker as global to an imported/required dependency, I could mock its import with a moduleNameMapper in jest.

So instead of just doing

Tracker.autorun()

It would be great if the dependency was explicitly imported/required

const { Tracker } = require('meteor/tracker');

....
Tracker.autorun()
ejfrancis commented 7 years ago

done in pr #17

ejfrancis commented 7 years ago

@Akryum anything else you need to get this merged?

IamCarbonMan commented 6 years ago

This would also be very useful in combination with Meteor Client Bundler, to use Meteor reactivity with webpack and vue-loader.

GeoffreyBooth commented 5 years ago

I just got hit by this too. @Akryum can we please fix this?