Closed evelant closed 7 years ago
Thanks for letting me know! Do you want to make a PR?
It seems there are some issues with meteor-imports-webpack-plugin that are preventing webpack2 from working as well. https://github.com/luisherranz/meteor-imports-webpack-plugin/issues/13
I am still teaching myself webpack so these issues are difficult for me to solve at the moment. I am not sure when I will have time to dive in far enough to get a workable PR.
As an alternative you can use Redux middleware to handle a lot of the Meteor reactivity. I adapted code from here https://github.com/djhi/my-nutrition/tree/master/app/client/middlewares for my own project.
If those middleware's are active you just fire a redux action like this:
function myAction(param1) {
return {
type: 'MY_ACTION',
meteor: {
subscribe: () => Meteor.subscribe('mysubscription', param1),
get: () => MyCollection.find(),
}
}
}
The caveat here is that data is usually stored twice on the client side. Once in minimongo via Meteor, and then again when the reducer stores it in state. Not a big deal to me. Just ignore that minimongo exists. ;-)
It's funny how many ways there are to solve a problem. I have <MeteorSub>
components that subscribe on mount or prop changes and unsubscribe on unmount so that I can declare what subscriptions I need for a given container. Really convenient for reactive joins on the client. Also, I created some redux integration for Mongo.Cursor.observeChanges
that merges the document changes into my Immutable.js redux state. But it does get tricky to guarantee performance that way with thousands of documents.
Okay, this is fixed now
There seem to be a few issues:
After these changes it seems to run OK, but I am very new to webpack so there may still be other issues.