feature: make NetInfo injectable/truly optional#145
Conversation
|
Should we generally discuss connection managment (maybe at some other place)? I tend to use App State to disconnect when the app is sent to background, and reconnect when the app is reopened. This saves a lot of server resources, since otherwise the sockets remain open at least for a while. However, I have some reconnection issues, don't know if this interferes with NetInfo. How does the connection state get managed if no NetInfo is present? |
|
Yes let's open a discussion in regards to a 3.0. this PR is only a fix for the linked issue so @derwaldgeist can continue development. When netinfo is disabled there is all manually to manage right now, including disconnect and reconnect. I also agree with Appstate as without it we have many glitches when opening the app after a certain time |
bratelefant
left a comment
There was a problem hiding this comment.
Added a few comments, looks fine to me
|
Released 2.8.0-rc.0 for testing |
bratelefant
left a comment
There was a problem hiding this comment.
Everything looking good :)
Summary
This makes NetInfo a true optional dependency.
If Meteor.connect options contain
NetInfo: nullit will not be imported and not used. Users need to manually connect/reconnect.If the options is a custom NetInfo (injected) then this will be used.
Otherwise the default NetInfo is loaded.
This allows also to configure netinfo in a much more custom basis than previously.
Linked issue(s)
#143
Involved parts of the project
Meteor.connect / DDP.connect
Added tests?
yes
Targeted Meteor release version
Reproduction
Clone, ceckout branch, run tests
A test release is provided soon