-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments, looks fine to me
Released 2.8.0-rc.0 for testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looking good :)
Summary
This makes NetInfo a true optional dependency.
If Meteor.connect options contain
NetInfo: null
it 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