I think meteor needs a way to not be reactive as well, cause sometimes it’s just a pain in th a**. Do you think its possible to have like an option in the core to not be reactive which kind of defaults to true. I don’t know if this has been discussed early but i would like to hear some opinions from people who have a good understanding of the core.
So we could create like a non reactive publication, a non reactive tracker.autorun function etc, by passing another parameter or an options object?
You can have non-reactive publication if you use low level publish API.
Why would you want non-reactive tracker? Just dont use tracker and it would be automatically non-reactive.
We have reactive:false for Cursor.find on client side, so there you can have also full control when something recompute.
I know we can’t do that stuff right now, this is kind of a discussion on what the community thinks of these options. I know its best to not use tracker.autorun if you don’t want reactivity, but think of this use case, you wanted reactivity for a certain amount of time then you no longer need it. Being able to switch reactivity on/off on demand could be a great addition.
Also regarding publication reactivity, that is exactly what i would want to have. I mean having the option to create non-reactive publications on the lowest level would be very useful in my opinion.
Start there and keep reading. It starts by describing the “traditional” reactive publication that meteor is so well known for. It then goes on to describe how you can have full direct control of the publication. On the server, you can either return a cursor, or you can use simple non-reactive updates.
I’ve always thought that Meteor couples together three things with the data system that should each be opt-in on their own:
Optimistic UI
Global data store for consistent UI
Reactive data pushing from the server
I hope a future version of Meteor lets you explicitly make tradeoffs between these three. In particular, 1 requires a lot of “magic” complexity on the frontend, and 3 requires a very fancy database driver and rocket scientist scaling; it would be cool if one could opt-out of those.